How to add information to component view products only?

  • Posts: 34
  • Thank you received: 1
7 years 6 months ago #268330

Hello,
I need to integrate an option to product listing page and mostly need to add on listing_div.php
But when I add something in this file it shows on both component view and module view.
How can I add info so it will only show on component view not modules?

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 6 months ago #268380

Hi,

You can add your code like that:

if(!$this->module){
 // your code which won't run for modules
}

Please Log in or Create an account to join the conversation.

  • Posts: 34
  • Thank you received: 1
7 years 6 months ago #268857

Thanks, it works. But how do I make it with sub modules as when I browse by category it shows products under "Sub module" instead of component.

How can I do this so it will show on "component and sub module view" but not in module?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
7 years 6 months ago #268887

Hi,

Then, you can do like that:

if(JRequest::getVar('hikashop_front_end_main', 0)){
 // your code which will run only in the main area.
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum