[Skip to main content](#vessel-content)

#   cart does not update

##

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago [\#214467](#214467) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214467 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")* was created by *[florcar](/forum/user/35585-florcar "View florcar's Profile")*

-- url of the page with the problem -- : flatize.fabulosa.ch
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.44

Hi

My problem is maybe cache related. I have jotcache and excluded com_hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.

I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?

Regards
florcar

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 2 months ago [\#214477](#214477) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214477 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi,

I don't see that this is the issue.
The cart clearing button has not been made to support the Joomla caching yet. It will be in the next version of HikaShop.
In the mean time, you can edit the file components/com_hikashop/controllers/cart.php and add the code: Code:

if(HIKASHOP_J30){ $plugin = JPluginHelper::getPlugin('system', 'cache'); $params = new JRegistry(@$plugin-&gt;params); $options = array( 'defaultgroup' =&gt; 'page', 'browsercache' =&gt; $params-&gt;get('browsercache', false), 'caching' =&gt; false, ); $cache = JCache::getInstance('page', $options); //$cache_key = JUri::getInstance()-&gt;toString(); $cache-&gt;clean(); }

after the line: Code:

public function cleancart() {

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago [\#214585](#214585) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214585 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi Nicolas
Ah ok I see. But when deleting single item in cart the cache is cleaned?
About the code. I dont see a function like cleancart. Is it maybe: Code:

function delete(){ //delete a cart with the id given

?
Or is it in the root administrator/components/com_hikashop/controllers/cart.php ?
Best regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 2 months ago [\#214606](#214606) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214606 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi,

No, it's the function cleancart, not delete.
You're probably looking at the file administrator/components/com_hikashop/controllers/cart.php while I told you to look instead at the file components/com_hikashop/controllers/cart.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago [\#214662](#214662) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214662 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi
I was looking at this file first. But there is no such function. Really, see attached file.

- [ ![file.png](/forum/attachment/26550) ](/forum/attachment/26550 "file.png") [ ](/forum/attachment/26550?download=1 "file.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 2 months ago [\#214850](#214850) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214850 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi,

My bad, it's the file components/com_hikashop/controllers/product.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago -  11 years 2 months ago [\#214855](#214855) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214855 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi
Ok but the function is not public. Do I have to change that? Code:

function cleancart(){

Edit:
Tried to insert the code but it didnt work

Last edit: 11 years 2 months ago by [florcar](/forum/user/35585-florcar "View florcar's Profile"). Reason: Tried the code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 2 months ago [\#214866](#214866) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214866 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi,

What do you mean by "it didn't work" ? You got an error ? It doesn't change anything ? What code do you have now ? Could you do a screenshot ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago [\#214911](#214911) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214911 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi

I inserted the code as you posted it right under function cleancart(){
I didnt get an error but it did not change anything.
Here is what I tryed: Code:

function cleancart(){ if(HIKASHOP_J30){ $plugin = JPluginHelper::getPlugin('system', 'cache'); $params = new JRegistry(@$plugin-&gt;params); $options = array( 'defaultgroup' =&gt; 'page', 'browsercache' =&gt; $params-&gt;get('browsercache', false), 'caching' =&gt; false, ); $cache = JCache::getInstance('page', $options); //$cache_key = JUri::getInstance()-&gt;toString(); $cache-&gt;clean(); } $class = hikashop_get('class.cart'); if($class-&gt;hasCart()){ $class-&gt;delete($class-&gt;cart-&gt;cart_id); }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 2 months ago [\#214949](#214949) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#214949 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi,

Please try to replace the content of the function cleancart() by: Code:

public function cleancart() { $cartClass = hikashop_get('class.cart'); if($cartClass-&gt;hasCart()) $cartClass-&gt;delete($cartClass-&gt;cart-&gt;cart_id); $url = JRequest::getVar('return_url',''); if(empty($url)) { $url = JRequest::getVar('url',''); $url = urldecode($url); } else { $url = base64_decode(urldecode($url)); } if(HIKASHOP_J30){ $plugin = JPluginHelper::getPlugin('system', 'cache'); $params = new JRegistry(@$plugin-&gt;params); $options = array( 'defaultgroup' =&gt; 'page', 'browsercache' =&gt; $params-&gt;get('browsercache', false), 'caching' =&gt; false, ); $cache = JCache::getInstance('page', $options); //$cache_key = JUri::getInstance()-&gt;toString(); $cache-&gt;clean(); } if(empty($url)) { echo '&lt;html&gt;&lt;head&gt;&lt;script type="text/javascript"&gt;history.go(-1);&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;'; exit; } if(strpos($url, 'tmpl=component') !== false &#124;&#124; strpos($url, 'tmpl-component') !== false) { if(!empty($_SERVER['HTTP_REFERER'])) { $app = JFactory::getApplication(); $app-&gt;redirect($_SERVER['HTTP_REFERER']); } else { echo '&lt;html&gt;&lt;head&gt;&lt;script type="text/javascript"&gt;history.back();&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;'; exit; } } if(hikashop_disallowUrlRedirect($url)) return false; $this-&gt;setRedirect($url); }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[florcar](/forum/user/35585-florcar "View florcar's Profile")**
- [![florcar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35585-florcar "View florcar's Profile") Topic Author
- [ Offline](/forum/user/35585-florcar)

Less More

- Posts: 62
- Thank you received: 1
-
-

11 years 2 months ago [\#215047](#215047) by [florcar](/forum/user/35585-florcar "View florcar's Profile")  Replied by *[florcar](/forum/user/35585-florcar "View florcar's Profile")* on topic *[cart does not update](/forum/27-checkout/879326-cart-does-not-update#215047 "-- url of the page with the problem -- : flatize.fabulosa.ch -- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.4.44  Hi  My problem is maybe cache related. I have jotcache and excluded com&#95;hikashop but it doesnt work. The cart wont update after pressing empty cart button. The product seems to be still in the cart.  I have seen that in new Version of hikashop the cache is cleaned after updating the cart. I have custom code in cart of view checkout with hikashop 2.3.2 so this file was not updated. Can I insert the missing code manually?  Regards florcar")*

Hi Xavier

Thanks for the code.
I replaced it and tried but unfortunately it doesnt work. :dry:
Deleting each product seperately worked allready before but the «WARENKORB LEEREN» («clean cart») doesent delete the items in cart.
I now disabled the button clean cart and think the customers can live with deleting each product seperately ![:)](/media/kunena/emoticons/3.png ":)")
As Nicolas mentioned is this modification part of a future update. Maybe it will work then ![:)](/media/kunena/emoticons/3.png ":)")

Thanks for the support and best regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTMyNi1jYXJ0LWRvZXMtbm90LXVwZGF0ZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.068 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
