Jump to content

[SOLVED] what is the $page_name of home page ?


Recommended Posts


in meta.php and "getMetaTags" function (below), there is $page_name for product, category and etc. i want to add a condition for home page. what is the $page_name of home page?

public static function getMetaTags($id_lang, $page_name, $title = '')


        if (!(!Configuration::get('PS_SHOP_ENABLE')

            && !in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP'))))) {

            if ($page_name == 'product' && ($id_product = Tools::getValue('id_product'))) {

                return Meta::getProductMetas($id_product, $id_lang, $page_name);

            } elseif ($page_name == 'category' && ($id_category = Tools::getValue('id_category'))) {

                return Meta::getCategoryMetas($id_category, $id_lang, $page_name, $title);

            } elseif ($page_name == 'manufacturer' && ($id_manufacturer = Tools::getValue('id_manufacturer'))) {

                return Meta::getManufacturerMetas($id_manufacturer, $id_lang, $page_name);

            } elseif ($page_name == 'supplier' && ($id_supplier = Tools::getValue('id_supplier'))) {

                return Meta::getSupplierMetas($id_supplier, $id_lang, $page_name);

            } elseif ($page_name == 'cms' && ($id_cms = Tools::getValue('id_cms'))) {

                return Meta::getCmsMetas($id_cms, $id_lang, $page_name);

            } elseif ($page_name == 'cms' && ($id_cms_category = Tools::getValue('id_cms_category'))) {

                return Meta::getCmsCategoryMetas($id_cms_category, $id_lang, $page_name);



        return Meta::getHomeMetas($id_lang, $page_name);



Edited by AmirMahmood (see edit history)
Link to comment
Share on other sites

1 hour ago, zohaib82 said:

Hi Amir,

There are various ways to get value of variable like echo or logging or debugging using IDE.

This way helps to find extract name of homepage used by variable $page_name.

thanks zohaib

i used echo and find it.

the $page_name of home page is 'index'.

  • Like 1
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...