diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php
index 18ae783f0..86a29da6d 100755
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php
@@ -130,13 +130,13 @@ class TheliaLoop implements SmartyPluginInterface
$template->assign($var, $val);
}
- // Assign meta information
- $template->assign('LOOP_COUNT', 1 + $loopResults->key());
- $template->assign('LOOP_TOTAL', $loopResults->getCount());
-
- $repeat = true;
+ $repeat = true;
}
+ // Assign meta information
+ $template->assign('LOOP_COUNT', 1 + $loopResults->key());
+ $template->assign('LOOP_TOTAL', $loopResults->getCount());
+
// Loop is terminated. Cleanup.
if (! $repeat) {
// Restore previous variables values before terminating
diff --git a/templates/smarty-sample/index.html b/templates/smarty-sample/index.html
index 5a73519b0..c185ae5f8 100755
--- a/templates/smarty-sample/index.html
+++ b/templates/smarty-sample/index.html
@@ -17,7 +17,7 @@ An image from asset directory :
Category loop example
{loop type="category" name="catloop1"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}, children: {$NB_CHILD}
+
- {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}, children: {$NB_CHILD}
{ifloop rel="inner1"}
{loop type="category" name="inner1" parent="{$ID}"}
@@ -40,7 +40,7 @@ An image from asset directory :
Hey ! Loop catloop2 is not empty:
{loop type="category" name="catloop2" parent="12"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
{/ifloop}
@@ -57,7 +57,7 @@ An image from asset directory :
Loop catloop3 is not empty:
{loop type="category" name="catloop3" parent="0"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
{/ifloop}
@@ -86,20 +86,20 @@ An image from asset directory :
PAGE 1
{loop type="category" name="catloopwithpagination1" limit="2" page="1"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
PAGE 2
{loop type="category" name="catloopwithpagination2" limit="2" page="2"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
PAGE 1000
{loop type="category" name="catloopwithpagination1000" limit="2" page="1000"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
{elseloop rel="catloopwithpagination1000"}
@@ -114,7 +114,7 @@ An image from asset directory :
PAGE {$current_page} :
{loop type="category" name="catloopwithpaginationchoice" limit="2" page="{$current_page}"}
- - {$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}
+ - {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}
{/loop}
page choice