From 1f5cd1da6231d2b29272ad41c58daeac18a2beb9 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 19 Sep 2013 17:48:01 +0200 Subject: [PATCH 01/11] create category template --- templates/default/category.html | 19 +++++++++++++++++++ templates/default/product.html | 11 +++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 templates/default/category.html diff --git a/templates/default/category.html b/templates/default/category.html new file mode 100644 index 000000000..8bca4fbde --- /dev/null +++ b/templates/default/category.html @@ -0,0 +1,19 @@ +{extends file='layout.tpl'} + +{block name="breadcrumb"} + +{/block} diff --git a/templates/default/product.html b/templates/default/product.html index fbce6d510..c2135d232 100644 --- a/templates/default/product.html +++ b/templates/default/product.html @@ -4,10 +4,13 @@ {/block} From a540626fff891eb2f38af5d7a1bb66762d2a766e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 19 Sep 2013 18:47:12 +0200 Subject: [PATCH 02/11] fix product import --- install/import/products.csv | 2 +- templates/default/category.html | 170 ++++++++++++++++++ .../default/includes/category-toolbar.html | 52 ++++++ templates/default/product.html | 6 +- 4 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 templates/default/includes/category-toolbar.html diff --git a/install/import/products.csv b/install/import/products.csv index d2d84fb53..b085feee2 100644 --- a/install/import/products.csv +++ b/install/import/products.csv @@ -18,7 +18,7 @@ Swivel feature for added function. ";"Zoe est un fauteuil contemporain qui combi "PROD013";"Violet";"A beautifull classic";"Une beauté classique";"A new edition of a classic. Beneath a beautiful colorfull leather, a strong walnut wood frame. You will appreciate the luxurious stylish details of the ''Violet'' armless chair. ";"La réédition d'un classique. Sous un superbe cuir aux couleurs chatoyantes, une solide structure en noyer. Vous apprécierez les détails stylistiques luxueux de notre chaise Violet. ";"Dimensions : Width : 19'' – Depth : 23'' – Height : 31''";"Dimensions : Larg. 50 cm – Prof.60 cm – Haut. 80 cm";98;;"PROD013-1.jpg";"MAGIS";"Gray";"Chairs" "PROD014";"Sally";"Contemporary atypical chair";"Chaise contemporaine hors normes";"Contemporary atypical chair. The atypical sitting of the ''Sally '' chair will nestled you in confort. Play with the vibrant colours range to create a unique dining room. ";"Chaise contemporaine hors normes. L'assise surprenante de la chaise Sally vous enveloppera de confort. Amusez vous avec l'éventail de couleurs lumineuses pour créer une salle à manger unique. ";"Dimensions : Width : 19'' – Depth : 23'' – Height : 31''";"Dimensions : Larg. 50 cm – Prof.60 cm – Haut. 80 cm";112;;"PROD014-1.jpg;PROD014-2.jpg;PROD014-3.jpg;PROD014-4.jpg";"PARRY";"blue;purple;orange;yellow";"Chairs" "PROD015";"Oliver";"Comfort & Design";"Confort et Design";"Surround yourself in ultra modern luxury with the ''Oliver'' armchair and get a look at the future ! Eye-catching, this unique combination of comfort and design is a must-have for today's book nook. ";"Abandonnez vous à un univers de luxe ultra moderne avec le fauteuil Oliver et voyagez dans le futur ! Cette combinaison unique de confort et de design est spectaculaire. Un élément incontournable pour votre bibliothèque. ";"Dimensions : Width : 30'' – Depth : 27'' – height : 31''";"Dimensions : Larg. 75 cm – Prof. 69 cm – Haut. 80 cm";340;;"PROD015-1.jpg;PROD015-2.jpg;";"MAGIS";"white;black";"Armchairs;Chairs" -"PROD016";"Lexie";"A modern style";"Un style moderne";"Demonstrate your flair for modern style with our ''Lexie'' chair in your dining room. A rectangular cushioned back offers a contemporary feel, while the comfortable seat provides complete comfort. ";"Montrez que vous avez le sens de la modernité en choisissant la chaise ''Lexie'' pour votre salle à manger. Le coussin rectangulaire sur le dossier apporte une touche contemporaine. L'assise généreuse apporte un confort complet. ";"Dimensions : Width : 19'' – Depth : 23'' – Height : 40''";"Dimensions : larg. 50 cm – Prof. 60 cm – Haut. 100 cm";159;;"PROD016-1.jpg";"PLINK";;"Chairs" +"PROD016";"Lexie";"A modern style";"Un style moderne";"Demonstrate your flair for modern style with our ''Lexie'' chair in your dining room. A rectangular cushioned back offers a contemporary feel, while the comfortable seat provides complete comfort. ";"Montrez que vous avez le sens de la modernité en choisissant la chaise ''Lexie'' pour votre salle à manger. Le coussin rectangulaire sur le dossier apporte une touche contemporaine. L'assise généreuse apporte un confort complet. ";"Dimensions : Width : 19'' – Depth : 23'' – Height : 40''";"Dimensions : larg. 50 cm – Prof. 60 cm – Haut. 100 cm";159;;"PROD016-1.jpg";"PLINK";"Beige";"Chairs" "PROD017";"Flynn";"A touch of retro vibe";"Un petit air rétro";"If your destination is up-to-date décor with a touch of retro vibe, look no further than our ''Flynn'' sofa. Sleek, low track arms and high tapering legs give this piece a mid-century flavor. The vibrant tones of the woven upholstery will easily blend with any interior décor. ";"Si vous recherchez une décoration actuelle avec une touche rétro, n'allez pas plus loin et opter pour notre canapé ''Flynn''. Ce canapé a un petit air des années 50 grâce à ses accoudoirs bas, ses pieds allongés et ses lignes pures. Les couleurs chatoyantes de son revêtement en laine lui permettent de se fondre dans tous les intérieurs. ";"Dimensions : Width : 89'' – Depth : 37'' – Height : 36''";"Dimensions : Larg. 225 cm – Prof. 95 cm – Haut. 90 cm";1299;;"PROD017-1.jpg;PROD017-2.jpg;PROD017-3.jpg;PROD017-4.jpg";"OFFUS";"blue;green;red;purple";"Sofas" "PROD018";"Emily";"A old-world feel";"Une touche d'histoire";"Our ''Emily'' armlesschair adds a touch of a old-world feel to your space. Perfect for when defining the seating space in a larger room. A medium wood finish sets off the delicate embellishments at the base, while the luxurous upholstery keeps the look fresh. The cushions guarantee that this is a chair worth relaxing in, not just admiring from afar. ";"La chaise ''Emily'' apporte une touche d'histoire à votre intérieur. Elle est parfaite pour structurer votre espace, notamment dans une grande pièce. Les finitions bois font la part belle à de délicates arabesques, tandis que le luxueux revêtement apporte un look frais. Cette chaise n'est pas destinée à la figuration grâce à la mousse confortable de l'assise. ";"Dimensions : Width : 33'' – Depth : 27'' – Height : 40''";"Dimensions : Larg. 85 cm – Prof. 69 cm – Haut. 100 cm";690;;"PROD018-1.jpg";"PARRY";"red";"Armchairs" "PROD019";"Edgar";"A special spot";"Un endroit à part";"A special spot for reading, lounging or chatting, our '' Edgar '' armchair has no reservations when it comes to style. The design starts with mid-century modern elements like lean arms, while the brushed stainless steel base ensures stability. Swivel feature for added function. ";"Un endroit spécial où lire, rêver ou discuter, notre fauteuil ''Edgar'' n'a pas de limite quand il s'agit de style. Son design part d'éléments contemporains comme ses accoudoirs bas et fins, tandis que sa base en inox brossé assure la stabilité de l'ensemble. Siège pivotant. ";"Dimensions : Width : 33'' – Depth : 27'' – Height : 40''";"Dimensions: Larg. 85 cm – Prof. 69 cm – Haut. 100 cm";275;;"PROD019-1.jpg;PROD019-2.jpg;PROD019-3.jpg;PROD019-4.jpg;PROD019-5.jpg";"TOKO";"blue;yellow;orange;pink;purple";"Armchairs" diff --git a/templates/default/category.html b/templates/default/category.html index 8bca4fbde..3ac31189a 100644 --- a/templates/default/category.html +++ b/templates/default/category.html @@ -17,3 +17,173 @@ {/block} + +{block name="main-content"} +
+ +
+ {include file="includes/category-toolbar.html" toolbar="top"} +
+
+ +
+
+ {include file="includes/category-toolbar.html" toolbar="bottom"} +
+ + + +
+ + +{/block} diff --git a/templates/default/includes/category-toolbar.html b/templates/default/includes/category-toolbar.html new file mode 100644 index 000000000..59a78151e --- /dev/null +++ b/templates/default/includes/category-toolbar.html @@ -0,0 +1,52 @@ + diff --git a/templates/default/product.html b/templates/default/product.html index c2135d232..63ad2364b 100644 --- a/templates/default/product.html +++ b/templates/default/product.html @@ -58,10 +58,10 @@
From a7a755fab589c25cf0f962603afa667880f90ffc Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 19 Sep 2013 18:58:43 +0200 Subject: [PATCH 03/11] add isbn meta tag --- templates/default/category.html | 17 +++++++++++++---- templates/default/product.html | 10 +++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/templates/default/category.html b/templates/default/category.html index 3ac31189a..153dafc9d 100644 --- a/templates/default/category.html +++ b/templates/default/category.html @@ -31,8 +31,17 @@
  • - - + {$product_id=$ID} + {loop name="brand.feature" type="feature" product=$ID title="brand"} + {loop name="brand.value" type="feature_value" feature=$ID product=$product_id} + + {/loop} + {/loop} + {loop name="brand.feature" type="feature" product=$ID title="isbn"} + {loop name="brand.value" type="feature_value" feature=$ID product=$product_id} + + {/loop} + {/loop}
    + {include file="includes/menu.html"}

    Find a product

    @@ -135,13 +49,21 @@
    Type
    -
    -
    +
    + +
    +
    +
    -
    @@ -150,13 +72,21 @@
    Price
    - $value) { ?>
    -
    +
    + +
    +
    +
    -
    @@ -165,13 +95,21 @@
    Size
    - $value) { ?>
    -
    +
    + +
    +
    +
    -
    diff --git a/templates/default/includes/menu.html b/templates/default/includes/menu.html new file mode 100644 index 000000000..083c74ef2 --- /dev/null +++ b/templates/default/includes/menu.html @@ -0,0 +1,27 @@ +
  • + {/for} + + {if $CHILD_COUNT > 0 } +
  • {$TITLE} ({$CHILD_COUNT}) + +
      + {else} + +
    • {$TITLE} (0)
    • + {/if} + {assign "previousLevel" $LEVEL} + {/loop} +
    + + + \ No newline at end of file diff --git a/templates/default/includes/single-product.html b/templates/default/includes/single-product.html new file mode 100644 index 000000000..40b9d326b --- /dev/null +++ b/templates/default/includes/single-product.html @@ -0,0 +1,60 @@ +
    + + {loop name="brand.feature" type="feature" product=$ID title="brand"} + {loop name="brand.value" type="feature_value" feature=$ID product=$product_id} + + {/loop} + {/loop} + {loop name="brand.feature" type="feature" product=$ID title="isbn"} + {loop name="brand.value" type="feature_value" feature=$ID product=$product_id} + + {/loop} + {/loop} + + + +
    +

    {$TITLE}

    + +
    +

    {$DESCRIPTION}

    +
    +
    + +
    +
    + + + + + + {if $IS_PROMO } + {loop name="productSaleElements_promo" type="product_sale_elements" product=$ID limit="1" order="min_price"} + {assign var="default_product_sale_elements" value=$ID} + {intl l="Special Price:"} {format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"} + {intl l="Regular Price:"} {format_number number=$TAXED_PRICE} {currency attr="symbol"} + {/loop} + {else} + {format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"} + {/if} + +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/templates/default/index.html b/templates/default/index.html index ca6fbbf7c..674892ce9 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -80,8 +80,7 @@ preorder : http://schema.org/PreOrder online_only : http://schema.org/OnlineOnly --> - {currency attr="symbol"} {format_number number="{$BEST_TAXED_PRICE}"} - + {format_number number="{$BEST_TAXED_PRICE}"} {currency attr="symbol"} From 16de9bbcc92930779503a9a8c18e4439e2fc37f6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Sep 2013 09:19:12 +0200 Subject: [PATCH 08/11] allow displaying how much product wanted in category page --- .../Template/Smarty/Plugins/UrlGenerator.php | 3 ++- templates/default/assets/js/script.js | 27 +++---------------- templates/default/category.html | 6 ++--- .../default/includes/category-toolbar.html | 14 +++++----- 4 files changed, 15 insertions(+), 35 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php index aa96a0014..f1249697a 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/UrlGenerator.php @@ -186,7 +186,8 @@ class UrlGenerator extends AbstractSmartyPlugin protected function getCurrentUrl() { - return URL::getInstance()->retrieveCurrent($this->request)->toString(); + //return URL::getInstance()->retrieveCurrent($this->request)->toString(); + return $this->request->getUri(); } protected function getReturnToUrl() diff --git a/templates/default/assets/js/script.js b/templates/default/assets/js/script.js index 18581ed1e..2bbba577f 100644 --- a/templates/default/assets/js/script.js +++ b/templates/default/assets/js/script.js @@ -126,31 +126,10 @@ }).filter(':has(:checked)').addClass('active'); }); + $('#limit-top').change(function(e){ + window.location = $(this).val() + }); - // Styliser le message Confirm par Bootstrap sur un formulaire - /* - $('body').on('click', '[data-confirm]', function(){ - var $this = $(this); - bootbox.confirm($(this).attr('data-confirm'), - function(result){ - if(result) { - // Si lien - if($this.attr('href')){ - window.location.href = $this.attr('href'); - }else{ - // Si on doit soumettre un formulaire - var $form = $this.closest("form"); - if($form.size() > 0){ - $form.submit(); - } - } - } - } - ); - - return false; - }); - */ }); })(jQuery); diff --git a/templates/default/category.html b/templates/default/category.html index aa6f95c08..5c1516f45 100644 --- a/templates/default/category.html +++ b/templates/default/category.html @@ -20,13 +20,13 @@ {block name="main-content"}
    - + {$limit={$smarty.get.limit|default:8}}
    - {include file="includes/category-toolbar.html" toolbar="top"} + {include file="includes/category-toolbar.html" toolbar="top" limit=$limit}
      - {loop type="product" name="product_list" category={category attr="id"}} + {loop type="product" name="product_list" category={category attr="id"} limit=$limit}
    • {include file="includes/single-product.html" product_id=$ID} diff --git a/templates/default/includes/category-toolbar.html b/templates/default/includes/category-toolbar.html index 98ce01434..8268d6393 100644 --- a/templates/default/includes/category-toolbar.html +++ b/templates/default/includes/category-toolbar.html @@ -5,11 +5,11 @@ per page @@ -30,8 +30,8 @@ {intl l="View as"}: - - + + From bb40086e2ae1b4d85d68bfba6ecec5996ce8a066 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Sep 2013 13:59:51 +0200 Subject: [PATCH 09/11] allow to order products on category page --- templates/default/assets/js/script.js | 4 + templates/default/category.html | 89 ++----------------- .../default/includes/categories-filters.html | 77 ++++++++++++++++ .../default/includes/category-toolbar.html | 63 ++++++++----- .../default/includes/single-product.html | 13 ++- templates/default/index.html | 57 +----------- 6 files changed, 136 insertions(+), 167 deletions(-) create mode 100644 templates/default/includes/categories-filters.html diff --git a/templates/default/assets/js/script.js b/templates/default/assets/js/script.js index 2bbba577f..d115d2c5d 100644 --- a/templates/default/assets/js/script.js +++ b/templates/default/assets/js/script.js @@ -130,6 +130,10 @@ window.location = $(this).val() }); + $('#sortby-top').change(function(e){ + window.location = $(this).val() + }); + }); })(jQuery); diff --git a/templates/default/category.html b/templates/default/category.html index 5c1516f45..99db32948 100644 --- a/templates/default/category.html +++ b/templates/default/category.html @@ -21,16 +21,15 @@ {block name="main-content"}
      {$limit={$smarty.get.limit|default:8}} + {$product_page={$smarty.get.page|default:1}} + {$product_order={$smarty.get.order|default:'alpha'}}
      - {include file="includes/category-toolbar.html" toolbar="top" limit=$limit} + {include file="includes/category-toolbar.html" toolbar="top" limit=$limit order=$product_order}
        - {loop type="product" name="product_list" category={category attr="id"} limit=$limit} - -
      • - {include file="includes/single-product.html" product_id=$ID} -
      • + {loop type="product" name="product_list" category={category attr="id"} limit=$limit page=$product_page order=$product_order} + {include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="218" height="146"} {/loop}
      @@ -42,83 +41,7 @@ {include file="includes/menu.html"} -
      -

      Find a product

      -
      -
      -
      - Type -
      -
      - -
      -
      - -
      -
      - -
      -
      -
      -
      - -
      -
      - Price -
      -
      - -
      -
      - -
      -
      - -
      -
      -
      -
      - -
      -
      - Size -
      -
      - -
      -
      - -
      -
      - -
      -
      -
      -
      - -
      - -
      -
      -
      + {include file="includes/categories-filters.html"} diff --git a/templates/default/includes/categories-filters.html b/templates/default/includes/categories-filters.html new file mode 100644 index 000000000..6a9425a66 --- /dev/null +++ b/templates/default/includes/categories-filters.html @@ -0,0 +1,77 @@ +
      +

      Find a product

      +
      +
      +
      + Type +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      + Price +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      + Size +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      + +
      +
      +
      \ No newline at end of file diff --git a/templates/default/includes/category-toolbar.html b/templates/default/includes/category-toolbar.html index 8268d6393..99583a02d 100644 --- a/templates/default/includes/category-toolbar.html +++ b/templates/default/includes/category-toolbar.html @@ -1,30 +1,30 @@ -
      \ No newline at end of file +
    +
  • \ No newline at end of file diff --git a/templates/default/index.html b/templates/default/index.html index 674892ce9..390f06965 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -100,62 +100,7 @@
      {loop name="product_promo" type="product" limit="5" promo="yes"} -
    • -
      - - {$product_id=$ID} - {loop name="brand.feature" type="feature" product="{$ID}" title="brand"} - {loop name="brand.value" type="feature_value" feature="{$ID}" product="$product_id"} - - {/loop} - {/loop} - {loop name="brand.feature" type="feature" product=$ID title="isbn"} - {loop name="brand.value" type="feature_value" feature=$ID product=$product_id} - - {/loop} - {/loop} - - - -
      -

      {$CHAPO}

      -
      - -
      -
      - {loop type="category" name="category_tag" id=$DEFAULT_CATEGORY} - - {/loop} - - - - - {loop name="productSaleElements_promo" type="product_sale_elements" product="{$ID}" limit="1"} - {intl l="Special Price:"} {format_number number="{$TAXED_PROMO_PRICE}"} {currency attr="symbol"} - {intl l="Regular Price:"} {format_number number="{$TAXED_PRICE}"} {currency attr="symbol"} - {/loop} -
      -
      -
      -
    • + {include file="includes/single-product.html" product_id=$ID hasBtn=false hasDescription=false width="218" height="146"} {/loop}
    From 1649e4d76b5e120e80ad90579c46d4381375c5c2 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Sep 2013 14:26:36 +0200 Subject: [PATCH 10/11] fix query in Thelia\Model\Folder::countAllContents --- core/lib/Thelia/Model/Folder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index 8cbe00ce0..128c5932a 100755 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -44,8 +44,8 @@ class Folder extends BaseFolder foreach($children as $child) { - $contentsCount += ProductQuery::create() - ->filterByCategory($child) + $contentsCount += ContentQuery::create() + ->filterByFolder($child) ->count(); } From 2cf71f99a90c3dae389fd486fcdf997f49f9749a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 20 Sep 2013 14:38:11 +0200 Subject: [PATCH 11/11] change some informations in layou --- templates/default/layout.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/layout.tpl b/templates/default/layout.tpl index 7834bc706..37cbad224 100644 --- a/templates/default/layout.tpl +++ b/templates/default/layout.tpl @@ -314,10 +314,10 @@ URL: http://www.thelia.net
  • - +33 09 08 07 06 05 + +33 04 44 05 31 00
  • - +