update cart

  • Posts: 137
  • Thank you received: 2
12 years 1 month ago #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->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 or Create an account to join the conversation.

  • Posts: 81564
  • Thank you received: 13071
  • MODERATOR
12 years 1 month ago #41846

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 or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum