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

#   Old cart items are still showing up

##

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

Less More

- Posts: 14
- Thank you received: 0
-
-

11 years 1 week ago [\#217218](#217218) by [blacknine](/forum/user/36034-blacknine "View blacknine's Profile")  *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217218 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")* was created by *[blacknine](/forum/user/36034-blacknine "View blacknine's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.15
-- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up

Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario

1) A registered user, who is logged in, adds some items to their cart.
2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes.
3) The user again add few items in the cart without loggin in and goes till that login step of checkout.
4) The user logs in and complete all the payment. Orders get confirmed.
5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.

Is there any way i can clear all the old cart items on successful payment?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTg0NC1vbGQtY2FydC1pdGVtcy1hcmUtc3RpbGwtc2hvd2luZy11cD90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 1 week ago [\#217252](#217252) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217252 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Hi,

HikaShop supports multiple carts. So it keeps track of all the carts of the user and the user can manage them via his user control panel.
If you don't want that, try to add the code: Code:

$config = hikashop_config(); //delete old carts when a new cart is present and that the multicart mode is deactivated if( $app-&gt;isAdmin() &amp;&amp; !$config-&gt;get('enable_multicart') &amp;&amp; !empty($user['user_id']) ){ $db = JFactory::getDBO(); $db-&gt;setQuery('SELECT cart_id FROM #__hikashop_cart WHERE user_id='.(int)$user['user_id']); $ids = $db-&gt;loadObjectList('cart_id'); if(isset($ids[$this-&gt;cart])) unset($ids[$this-&gt;cart]); if(count($ids)){ foreach($ids as $id){ $cartClass-&gt;delete($id,'old'); } } }

after the code: Code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cartClass-&gt;initCart();

in the file plugins/system/hikashopuser.php and make sure that the "multiple cart" setting of the HikaShop configuration is turned off.

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

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

Less More

- Posts: 14
- Thank you received: 0
-
-

11 years 1 week ago -  11 years 1 week ago [\#217296](#217296) by [blacknine](/forum/user/36034-blacknine "View blacknine's Profile")  Replied by *[blacknine](/forum/user/36034-blacknine "View blacknine's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217296 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Hi Nicolas,

Thank you for replying back.
I made the changes in the file plugins/system/hikashopuser.php and turned off the "multiple cart" setting of the HikaShop configuration. Code:

function restoreSession(){ $app = JFactory::getApplication(); $cart = $app-&gt;getUserState('com_hikashop.cart_id'); if(empty($cart) &amp;&amp; !empty($this-&gt;cart)){ $app-&gt;setUserState('com_hikashop.cart_id',$this-&gt;cart); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cartClass-&gt;initCart(); $config = hikashop_config(); //delete old carts when a new cart is present and that the multicart mode is deactivated if( $app-&gt;isAdmin() &amp;&amp; !$config-&gt;get('enable_multicart') &amp;&amp; !empty($user['user_id']) ){ $db = JFactory::getDBO(); $db-&gt;setQuery('SELECT cart_id FROM #__hikashop_cart WHERE user_id='.(int)$user['user_id']); $ids = $db-&gt;loadObjectList('cart_id'); if(isset($ids[$this-&gt;cart])) unset($ids[$this-&gt;cart]); if(count($ids)){ foreach($ids as $id){ $cartClass-&gt;delete($id,'old'); } } } }

But the old cart items still appeared after the successful order. I also tried to debug the code and added an echo exit in the

> if(empty($cart) &amp;&amp; !empty($this-&gt;cart)){

condition, it does not go inside this condition on order completion. Maybe i'm doing something wrong.

Last edit: 11 years 1 week ago by [blacknine](/forum/user/36034-blacknine "View blacknine's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTg0NC1vbGQtY2FydC1pdGVtcy1hcmUtc3RpbGwtc2hvd2luZy11cD90bXBsPW1hcmtkb3du) 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 1 week ago [\#217420](#217420) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217420 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Hi,

Please replace the current function "restoreSession()" by: Code:

function restoreSession(&amp;$user_id){ $app = JFactory::getApplication(); $cart = $app-&gt;getUserState('com_hikashop.cart_id'); //it's really important to check on $cart, otherwise, it doesn't work with the normal joomla login if(empty($cart) &amp;&amp; !empty($this-&gt;cart)){ $app-&gt;setUserState('com_hikashop.cart_id',$this-&gt;cart); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cartClass-&gt;initCart(); } if(!empty($cart) &#124;&#124; !empty($this-&gt;cart)){ $config = hikashop_config(); //delete old carts when a new cart is present and that the multicart mode is deactivated if( !$app-&gt;isAdmin() &amp;&amp; !$config-&gt;get('enable_multicart') &amp;&amp; !empty($user_id) ){ $db = JFactory::getDBO(); $db-&gt;setQuery('SELECT cart_id FROM #__hikashop_cart WHERE user_id='.(int)$user_id).' AND cart_type = '.$db-&gt;Quote('cart'); $ids = $db-&gt;loadObjectList('cart_id'); if(isset($ids[$this-&gt;cart])) unset($ids[$this-&gt;cart]); if(count($ids)){ $cartClass = hikashop_get('class.cart'); foreach($ids as $id){ $cartClass-&gt;delete($id-&gt;cart_id,'old'); } } } } $wishlist = $app-&gt;getUserState('com_hikashop.wishlist_id'); //it's really important to check on $wishlist, otherwise, it doesn't work with the normal joomla login if(empty($wishlist) &amp;&amp; !empty($this-&gt;wishlist)){ $app-&gt;setUserState('com_hikashop.wishlist_id',$this-&gt;wishlist); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cart_type = JRequest::getString('cart_type','cart'); JRequest::setVar('cart_type','wishlist'); $cartClass-&gt;initCart(); JRequest::setVar('cart_type',$cart_type); } $entries = $app-&gt;getUserState('com_hikashop.entries_fields'); if(empty($entries) &amp;&amp; !empty($this-&gt;entries)){ $app-&gt;setUserState('com_hikashop.entries_fields',$this-&gt;entries); } $currency = $app-&gt;getUserState('com_hikashop.currency_id'); if(empty($currency) &amp;&amp; !empty($this-&gt;currency)){ $app-&gt;setUserState('com_hikashop.currency_id',$this-&gt;currency); } $checkout_fields_ok = $app-&gt;getUserState('com_hikashop.checkout_fields_ok'); if(empty($checkout_fields_ok) &amp;&amp; !empty($this-&gt;checkout_fields_ok)){ $app-&gt;setUserState('com_hikashop.checkout_fields_ok',$this-&gt;checkout_fields_ok); } $checkout_fields = $app-&gt;getUserState('com_hikashop.checkout_fields'); if(empty($checkout_fields) &amp;&amp; !empty($this-&gt;checkout_fields)){ $app-&gt;setUserState('com_hikashop.checkout_fields',$this-&gt;checkout_fields); } //on some servers with some osbcure config, we really need to force the fields value in the POST/REQUEST as the checkout tries to get them from there after the login if(!empty($this-&gt;checkout_fields)){ foreach($this-&gt;checkout_fields as $k =&gt;$v){ if(!isset($_REQUEST['data']['order'][$k])){ $_POST['data']['order'][$k] = $_REQUEST['data']['order'][$k] = $v; } } } }

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

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

Less More

- Posts: 14
- Thank you received: 0
-
-

11 years 1 week ago [\#217430](#217430) by [blacknine](/forum/user/36034-blacknine "View blacknine's Profile")  Replied by *[blacknine](/forum/user/36034-blacknine "View blacknine's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217430 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Thank you for replying back.

Unfortunately i'm getting an error Code:

Fatal error: Call to undefined function hikashop_config() in /****/****/public_html/plugins/system/hikashopuser/hikashopuser.php on line 107

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

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

Less More

- Posts: 14
- Thank you received: 0
-
-

11 years 1 week ago [\#217433](#217433) by [blacknine](/forum/user/36034-blacknine "View blacknine's Profile")  Replied by *[blacknine](/forum/user/36034-blacknine "View blacknine's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217433 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

I somehow fixed that fatal error by pasting
Code:

function restoreSession($user){ $app = JFactory::getApplication(); $cart = $app-&gt;getUserState('com_hikashop.cart_id'); if(empty($cart) &amp;&amp; !empty($this-&gt;cart)){ $app-&gt;setUserState('com_hikashop.cart_id',$this-&gt;cart); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cartClass-&gt;initCart(); } if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; if(!empty($cart) &#124;&#124; !empty($this-&gt;cart)){ $config = hikashop_config(); //delete old carts when a new cart is present and that the multicart mode is deactivated if( !$app-&gt;isAdmin() &amp;&amp; !$config-&gt;get('enable_multicart') &amp;&amp; !empty($user['id']) ){ $db = JFactory::getDBO(); $query = $db-&gt;getQuery(true); $query-&gt;setQuery('SELECT cart_id FROM #__hikashop_cart WHERE user_id='.(int)$user['id']).' AND cart_type = '.$db-&gt;Quote('cart'); $db-&gt;setQuery($query); $ids = $db-&gt;loadObjectList('cart_id'); if(isset($ids[$this-&gt;cart])) unset($ids[$this-&gt;cart]); if(count($ids)){ $cartClass = hikashop_get('class.cart'); foreach($ids as $id){ $cartClass-&gt;delete($id-&gt;cart_id,'old'); } } } } $wishlist = $app-&gt;getUserState('com_hikashop.wishlist_id'); if(empty($wishlist) &amp;&amp; !empty($this-&gt;wishlist)){ $app-&gt;setUserState('com_hikashop.wishlist_id',$this-&gt;wishlist); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true; $cartClass = hikashop_get('class.cart'); $cart_type = JRequest::getString('cart_type','cart'); JRequest::setVar('cart_type','wishlist'); $cartClass-&gt;initCart(); JRequest::setVar('cart_type',$cart_type); } $entries = $app-&gt;getUserState('com_hikashop.entries_fields'); if(empty($entries) &amp;&amp; !empty($this-&gt;entries)){ $app-&gt;setUserState('com_hikashop.entries_fields',$this-&gt;entries); } $currency = $app-&gt;getUserState('com_hikashop.currency_id'); if(empty($currency) &amp;&amp; !empty($this-&gt;currency)){ $app-&gt;setUserState('com_hikashop.currency_id',$this-&gt;currency); } $checkout_fields_ok = $app-&gt;getUserState('com_hikashop.checkout_fields_ok'); if(empty($checkout_fields_ok) &amp;&amp; !empty($this-&gt;checkout_fields_ok)){ $app-&gt;setUserState('com_hikashop.checkout_fields_ok',$this-&gt;checkout_fields_ok); } $checkout_fields = $app-&gt;getUserState('com_hikashop.checkout_fields'); if(empty($checkout_fields) &amp;&amp; !empty($this-&gt;checkout_fields)){ $app-&gt;setUserState('com_hikashop.checkout_fields',$this-&gt;checkout_fields); } if(!empty($this-&gt;checkout_fields)){ foreach($this-&gt;checkout_fields as $k =&gt;$v){ if(!isset($_REQUEST['data']['order'][$k])){ $_POST['data']['order'][$k] = $_REQUEST['data']['order'][$k] = $v; } } } }

But still that does not solve my problem. Old items still appeared in my cart when i completed an order.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTg0NC1vbGQtY2FydC1pdGVtcy1hcmUtc3RpbGwtc2hvd2luZy11cD90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 1 week ago [\#217531](#217531) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217531 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Note that Xavier is not here until Monday. So he'll look at that then as he is the specialist on that matter. Sorry for the delay

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTg0NC1vbGQtY2FydC1pdGVtcy1hcmUtc3RpbGwtc2hvd2luZy11cD90bXBsPW1hcmtkb3du) 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 1 week ago -  11 years 1 week ago [\#217692](#217692) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Old cart items are still showing up](/forum/27-checkout/879844-old-cart-items-are-still-showing-up#217692 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.5.15 -- Error-message(debug-mod must be tuned on) -- : Old cart items are still showing up  Old cart items are still showing up even after a successful order checkout, Below are steps to reproduce the scenario  1) A registered user, who is logged in, adds some items to their cart. 2) Then that user logs out or system Auto log out that User after they have been inactive for 15 minutes. 3) The user again add few items in the cart without loggin in and goes till that login step of checkout. 4) The user logs in and complete all the payment. Orders get confirmed. 5) Ideally the cart should get empty, but somehow those items which he added first time when he logged in, appears in cart.  Is there any way i can clear all the old cart items on successful payment?")*

Hi,

There was some code to edit in the function "onLoginUser()" too, but I forgot to mention it in the previous post, my bad.
So please install this attached plugin, this will replace the current one and will solve you issue.

*This attachment is hidden for guests.
Please log in or register to see it.*

Please give us a feedback about this patch, based on your feedback, we will integrate it in the next release.

Last edit: 11 years 1 week ago by [Xavier](/forum/user/4105-xavier "View Xavier's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3OTg0NC1vbGQtY2FydC1pdGVtcy1hcmUtc3RpbGwtc2hvd2luZy11cD90bXBsPW1hcmtkb3du) 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.304 seconds

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

[](#top)
