- Posts: 31
- Thank you received: 0
Is It possible remove the product from wishlist through wishlist button?
7 years 4 months ago #306672
by Coluccini
-- HikaShop version -- : HikaShop Business: 4.0.3
Hello! I would like to customize the functionality of the wishlist. Is it possible with second click remove the product from wishlist? I'll explain myself better. Now if user click the wishlist buttom, he will add the product to the wishlist. If he wants remove the product he must go inside the wishlist. Is it possible with second click on wishlist button remove the product? if is this possible, where I have to put my script? Thank you!
Hello! I would like to customize the functionality of the wishlist. Is it possible with second click remove the product from wishlist? I'll explain myself better. Now if user click the wishlist buttom, he will add the product to the wishlist. If he wants remove the product he must go inside the wishlist. Is it possible with second click on wishlist button remove the product? if is this possible, where I have to put my script? Thank you!
Please Log in or Create an account to join the conversation.
7 years 4 months ago #306675
by nicolas
Replied by nicolas on topic Is It possible remove the product from wishlist through wishlist button?
Hi,
If you customize the view displaying the add to wishlist button, you sure can do that. You'll have to set the qty parameter of the button to 0 and add a parameter add=0 to the URL. That will override the quantity in the cart instead of adding to it.
To know which view file you want to edit, you can activate the "Display view files" setting of the HikaShop configuration and then look at a page with that add to wishlist button. It will tell you which view file is used there and then you can edit it via the menu Display>Views in the backend of HikaShop.
If you customize the view displaying the add to wishlist button, you sure can do that. You'll have to set the qty parameter of the button to 0 and add a parameter add=0 to the URL. That will override the quantity in the cart instead of adding to it.
To know which view file you want to edit, you can activate the "Display view files" setting of the HikaShop configuration and then look at a page with that add to wishlist button. It will tell you which view file is used there and then you can edit it via the menu Display>Views in the backend of HikaShop.
Please Log in or Create an account to join the conversation.
7 years 4 months ago - 7 years 4 months ago #306702
by Coluccini
Replied by Coluccini on topic Is It possible remove the product from wishlist through wishlist button?
Thank you, Nicolas. I understood which files I have to edit, but I don't uderstand what I would have to do. Can you explain to me more clearly ? And if can you give me a short example? I don't have much experience. Thank you for your patience. Thanks in advance!
Last edit: 7 years 4 months ago by Coluccini.
Please Log in or Create an account to join the conversation.
7 years 4 months ago #306720
by nicolas
Replied by nicolas on topic Is It possible remove the product from wishlist through wishlist button?
Hi,
This would require some proper development if you wanted me to give you all the code you need to add.
I can only give some hints here.
In the view file which displays the add to wishlist button, you should find some code like this:
So that's the code you would have to change to change the javascript in the onclick with your own code and change the href with a custom add to cart URL link with the parameters as I talked about.
This would require some proper development if you wanted me to give you all the code you need to add.
I can only give some hints here.
In the view file which displays the add to wishlist button, you should find some code like this:
Code:
<a class="<?php echo $css_button . ' ' . $css_button_wishlist; ?>" rel="nofollow" href="<?php echo hikashop_completeLink($classical_url); ?>" onclick="if(window.hikashop.addToWishlist) { return window.hikashop.addToWishlist(this); }" data-addToWishlist="<?php echo $this->row->product_id; ?>" data-addTo-div="hikashop_product_form" data-addTo-class="add_in_progress"><span><?php
if(!empty($this->row->product_addtowishlist_message))
echo JText::_($this->row->product_addtowishlist_message);
else
echo JText::_('ADD_TO_WISHLIST');
?></span></a>
Please Log in or Create an account to join the conversation.
Time to create page: 0.155 seconds