Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento Paypal order placed but incorrect redirect

I am working with Magento V1.9.1.1.

I have entered the correct details for the sandbox account into the Website Payments Standard (Includes Express Checkout) "configure" area and enabled the solution.

When I put an item in the cart and pay with paypal, it takes you away to a paypal "pay site" to which I log in with the test buyer account and pay for the transaction. When I click the continue button it takes me back to my website to a review order page in which the user has to select a shipping method.

Once selected you then click the "place order button" it takes you to:

http://www.domain.co.uk/checkout/cart

with a message saying:

Unable to initialize Express Checkout. You have no items in your cart.

Note: The purchase is visible within the paypal developer sandbox. Also the order is placed correctly within Magento Sales->Orders.

It just seems to not take the user to the right place.

Any help on this would be appreciated.

like image 858
AndrewBramwell Avatar asked Oct 31 '22 01:10

AndrewBramwell


1 Answers

Unable to initialize Express Checkout.

This error is thrown when the following condition is true:

if (!$quote->hasItems() || $quote->getHasError()) 

It seems that the order is placed before the submit button is clicked and so the cart becomes empty and !$quote->hasItems() becomes true

like image 53
laurent Avatar answered Nov 15 '22 07:11

laurent