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

#   update cart

##

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

Less More

- Posts: 137
- Thank you received: 2
-
-

14 years 8 months ago [\#41661](#41661) by [emergentec](/forum/user/949-emergentec "View emergentec's Profile")  *[update cart](/forum/2-general-talk-about-hikashop/41661-update-cart#41661 "Hi Nicolas,  the payment method that i use in the respective website sorts the transactions into 2 categories: confirmed and cancelled. So by reading the result i want to retain the cart in the second case. in the checkout.php i have found how to not delete the cart based on the payment method. but at that point the $order-&gt;order&#95;status equals created. so i cannot discriminate between the 2 states. What i would like to ask is if it is possible to add to the cart the product(s) after the transaction is completed and from which method/step of the workflow?  the possibility of setting the checkout parameter &quot;empty the cart when order is:&quot; does not help because there is also another payment method with other specification..  Thank you in advance.")* was created by *[emergentec](/forum/user/949-emergentec "View emergentec's Profile")*

Hi Nicolas,

the payment method that i use in the respective website sorts the transactions into 2 categories: confirmed and cancelled. So by reading the result i want to retain the cart in the second case. in the checkout.php i have found how to not delete the cart based on the payment method. but at that point the $order-&gt;order_status equals created. so i cannot discriminate between the 2 states.
What i would like to ask is if it is possible to add to the cart the product(s) after the transaction is completed and from which method/step of the workflow?

the possibility of setting the checkout parameter "empty the cart when order is:" does not help because there is also another payment method with other specification..

Thank you in advance.

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

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 8 months ago [\#41846](#41846) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: update cart](/forum/2-general-talk-about-hikashop/41661-update-cart#41846 "Hi Nicolas,  the payment method that i use in the respective website sorts the transactions into 2 categories: confirmed and cancelled. So by reading the result i want to retain the cart in the second case. in the checkout.php i have found how to not delete the cart based on the payment method. but at that point the $order-&gt;order&#95;status equals created. so i cannot discriminate between the 2 states. What i would like to ask is if it is possible to add to the cart the product(s) after the transaction is completed and from which method/step of the workflow?  the possibility of setting the checkout parameter &quot;empty the cart when order is:&quot; does not help because there is also another payment method with other specification..  Thank you in advance.")*

Hi,

There is no method which would take the products of an order and put them in a new cart. That would have to be coded "by hand" via a hikashop plugin implementing the onAfterOrderCreate for example.

What I would do in your case is this:
Keep "empty the cart when order is:" to completed. And in such hikashop plugin, implement onAfterOrderCreate to clean the cart for one payment method and implement onAfterOrderUpdate to clean the cart only when the order is cancelled for the other payment method.

That shouldn't be too complex, especially compared to recreating the whole cart.

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

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