AmirMahmood Posted November 15, 2017 Share Posted November 15, 2017 (edited) hello 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 November 16, 2017 by AmirMahmood (see edit history) Link to comment Share on other sites More sharing options...
Zohaib-fk Posted November 16, 2017 Share Posted November 16, 2017 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. Link to comment Share on other sites More sharing options...
AmirMahmood Posted November 16, 2017 Author Share Posted November 16, 2017 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'. 1 Link to comment Share on other sites More sharing options...
Zohaib-fk Posted November 16, 2017 Share Posted November 16, 2017 (edited) Good. Happy to know my answer helps PrestaShop Tutorials Videos [How to do Tasks] https://www.prestashop.com/forums/topic/907438-prestashop-tutorials-videos-how-to-do-tasks/ Edited June 30, 2021 by Zohaib-fk Post Updated (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now