Already in wishlist option

  • Posts: 11
  • Thank you received: 0
8 years 8 months ago #211248

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.1

I want to ask if I added an item to wishlist after log in, and I tried to add it again, can I stop adding an item to wishlist, for example can i change the bottom color to red if its already in the wishlist?

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

  • Posts: 13201
  • Thank you received: 2322
8 years 8 months ago #211266

Hi,

Yes you can potentially create a little plugin based on the function "onBeforeCartUpdate(&$cartClass,&$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force,&$do)".

Do the checks on the product and on the current cart content, and based on these informations set the vairable $do to false to not add the product to the wishlist. You can too use that kind of code to display a message to the customer:

// The code to check if it is a wishlist

// The code to check if the product is already in the wishlist

// The code to set $do to false if conditions are met

if($do == false){
    $app = JFactory::getApplication();
    $app->enqueueMessage('Product already in the wishlist !');
}

The following user(s) said Thank You: bassimbg

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

Time to create page: 0.077 seconds
Powered by Kunena Forum