Skip to main content

Add to wishlist add also to cart

More
10 years 10 months ago #219799 by mymall
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4

Dear Sir
I have problem when adding to wish list (in compare results page only) , it add the product also to cart, the problem does not appear in product page where adding to wish list it did not add to cart

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

More
10 years 10 months ago #219840 by nicolas
Hi,

I tried to look at the problem on your website but I couldn't find a page with the add to wishlist button.
take.ms/Jjib9

Could you provide a link to such page so that we could have a look at the problem ?

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

More
10 years 10 months ago #219847 by mymall
Dear Sir
you need to login
please use user amjad, pass 1234
thanks

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

More
10 years 10 months ago #219981 by mymall
Dear sir
did you had a chance to look at the problem
thanks

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

More
10 years 10 months ago #219959 by Xavier
Hi,

Thanks for the report, there is indeed an issue.
Please edit the view "product / compare" and add the line:
Code:
<input type="hidden" name="cart_type" value="cart"/>
Before:
Code:
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>

And then edit the view "product / quantity" and replace:
Code:
$wishlistAjax = 'if(hikashopCheckChangeForm(\'item\''.$formName.')){ return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';
By:
Code:
$cleanFormName = str_replace(array('\'',','),'',$formName); $wishlistAjax = 'if(hikashopCheckChangeForm(\'item\''.$formName.')){ document.querySelector(\'form[name='.$cleanFormName.'] input[name=cart_type]\').value = \'wishlist\'; return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';

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

More
10 years 10 months ago #220011 by mymall
thanks for the feedback
this fix the problem in the compare page, however it looks it affect the product page add to wish list, if I hit, nothing happened, no product added to wish list from product page

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

More
10 years 10 months ago #220016 by Xavier
Hi,

Please try this code instead:
Code:
$cleanFormName = str_replace(array('\'',','),'',$formName); $wishlistAjax = 'if(hikashopCheckChangeForm(\'item\''.$formName.')){ var typeField = document.querySelector(\'form[name='.$cleanFormName.'] input[name=cart_type]\'); if(typeField !== null){typeField.value = \'wishlist\';} return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';

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

More
10 years 10 months ago #220074 by mymall
thanks for you support, this fix add to wish list in product page
however, in compare page and after I add the product to wish list, it automatically open the wish list page, I need to stay in the compare page
please advice

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

More
10 years 10 months ago #220081 by Xavier
Hi,

This is due to the value of the option "After a product is added to the cart" in Configuration > Main > Cart.
Please try with another value like "Always stay on the same page".

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

More
10 years 10 months ago #220214 by mymall
Dear Sir
this value already set to Always stay on the same page
please have in mind, when adding from Product page its stay in product page, but when adding to wish list from compare page it go to wish list

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

More
10 years 10 months ago #220408 by nicolas
Hi,

Xavier won't be available until Monday. He'll answer you then as he is the one in charge of that area.

Thank you for bearing with us.

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

More
10 years 10 months ago #220683 by Xavier
Hi,

Please edit the file "components/com_hikashop/controllers/product.php" and in the function "updatecart()" add:
Code:
if(!isset($stay))
Right before:
Code:
$stay = JRequest::getInt('stay',0);

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

More
10 years 10 months ago #220805 by mymall
thanks this solve the problem

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

Time to create page: 0.235 seconds
Powered by Kunena Forum