Skip to content

Instantly share code, notes, and snippets.

@xlawok
Created October 26, 2021 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlawok/1c8cb596b640cae6c791d700a6337924 to your computer and use it in GitHub Desktop.
Save xlawok/1c8cb596b640cae6c791d700a6337924 to your computer and use it in GitHub Desktop.
PRESTASHOP self canonical for category pagination and next/prev
{if isset($smarty.get.id_category) }
<link rel="canonical" href="{$page.canonical}">
{if isset($listing.pagination)}
{foreach from=$listing.pagination.pages item="page"}
{if $page.type === 'previous'}
<link rel="prev" href="{$page.url}">
{elseif $page.type === 'next'}
<link rel="next" href="{$page.url}">
{/if}
{/foreach}
{/if}
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment