Add to wishlist add also to cart

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #219799

-- 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.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219840

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.

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #219847

Dear Sir
you need to login
please use user amjad, pass 1234
thanks

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

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #219981

Dear sir
did you had a chance to look at the problem
thanks

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #219959

Hi,

Thanks for the report, there is indeed an issue.
Please edit the view "product / compare" and add the line:

<input type="hidden" name="cart_type" value="cart"/>
Before:
<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:
	$wishlistAjax =	'if(hikashopCheckChangeForm(\'item\''.$formName.')){ return hikashopModifyQuantity(\'' . (int)@$this->row->product_id . '\',field,1' . $formName . ',\'wishlist\','.$module_id.'); } else { return false; }';
By:
	$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.

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #220011

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #220016

Hi,

Please try this code instead:

	$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.

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #220074

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #220081

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.

  • Posts: 72
  • Thank you received: 0
9 years 10 months ago #220214

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.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #220408

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.

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #220683

Hi,

Please edit the file "components/com_hikashop/controllers/product.php" and in the function "updatecart()" add:

			if(!isset($stay))
Right before:
			$stay = JRequest::getInt('stay',0);

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

  • Posts: 72
  • Thank you received: 0
9 years 9 months ago #220805

thanks this solve the problem

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

Time to create page: 0.085 seconds
Powered by Kunena Forum