Jump to content

page_name undefined error on head.tpl on some third-party themes and solution


MEG Venture

Recommended Posts

Folks,

On some customers' website, I have encountered a page_name undefined error which is raised on head.tpl of theme template files. (Prestashop 1.7)

You can solve this problem following the steps below.

Open /themes/yourtheme(childtheme)/templates/_partials/head.tpl

  • Find the instances of $page_name and replace them with $page.page_name

Then if you have $request undefined error (when you fix the first error, you experience with the second), in the same file, find

        {assign var=url_canonical value="?"|explode:$request}
        <link rel="canonical" href="{$url_canonical[0]}"/>

replace with below

    {if isset($request)}
        {assign var=url_canonical value="?"|explode:$request}
        <link rel="canonical" href="{$url_canonical[0]}"/>
    {/if}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...