cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 1.9 - Please specify a shipping method

Magento 1.9 - Please specify a shipping method

So I've already seen a couple of the other answers to this question on almighty Google, however, my problem is still persisting.

Whenever someone tries to purchase an item using PayPal Express, when they click "Pay Now" it sends them to the Magento Review Page and throws the error "Please specify shipping method". However, if the user goes back to the PayPal Express page, and tries to pay again, it will go through just fine.

Whilst digging through the Magento files to try and see the issue, I've tried the following things.

Set the Timeout Callback on the shipping options to 6s

Added

 

/**
 * Start Customization
 */
    if (!$rate) {
     Mage::logException(new Exception("Rate was empty inside quote validate method, trying to forcefully recalculate"));
     $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
     $this->getQuote()->setTotalsCollectedFlag(false);
     $this->getQuote()->collectTotals();
     $rate  = $address->getShippingRateByCode($method);
    }
/** End Customization **/

From This Question

And I've tried logging the entire process.

What I've gathered from everything is that it looks as though Magento isn't picking up the Shipping Method returned by PayPal, as the Method and Rate from the function _validate() (in/app/code/community/sale/service/quote.php) are Both empty when the pay now action is processed.

Paypal is definitely returning the shipping methods too.

If you need any extra code etc, just comment below.

Any help would be greatly appreciated. Smiley Happy

Thanks!

6 REPLIES 6

Re: Magento 1.9 - Please specify a shipping method

Hi AltBen,

 

I too have this problem occurring with a small percentage of PayPal Express users and a transaction fail is resulting. i have not been able to reproduce it though.

 

Did you ever manage to resolve it?

Re: Magento 1.9 - Please specify a shipping method

Hi! Have you ever solved it? I'm having the same problem either.

Re: Magento 1.9 - Please specify a shipping method

Hi,

 

I am having the same problem. Is it resolved?

Re: Magento 1.9 - Please specify a shipping method

Hello @shreya_anjali

 

app/code/core/Mage/Paypal/Model/Express/Checkout.php

find the following line in method updateShippingMethod(),

$shippingAddress->setShippingMethod ($methodCode) ->setCollectShippingRates(true);



And replace it with

$shippingAddress->setShippingMethod ($methodCode)->setCollectShippingRates (true) ->save();


If it will work then mark as the solution or give kudos


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento 1.9 - Please specify a shipping method

Re: Magento 1.9 - Please specify a shipping method

Problem still persist , this code is not worked for me . Giving after implementing to my code .Below is error message in EXCEPTION.log 

 

2018-10-07T17:12:32+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Please specify a shipping method.' in /app/Mage.php:595
Stack trace:
#0 /app/code/core/Mage/Sales/Model/Service/Quote.php(304): Mage::throwException('Please specify ...')
#1 /app/code/core/Mage/Sales/Model/Service/Quote.php(222): Mage_Sales_Model_Service_Quote->_validate()
#2 /app/code/core/Mage/Sales/Model/Service/Quote.php(238): Mage_Sales_Model_Service_Quote->submitNominalItems()
#3 /app/code/core/Mage/Checkout/Model/Type/Onepage.php(812): Mage_Sales_Model_Service_Quote->submitAll()
#4 /app/code/local/AnattaDesign/AwesomeCheckout/controllers/OnepageController.php(616): Mage_Checkout_Model_Type_Onepage->saveOrder()
#5 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): AnattaDesign_AwesomeCheckout_OnepageController->saveOrderAction()
#6 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#7 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /index.php(86): Mage::run('', 'store')
#11 {main}