Jump to content

How To Determine Which Page Is Being Viewed


sibrodo

Recommended Posts

Hello, what are the best way to determine which page is being view. I am planning to use this hook

displayHeader

to retrieve information about which page is being viewed by visiting customer. This is to be used for analytical purposes (i.e. Funnelling).

 

Is there such function or variables where it returns which page is being viewed (e.g. product-details, product-list, homepage, my-account, etc)

 

I am using Prestashop 1.5.4

 

Thanks for the help. Cheers!

Link to comment
Share on other sites

I am not sure what you are trying to do but basically you can get page name or controller with php like that:

Dispatcher::getInstance()->getController() or $this->context->controller->php_self

and in the template you can get it as: {$page_name}

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...