Products disappear from cart

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
7 years 2 months ago #262755

-- HikaShop version -- : 3.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.14

In some cases products that are added to the cart disappear from the cart when you go to another category page. Sometimes only one of the products disappear and sometimes it says that the cart is empty. In some cases the cart contents comes back when you switch category again.

To reproduce the problem:

Go to: jura-koffiemachine/thuis/z-serie and add Z8 machine
Go to: koffiebonen and add one of the coffees
Go back to: jura-koffiemachine/thuis/z-serie and the cart is empty

All legacy is disabled.

I have send you a message via the contact page withe the backend login credentials.

Could you have a look at this?

Last edit: 7 years 2 months ago by jvstratum.

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

  • Posts: 26014
  • Thank you received: 4004
  • MODERATOR
7 years 2 months ago #262764

Hi,

If you do not have a persistant display of the cart ; it means that you have some cache activated.
Please re-download HikaShop 3.0 in order to be sure to have the latest patchs with the code in the "system / hikashopuser" plugin which destroy the cache everytime a cart is displayed.
Otherwise, please deactivate your cache (cache is not compatible with an e-commerce system. It's dynamic content !)

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: 54
  • Thank you received: 2
  • Hikashop Business
7 years 2 months ago #262811

Hi,

Indeed, it was cache related. I downloaded and tested the latest Hikashop build, bat that did not make a difference. After disabling SiteGround's Dynamic Cache the cart functions ok.

This never has been a problem with Hikashop versions 2.6.5 and before. So I wonder why this is causing problems with Hikashop version 3.

Last edit: 7 years 2 months ago by jvstratum.

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

  • Posts: 81566
  • Thank you received: 13075
  • MODERATOR
7 years 2 months ago #262817

Hi,

Since the cart system is completely different in HikaShop 3, Siteground's cache system will have to be adapted to work properly with it.
I would recommend to raise a ticket with their support about that.

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

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
7 years 2 months ago #262947

Ok, I raised a ticket at SiteGround. They came up with a briljant answer.... They suspect that Hikashop 3 and the jSGCache plugin (the Joomla plugin where you can adjust the setting for the dynamic cache) don't not play nice together. They told me to contact Hikashop and ask them for the reason why it is not working or details of what is going wrong.

So here I am... inbetween the briljant Hikashop programmers and the excellent SiteGround support people.

So, I have disabled the jSGCache plugin hoping that either Hikashop will find a solution or SiteGround will come up with a new version of the plugin or whatever. The good news is that I really like Hikashop 3. :-)

Just to make everything complete you'll find jSGCache's cache autoflush settings in enclosed image and I have send you a screenrecording by mail so you can see what's happening.

Thank you for your time and efforts.

Attachments:

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

  • Posts: 81566
  • Thank you received: 13075
  • MODERATOR
7 years 2 months ago #262948

Hi,

Well it doesn't work because when you click on the "add to cart" button, the cache is not cleared in the plugin.
I don't know how the plugin is written so I can't say much more.
You can see in the file plugins/system/hikashopuser/hikashopuser.php this code:
monosnap.com/file/GAmwBqv7Ave95zvZG8QF5d3IfAVN3K
That code clears the Joomla cache after a cart is saved so that such issue do not happen with Joomla.
I would recommend them to add the same trigger in their jSGCache plugin in order to flush their cache after a cart is saved and that will fix the problem.

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

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
7 years 2 months ago #263361

I've reported the issue to SiteGround.

They write:

"This test environment will be used by the jSGCache developers to check the problem. They will try to provide a solution for the reported issue. Currently we do not have ETA for this task. Note that this is a specific compatibility issue between HikaShop and jSGCache and the investigation/resolution process might take some time."

They used Hikashop 3.0.0 - build 1702211353

In case you are interested to know more about jSGCache plugin code I have attached it to this reply.

Best regards,

Joep

File Attachment:

File Name: jSGCache.zip
File Size:4 KB

Attachments:

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

  • Posts: 81566
  • Thank you received: 13075
  • MODERATOR
7 years 2 months ago #263362

Adding such code in the plugin should solve the problem:

public function onAfterCartSave(&$cart)
{
$this->_purgeCache(false);
}
For example just before the line:
private function _purgeCache( $message = true )

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

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
7 years 2 months ago #263436

Tested it and as far as I can judge it works fine. Awesome support!

I've past on your answer to SiteGround. Hopefully they will add it to the next update.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.082 seconds
Powered by Kunena Forum