Need another one button "add to cart and go to the cart"

  • Posts: 1986
  • Thank you received: 276
  • Hikashop Multisite
4 months 1 day ago #284653

-- HikaShop version -- : 3.2.1

I need to create two buttons "add to cart" on the product page.

1. Traditional add to cart that is work well.
2. And "Add to cart and go to the cart"

The second button need to add to the cart current product and after that go to the cart,

What is the optimal way for this?


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!

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

  • Posts: 11455
  • Thank you received: 1594
  • MODERATOR
4 months 1 day ago #284660

Hello,

The solution will be to directly use some views override for the "Add to cart and go to the cart" button and use a link like the link that you can find when using the "Add to cart HTML link" option through your product configuration page.

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

  • Posts: 1986
  • Thank you received: 276
  • Hikashop Multisite
4 months 1 day ago #284710

I got this code

<a class="hikashop_html_add_to_cart_link" href="https://shop.elino.ru/vetchina/vetchina-lopatochnaya-beef-on">В корзину</a>

But it doesn't work .... Don't add to cart any product....


Я не явлюсь официальной службой поддержки!
Я здесь добровольно!

Хочешь получить купон на скидку Hikashop? Спроси меня как!
Attachments:

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

  • Posts: 61801
  • Thank you received: 8789
  • MODERATOR
4 months 18 hours ago #284712

Hi,

It's actually a bug of that popup when the canonical URL of the product is filled.
Change the code:

echo '<textarea style="width:100%" rows="5"><a class="hikashop_html_add_to_cart_link" href="'. hikashop_contentLink('product&task=updatecart&qty=1&cid='.$product_id, $product, false, false, false, true).'">'.JText::_('ADD_TO_CART').'</a></textarea>';
to:
$menusClass = hikashop_get('class.menus');
		$id = $menusClass->loadAMenuItemId('','');
		if(!empty($id))
			$id = '&Itemid='.$id;
		echo '<textarea style="width:100%" rows="5"><a class="hikashop_html_add_to_cart_link" href="'. hikashop_completeLink('product&task=updatecart&qty=1&cid='.$product_id.$id, false, false, false, true).'">'.JText::_('ADD_TO_CART').'</a></textarea>';
in the file administrator/components/com_hikashop/controllers/product.php and it will then provide a correct link in the HTML of the popup.
We'll add that patch for the next version of HikaShop which is to be released soon.

Last Edit: 4 months 1 day ago by nicolas.
The following user(s) said Thank You: progreccor

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

Time to create page: 0.130 seconds
Powered by Kunena Forum