cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get active product catalog name inside my extension

Former Member
0 Likes
303

Hi, how can I retrieve the name of the active product catalog inside the method of my custom extension? I need to add a list of products inside a page based on which product catalogue is active. Thanks in advance

Federico

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Likes

Hi

You can use the catalogVersionService to retrieve the active catalog inside your custom extension. Please have a look at getSessionCatalogVersions() in DefaultCatalogVersionService class.

This returns a list of all of the catalog versions in the session. You can iterate through and check which version is active using the isActive attribute of the catalog versions thus obtained.

Hope this helps!