Cart Ajax Popup

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
10 years 5 months ago #160455

I use custom plugin for onBeforeCartUpdate event to perform some checks.
If checks fail, then I set $do to false and enqueue a message for the user.
However, the ajax cart popup appears anyway and notifies the user that the product has been successfully added to the cart, which is of course wrong.

How can I prevent the Popup or even better customize the poput text that the product is NOT added to the car.
Or display a custom popup as it is used for the custom fileds if e.q. a mandatory field is not filled.
if I can interact on that level, the popup would not be fired..

Regards

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

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #160521

Hi,

The best thing will be to not use the default HikaShop popup. So change the value of the option "After a product is added to the cart" in Configuration > Main > Cart.

And based on your checks, display your custom popup with your custom content.
If checks are ok, so display content like the original popup, else display the desired text.

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

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
10 years 5 months ago #160527

Thanks. Do you have some more info, how to achieve this ? E.g. how to display a own customized popou ? Where to integrate the code, so that it will be displayed ?

Thanks and br

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 5 months ago #160585

The simplest will be to edit the file "notice" of the view "checkout" via the menu Display>Views.
That's where the message of the popup is displayed. So there you can customize the code to display different things based on whether the product was added to the cart or not.

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

Time to create page: 0.093 seconds
Powered by Kunena Forum