Content module problem

  • Posts: 252
  • Thank you received: 1
6 years 4 months ago #295119

-- HikaShop version -- : 3.5
-- Joomla version -- : 3.8

Hi,
We set a rule that when cart total more than 500$ user can choose a gift into cart.
The problem is I put a module content module of gift in checkout page using module anywhere.
But when click on add to cart button, the cart module on the top right corner just don't response, but when I refresh page, the gift will show in cart.
Here is the url of the developing site:

diggo.com.tw
please login by test1/123456

and in checkout page you can see it.
I compare the add to cart URL from shop page and check out page, the only different is in Itemid, like
www.diggo.com.tw/index.php?option=com_hi...add=1&product_id=29& Itemid=632
www.diggo.com.tw/index.php?option=com_hi...add=1&product_id=29& Itemid=602
What is itemid? how can I change the one in checkout page?

Could you tell me why the add to cart button doesn't work in my checkout page? but it works fine in my other pages.
And what should I do to fix the problem or how can I change the itemid into other number?

Thanks in advance

Last edit: 6 years 4 months ago by twscott.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 4 months ago #295129

Hi,

You need to look at the AJAX request made when you click on the add to cart button:
monosnap.com/file/b9m3vpusOd0uElBc6M4FRBQgfMSetv
As you'll see, you have some javascript which is added to the json response and that breaks the refresh of the different areas.
That javascript is either added by another extension on your website or by a customization you made.

The following user(s) said Thank You: twscott

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

  • Posts: 252
  • Thank you received: 1
6 years 4 months ago #295173

Thanks, Nicolas,
I've fond the cause of the problem.
It was caused by a function I put in plugin as below.

	public function onAfterCartSave(&$element) {
		$ifCheckout = UJhtmlHelper::parseUrl($_SERVER['HTTP_REFERER'], 'ctrl');
		if($ifCheckout=='checkout') {
			$js =  '<script language="JavaScript">
	 				window.opener.location.reload();
	 				</script>';
			echo $js;
		}
	}

I want to refresh the cart by refresh this page when user click on add to cart button in checkout window.
It works in most case, only the add to cart button ajax was disturbed, or what shall I do to achieve the purpose.

Thanks

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 4 months ago #295184

Hi,

There should be nothing to do.
After the add to cart request is done, the different cart areas on the page should refresh automatically.
I tried to look again at the issue but I couldn't find the products listing anymore on your checkout.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum