diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php index 86a29da6d..0e02ec5e9 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php @@ -220,7 +220,11 @@ class TheliaLoop implements SmartyPluginInterface // Find pagination $pagination = self::getPagination($loopName); if ($pagination === null) { - throw new \InvalidArgumentException("Loop $loopName : no pagination found."); + throw new \InvalidArgumentException("Loop $loopName is not defined"); + } + + if($pagination->getNbResults() == 0) { + return ''; } if ($content === null) { diff --git a/templates/smarty-sample/pagination.html b/templates/smarty-sample/pagination.html new file mode 100755 index 000000000..5a5182177 --- /dev/null +++ b/templates/smarty-sample/pagination.html @@ -0,0 +1,55 @@ +{assign var=category_current_page value={$smarty.get.category_page|default:1}} + +
#TITLE page choice
+ {pageloop rel="prod"} + {if ${PAGE} != {$product_current_page}} + #PAGE + {else} + { #PAGE } + {/if} + {if {$PAGE} != {$LAST}} + - + {/if} + {/pageloop} + +{/loop} + +categories page choice
+{pageloop rel="cat"} +{if ${PAGE} != {$category_current_page}} + #PAGE +{else} + { #PAGE } +{/if} +{if {$PAGE} != {$LAST}} + - +{/if} +{/pageloop} \ No newline at end of file