Jump to content

Restore Cart with order id or order details?


akasht94

Recommended Posts

Hello devs, Is there any way through which I can restore the cart of a Prestashop 1.6+ through order ID or order details.It would be like reorder function which we used after payment is done or failed when orders created.

I have order details and I just want to trigger the re-order function or something like that through which Cart restores.

Any suggestion would be a great help for me.

Thanks in advance.

Link to comment
Share on other sites

Hi NemoPs, Thanks for your reply.

Actually, This will return the cart id. I already have a cart id. How I can initiate the same cart with that id.I want to restore the cart if the payments fail or cancelled by user or if the person clicked a back button without completing the payment. I have achieved this on magento but not able to implement this with my module in PrestaShop. After validating the order, Cart empties but it should be restored if a Payment failed or cancelled for the user's suitability.

Link to comment
Share on other sites

  • 3 years later...
On 3/15/2017 at 11:39 AM, NemoPS said:

Ah, in that case just use $this->context->cart = new Cart($id_cart);
Then $this->context->cookie->id_cart = $id_cart;

Should work in the front

Hello @NemoPS
I'm new in Prestashop, I used your solution is works
I mean without add new order a new card object will create and after set the cookie , it's show's I have an active card, but when I want to see the Items inside of Card, 
The Card will is EMPTY, again ;-(

Any solution, please ?
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...