Function for product's front page display ?

  • Posts: 25
  • Thank you received: 1
6 years 4 months ago #283929

Hello, i currently develop a plugin for hikashop product's but i have a problem, in my plugin I use onHikashopAfterDisplayView function for display my html but this function is triggered when all views of hikashop is loading and in my product page, 7 views of hikashop has triggered for display the informations, the image i believe, the trigger buttons (add to cart, add to wishlist, the price of product) so I woud like know if they are a function triggered when is the product front page.
Thanks for your futur replies Benjamin.

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

  • Posts: 81509
  • Thank you received: 13064
  • MODERATOR
6 years 4 months ago #283932

Hi,

In the onHikashopAfterDisplayView function, you have a parameter $view.
You can use:
$view->getLayout()
and :
$view->getName()
to get the task of the page and the controller of the page.
For example, on the product page main area, it will be "show" and "product".
So that way, you can check on which area to display your element.

Also, on the product page, you can use instead onHikashopBeforeDisplayView and add your HTML in the $view->extra_data array.
You can check the show_default view file for the keys you can use in the array based on where you want to add your HTML on the product page.

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

  • Posts: 25
  • Thank you received: 1
6 years 4 months ago #283966

Thank you so much, it's work on my product page and i don't need javascript to delete my button and my modal.
Tank you

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

Time to create page: 0.061 seconds
Powered by Kunena Forum