I've made my own shopping cart component, everything worked fine in development, but when in production it behaves diferent way. First I though it was due to the joomla session but then I changed the code to store the cart products in database, but the behaviour is the same: when visiting any of the products category for the second time and on, it shows the cart information showed when visited for the first time. This is a problem because the category products list needs to hide those products already added.
I've printed some data to the joomla console so I can explain the behaviour:
- Viewing category a. Displaying view in: 2019-07-12 21:24:22. Url: index.php?option=com_shoppingcart&type=1&category=0&scategory=0&data=&Itemid=323. Products added before: -. Products added on category a: 6108.
- Viewing category e. Displaying view in: 2019-07-12 21:25:03. Url: index.php?option=com_shoppingcart&type=5&category=0&scategory=0&data=&Itemid=332. Products added before: 6108. Products added on category e: 3824.
- Viewing category a. Displaying view in: 2019-07-12 21:25:40. Url: index.php?option=com_shoppingcart&type=1&category=0&scategory=0&data=&Itemid=323. Products added before: 6108, 3824. Products added on category a: 6130.
- Viewing category c. Displaying view in: 2019-07-12 21:26:17. Url: index.php?option=com_shoppingcart&type=3&category=0&scategory=0&data=&Itemid=322. Products added before: 6108, 3824, 6130. Products added on category c: 6166.
- Viewing category e. Displaying view in: 2019-07-12 21:27:12. Url: option=com_shoppingcart&type=5&category=0&scategory=0&data=&Itemid=332. Products added before: 6108, 3824, 6130, 6166. Products added on category e: 5984.
- Viewing category a. Displaying view in: 2019-07-12 21:25:40. Url: index.php?option=com_shoppingcart&type=1&category=0&scategory=0&data=&Itemid=323. Products added before: 6108, 3824. Products added on category a: 6787.
- Viewing category c. Displaying view in: 2019-07-12 21:28:06. Url: index.php?option=com_shoppingcart&type=3&category=0&scategory=0&data=&Itemid=322. Products added before: 6108, 3824, 6130, 6166, 6787. Products added on category c: -.
As showed above, when visiting the "a" category for the third time (step 6) it shows the same result when visited for the second time (step 2), then I added a product and go to "c" category for the second time (step 7) and the products added before seems updated until step 6.
I've tried:
- Cache Handler: file
- Path to Cache Folder: cache/
- Cache Time: 15
- System Cache: OFF | ON conservative | ON progressive
- Session Handler: PHP | Database
- Session Lifetime: 15
- Shared Sessions: YES|NO
- Cleared joomla cache
- Truncated joomla's session tables
I'm using Joomla 3.9.5
Can someone please help me, I will appreciate and thank any comment or suggestion.
NOTE: I'm storing my cart products on a very own table, not with joomla database session handler.