Add to Cart buttons not working in Safari (macOS and iOS)

  • Posts: 39
  • Thank you received: 2
6 years 3 months ago #296489

-- url of the page with the problem -- : stphilipinstitute.org/store
-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.10
-- Browser(s) name and version -- : Safari

When clicking Add to Cart buttons in Safari on both iOS and macOS, the page refreshes and does not add the item to the cart. Any suggestions?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 3 months ago #296516

Hi,

You have a session issue related to that browser.
I was able to reproduce the issue on your website, and when I analyse the events it goes like that:
- the javascript on the browser sends the ajax request to the server side to add the product to the cart
- the server side successfully add the product to the cart and replies back that all was ok
- the javascript on the browser then redirects the customer to the checkout page
- on the checkout, the server side doesn't fine anymore the cart in the session of the user and redirects him back to the listing of products

I've looked a bit online about that but could only found this so far:
stackoverflow.com/questions/12571144/ios...ed-when-set-via-ajax
But if it came from this, then the first add to cart of each product should work fine, which is not the case.
And most things I could fine related to server side configuration issue would result in the problem happening with all the browsers which is also not the case here.

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

  • Posts: 39
  • Thank you received: 2
6 years 3 months ago #296552

So... what's the next step?

It's also not working in Edge.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 3 months ago #296572

Hello,

Can you please try to deactivate the legacy features (add to cart / checkout) ?
www.hikashop.com/support/documentation/5...html#advanced_legacy

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 39
  • Thank you received: 2
6 years 3 months ago #296614

No change with legacy cart on or off.

As a matter of fact, I posted in this thread yesterday saying that I tried legacy cart and it didn't do anything. Where'd that response go?

The other thing that my response said was that we have other sites with Hikashop stores in the same hosting environment with no issues.

Last edit: 6 years 3 months ago by holdsworthdesign.

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

  • Posts: 39
  • Thank you received: 2
6 years 3 months ago #296630

This is now an urgent problem. If it is not fixed soon, it will cause us considerable losses. This is a basic function of HikaShop and it's not working. We need to have it fixed immediately!!!

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
6 years 3 months ago #296619

Hi,

We do not delete messages unless they are spam which wouldn't be the case. So I don't know why there is no such message from you.

If you have other HikaShop stores with the same hosting environment without the issue, then you need to check what's left:
- a different template ? In that case, try to switch the template temporarily to the default one of Joomla and see if that helps.
- plugins of the "system" group that you don't have on the other stores ? Try to disable these plugins and see if that helps.
besides that I don't know. As you said, and as I already said in my previous message, I don't think it comes from the hosting.
And as you know already, it doesn't come from HikaShop either since it works fine for your other stores and everyone else. So that leaves only other extensions or something done differently in the hosting ( are the servers configured similarly ? maybe you have only one server with all the websites on it ? Or maybe it's different servers with different software ? )

However, I don't think the issue is related to HikaShop, specially if you analyse the network logs.
Did you tried to log-in in the front-end with Safari or Edge ?
Because I don't think it would work since there are some cookie setting issues.

See : pasteboard.co/Hyy1t0q.png

The "set-cookie" returned by your server indicates that the path is "levi" ; unfortunately, your website is not working in that path (anymore ?).
So, browsers such as "Safari", "Edge" or "Firefox" discard that cookie since the path is not the right one.
Without a cookie, you do not have a session ; so you cannot add anything in the cart nor be logged with an account. That issue is affecting your whole website and not just HikaShop.

Regarding Chrome ; that browser just doesn't follow the order and take the cookie event if the path is not correct. It just do whatever it think it's best to avoid issues (even accepting a incorrect cookie).

At the end, your issue is a website cookie configuration issue which result to the fact that Safari, Edge and Firefox do not have sessions anymore. One side effect (that you saw) is that you cannot add products into the cart (which needs a session).
Another side effect (that you didn't saw) is that you can't log-in or do any action in your website which require the session. (Issue which is outside the limit of our support since it is not an HikaShop bug)

Last edit: 6 years 3 months ago by nicolas.

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

  • Posts: 39
  • Thank you received: 2
6 years 3 months ago #296633

Thank you for doing the in-depth analysis of what was happening! You were right about the cookie path not being set correctly. Once that was reset, the add to cart buttons seem to be working everywhere that we can test them at the moment.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum