- Posts: 11
- Thank you received: 0
Already in wishlist option
11 years 2 months ago #211248
by bassimbg
Already in wishlist option was created by bassimbg
-- 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?
-- 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.
11 years 2 months ago #211266
by Xavier
Replied by Xavier on topic Already in wishlist option
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:
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:
Code:
// 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.152 seconds