Magento Transaction Error "Specify Delivery Method"

We use a custom extension for validation using a template wizard called "Firecheckout". Not sure if this is important, but thought I should mention this. Sometimes I see a transaction error message because "Please specify a shipping method." For a long time I tried to figure out how this can happen, and I'm lost. I tried everything I could think to duplicate the problem. Depending on the combination of things that I do (adding / removing items from the basket, adding / removing a coupon code that changes delivery options, switching between mobile and desktop sites, etc.), I could make the check page U options there is an option selected for the delivery method. However, if I try to send the order, I get an immediate red message in the delivery method section, which says: “Specify the delivery method” (note the difference between what he says by email and what he says in error displayed on the page ... missing "a"). This does not result in an error message.

Search by code I found that the error message is triggered in the TM_FireCheckout_Model_Service_Quote class (extends Mage_Sales_Model_Service_Quote ) in the _validate method. p>

$method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) { Mage::throwException($helper->__('Please specify a shipping method.')); } 

In this case, I assume that either $ method or $ rate is null or false, but why / how could this be? Can I do something to prevent this from happening? The only difference between the FireCheckout _validate method and the parent class _validate method is which fields are considered mandatory. It does not change the address object in any way, so subsequent calls to getShippingMethod and getShippingRateByCode should match the default setting.

I can provide additional information if necessary. I'm basically trying to figure out what might cause this error and how can I reproduce it so that I can ultimately fix the hole that causes it in the first place.

Thanks!

+7
source share
2 answers

I have already come across something similar, but not Firecheckout. But it was also the Onestepcheckout Extension from Apptha, like @Lennon. In short, it was a mismatch in the javascript processing that distorted the data. I do not have a specific answer for you, but I advise you to see what happens between validating the form and saving the data in the statement form.

What you can do to start an investigation is to start Firebug on FF, look at the console and see if all your data is transferred. You can also create a simple observer module to do the following in the controler_action_predispatch event:

 $request = $observer->getControllerAction()->getRequest(); Mage::log(var_export($request->getParams(),true)); 

.. or simply edit the controller files within your verification routes. no matter what your boat is sailing.

Include logs and tail -f var/logs/system.log . You need to make sure the queries match the log. So I started to solve my problem.

Again, this is not a copypasta fix or a textbook aimed at the root of the problem, but rather an exchange of experience with how I diagnosed my problem first-hand.

You can quickly create a module at http://www.silksoftware.com/magento-module-creator

0
source

You need to determine the shipping method after the changes. For example, in the "indexController" of Firecheckout, create the "saveShippingAction" function. You can call this function through Ajax every time to change client data or, as you prefer.

Inside the place:

  $customer = Mage::getSingleton('customer/session')->getCustomer(); $shippingData = $this->getRequest()->getParam('shipping'); $shippingData['street'] = implode("\n", $shippingData['street']); $customerAddress = $customer->getAddresses(); $customerAddress = end($customerAddress); $customerAddress->setIsDefaultShipping(true)->setSaveInAddressBook(true); $customerAddress->addData($shippingData)->save(); 

In this example, I write the delivery data back to the last customer address, if in your case you need to save for a new customer, just create an address for it and save it as the delivery address.

I hope to help, good luck.

0
source

All Articles