Proceed to checkout url issue

  • Posts: 1119
  • Thank you received: 114
6 years 6 months ago #293219

-- HikaShop version -- : 1805171601

Hi,

We are doing template from scratch and doing this we found strange behavior with proceed to checkout link on cart module with android browser.

To reproduce the issue:

1. Add product to cart
2. Proceed to checkout from cart module
3.Now press back in android browser
4. Proceed to checkout stops working...

After page reload all is working fine again.

After some looking it seems the issue comes from this lines:

<a class="btn btn-primary btn-wide <?php echo $css_button . ' ' . $css_button_checkout; ?>" href="<?php echo $this->url_checkout; ?>" onclick="if(this.disable) return false; this.disable = true;"><span><?php
		echo JText::_('PROCEED_TO_CHECKOUT');
	?></span></a>

Removing onclick attribute solves the issue:
onclick="if(this.disable) return false; this.disable = true;

It seems issue only comes with android browser. Tried with S9+, S7 Edge, S6 and got same results... Tried with default protostar template too...

Cart module is set to use dropdown on click.

Can someone check the issue and confirm it?

Kind Regards

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 5 months ago #293257

Hi,

This code disables the button once clicked. That way, it avoids the customer clicking several times on the same button. It also allows the CSS to be different for the button so that you can have the button display different after it is clicked.
That also avoids the action to be done several time, which is particularily imporant for the "finish" button of the checkout so that several orders are not created.
You should have the same issue with the "next" and "finish" buttons on the checkout as they also use that javascript code.

Now as to why you get that issue with android, it's potentially because of some optimization of that browser so that when you click back, it doesn't re-request the page but displays the page the way it was just after you got redirected to save data and speed up the browsing.
mixmax.com/blog/chrome-back-button-cache-no-store
What you can do is add such code in your template index.php file :
JResponse::setHeader('Cache-Control', 'private, max-age=0, no-cache, no-store, must-revalidate, post-check=0, pre-check=0');
That should prevent the caching from being done.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
6 years 5 months ago #293265

Hi,

Unfortunately it doesn't work for me. The issue persist... Have you tried on your end Nicolas?

The strange thing is that I don't have same issue with next and finish buttons during checkout.

I'll remove that onclick from cart view only as checkout works fine. It just some other people could have same issue and they doesn't even know about it. That's why I created this topic.

Thanks

Last edit: 6 years 5 months ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 5 months ago #293267

Hi,

I tried on my end with my smartphone (note3) and our demo website but I'm not able to reproduce the issue.

No one reported that issue so far besides you.

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

  • Posts: 1119
  • Thank you received: 114
6 years 5 months ago #293342

Hi,

So after some time i finally found what is giving issue. We have 3 sites all on Joomla. 2 of them have SSL one test site not. So if SSL is turned on, all works fine and page gets reloaded after back button press. Now if there is no ssl then it has the issue described above. So it is not hikashop issue. I see same behaviour with all website who have no ssl. I hope for someone this information will help in the future.

Now maybe there could be some addition check/fix for hikashop cart websites who have no ssl. Because if you add product to cart and then press back you will see that your cart is empty and it could confuse people.

Nicolas if you want to reproduce it, simple turn off ssl for hikashop demo and try with android browser.

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 5 months ago #293350

Hi,

Thanks for the feedback.
I don't see what we can do to avoid that. I still suspect that it comes from an optimization of that browser in that particular case.
If even the "no-store" solution doesn't help, then I4m out of ideas.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
6 years 5 months ago #293382

Hi,

No worries. At least you can highlight this topic for someone who gets same issue.

Thanks for help.

Regards

The following user(s) said Thank You: nicolas

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

Time to create page: 0.062 seconds
Powered by Kunena Forum