diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php
index bd1c32de2..7a0bac76d 100755
--- a/core/lib/Thelia/Core/Template/Loop/Category.php
+++ b/core/lib/Thelia/Core/Template/Loop/Category.php
@@ -206,7 +206,8 @@ class Category extends BaseI18nLoop
->set("POSTSCRIPTUM", $category->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT", $category->getParent())
->set("URL", $category->getUrl($locale))
- ->set("PRODUCT_COUNT", $category->countChild())
+ ->set("PRODUCT_COUNT", $category->countAllProducts())
+ ->set("CHILD_COUNT", $category->countChild())
->set("VISIBLE", $category->getVisible() ? "1" : "0")
->set("POSITION", $category->getPosition())
diff --git a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
index 712767954..009e2204f 100755
--- a/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
+++ b/core/lib/Thelia/Core/Template/Loop/CategoryTree.php
@@ -59,7 +59,7 @@ class CategoryTree extends BaseI18nLoop
}
// changement de rubrique
- protected function buildCategoryTree($parent, $visible, $level, $max_level, $exclude, LoopResult &$loopResult)
+ protected function buildCategoryTree($parent, $visible, $level, $previousLevel, $max_level, $exclude, LoopResult &$loopResult)
{
if ($level > $max_level) return;
@@ -87,11 +87,12 @@ class CategoryTree extends BaseI18nLoop
->set("ID", $result->getId())->set("TITLE", $result->getVirtualColumn('i18n_TITLE'))
->set("PARENT", $result->getParent())->set("URL", $result->getUrl($locale))
->set("VISIBLE", $result->getVisible() ? "1" : "0")->set("LEVEL", $level)
+ ->set('CHILD_COUNT', $result->countChild())->set('PREV_LEVEL', $previousLevel)
;
$loopResult->addRow($loopResultRow);
- $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $max_level, $exclude, $loopResult);
+ $this->buildCategoryTree($result->getId(), $visible, 1 + $level, $level, $max_level, $exclude, $loopResult);
}
}
@@ -109,7 +110,7 @@ class CategoryTree extends BaseI18nLoop
$loopResult = new LoopResult();
- $this->buildCategoryTree($id, $visible, 0, $depth, $exclude, $loopResult);
+ $this->buildCategoryTree($id, $visible, 0, 0, $depth, $exclude, $loopResult);
return $loopResult;
}
diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php
index cfd54db4f..5c56dff94 100755
--- a/core/lib/Thelia/Core/Template/Loop/Folder.php
+++ b/core/lib/Thelia/Core/Template/Loop/Folder.php
@@ -162,7 +162,8 @@ class Folder extends BaseI18nLoop
->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM'))
->set("PARENT", $folder->getParent())
->set("URL", $folder->getUrl($locale))
- ->set("CONTENT_COUNT", $folder->countChild())
+ ->set("CHILD_COUNT", $folder->countChild())
+ ->set("CONTENT_COUNT", $folder->countAllContents())
->set("VISIBLE", $folder->getVisible() ? "1" : "0")
->set("POSITION", $folder->getPosition())
;
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/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();
}
diff --git a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
index 19947efa6..0a8af40c8 100644
--- a/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
+++ b/core/lib/Thelia/Model/Tools/UrlRewritingTrait.php
@@ -44,8 +44,11 @@ trait UrlRewritingTrait {
*
* @param string $locale a valid locale (e.g. en_US)
*/
- public function getUrl($locale)
+ public function getUrl($locale = null)
{
+ if(null === $locale) {
+ $locale = $this->getLocale();
+ }
return URL::getInstance()->retrieve($this->getRewrittenUrlViewName(), $this->getId(), $locale)->toString();
}
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/assets/js/script.js b/templates/default/assets/js/script.js
index 18581ed1e..d115d2c5d 100644
--- a/templates/default/assets/js/script.js
+++ b/templates/default/assets/js/script.js
@@ -126,31 +126,14 @@
}).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();
- }
- }
- }
- }
- );
+ $('#sortby-top').change(function(e){
+ window.location = $(this).val()
+ });
- return false;
- });
- */
});
})(jQuery);
diff --git a/templates/default/category.html b/templates/default/category.html
new file mode 100644
index 000000000..99db32948
--- /dev/null
+++ b/templates/default/category.html
@@ -0,0 +1,51 @@
+{extends file='layout.tpl'}
+
+{block name="breadcrumb"}
+
+{/block}
+
+{block name="main-content"}
+
+
+
\ No newline at end of file
diff --git a/templates/default/includes/category-toolbar.html b/templates/default/includes/category-toolbar.html
new file mode 100644
index 000000000..99583a02d
--- /dev/null
+++ b/templates/default/includes/category-toolbar.html
@@ -0,0 +1,67 @@
+
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 @@
+
+
{intl l="Categories"}
+
+
+
+
\ 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..bca37f80b
--- /dev/null
+++ b/templates/default/includes/single-product.html
@@ -0,0 +1,65 @@
+
\ No newline at end of file
diff --git a/templates/default/index.html b/templates/default/index.html
index b762df42f..390f06965 100644
--- a/templates/default/index.html
+++ b/templates/default/index.html
@@ -34,8 +34,17 @@