cancel
Showing results for 
Search instead for 
Did you mean: 

When to know that the category page is opened

SOLVED

When to know that the category page is opened

When customview.phtml is loaded we get to know that the product page has opened (app/design/frontend/default/theme659/template/catalog/product/customview.phtml)

But how can we know that which category has opened, when either opened through home page, or opened through any of the links.

I know $category = Mage::registry('current_category'); will provide the current category name, but it will not tell me when its loaded. So, is there a file like customview.phtml for product, similar for category?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: When to know that the category page is opened

Hi @torrtugaco0bda 

 

Magento 1.x also provide the facilities for template path hints.

 

https://nwdthemes.com/2016/07/14/magento-1-x-enable-template-path-hints/

View solution in original post

5 REPLIES 5

Re: When to know that the category page is opened

Re: When to know that the category page is opened

Hi, thanks for the reply.
The above two links tell me mostly about the mapping between product and category.

What I am actually trying to find is when the category page is opened. Like in home page we have all the different categories, and when its clicked, list of products belonging to that category is opened.

Similarly from the top menu bar we have list of categories and clicking on them will open the category page.

The category page having url of this format : homepage.com/categoryName
So, I am trying to find basically which phtml file is loaded when its triggered.

Re: When to know that the category page is opened

Hi @torrtugaco0bda 

 

For the file path you can get using template path hints.

 

https://docs.magento.com/m2/ce/user_guide/system/template-path-hints.html

 

You can also enable template path using command as well.

 

Now you can enable or disable Template path hints via Command Line Go to Magento 2 root folder and run the following command:

Enable
php bin/magento dev:template-hints:enable 
Disable
php bin/magento dev:template-hints:disable

Re: When to know that the category page is opened

Problem is that I am using Magento 1.9
For which I don't think this support will be there.

Re: When to know that the category page is opened

Hi @torrtugaco0bda 

 

Magento 1.x also provide the facilities for template path hints.

 

https://nwdthemes.com/2016/07/14/magento-1-x-enable-template-path-hints/