fix count child on folder and category folder. Doubitch

This commit is contained in:
Manuel Raynaud
2013-09-19 20:24:33 +02:00
parent e1353a63a7
commit 24f17bcb0f
5 changed files with 20 additions and 10 deletions

View File

@@ -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->getCount())
->set("VISIBLE", $category->getVisible() ? "1" : "0")
->set("POSITION", $category->getPosition())

View File

@@ -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())
;

View File

@@ -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();
}