1

When going through checkout, when I submit the shipping method step with either Free Shipping or Flat Rate Shipping selected I get an error message pop up stating "Invalid shipping method."

This error is triggered in public function saveShippingMethod($shippingMethod) because

$this->getQuote()->getShippingAddress()->getShippingRateByCode($shippingMethod);

is not returning a $rate.

Here is the output of this query:

SELECT * FROM core_config_data 
    WHERE path LIKE 'carriers/flatrate/%' OR path LIKE 'carriers/freeshipping/%';



652 default 0   carriers/flatrate/active    1
653 default 0   carriers/flatrate/title Flat Rate 
654 default 0   carriers/flatrate/name  Fixed
655 default 0   carriers/flatrate/type  O
656 default 0   carriers/flatrate/price 5.00
657 default 0   carriers/flatrate/handling_type F
658 default 0   carriers/flatrate/handling_fee  NULL
659 default 0   carriers/flatrate/specificerrmsg    This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
660 default 0   carriers/flatrate/sallowspecific    0
661 default 0   carriers/flatrate/specificcountry   NULL
662 default 0   carriers/flatrate/showmethod    0
663 default 0   carriers/flatrate/sort_order    1
676 default 0   carriers/freeshipping/active    1
677 default 0   carriers/freeshipping/title Free Shipping
678 default 0   carriers/freeshipping/name  Free
679 default 0   carriers/freeshipping/free_shipping_subtotal    NULL
680 default 0   carriers/freeshipping/specificerrmsg    This shipping met hod is currently unavailable. If you would like to ship using this shipping method, please contact us.
681 default 0   carriers/freeshipping/sallowspecific    0
682 default 0   carriers/freeshipping/specificcountry   NULL
683 default 0   carriers/freeshipping/showmethod    0
684 default 0   carriers/freeshipping/sort_order    NULL

Why am I getting this error and what do i need to do to resolve it?

3 Answers 3

4

The error can only happen if there are no shipping rates associated with the shipping address of the quote for the selected shipping method (flatrate or freeshipping in your case).

To check, have a look in the table sales_flat_quote for the correct shipping address id, and then look into sales_flat_quote_shipping_rate for the associated rates. You should get one record for each available shipping method.

This is the process when the rates are usually calculated and populated in the table:

The shipping rates are calculated when the shipping total model's Mage_Sales_Model_Quote_Address_Total_Shipping::collect() method is called, and the collect_shipping_rates property of the address model is set to true.

This property is set to true when

  • The cart page is visited
  • The shipping rates estimate on the cart page action is called
  • A coupon is entered
  • The checkout/cart model is saved
  • The billing or shipping address is saved during checkout
  • The payment method is saved during checkout

So basically ever time the cart is used to modify the quote or during each of the checkout steps that modify some quote properties.

Are you using a standard onepage checkout or multiaddress checkout?
My guess is some customization broke that flow on your site.

4
  • Vinai, I'm using a standard enterprise onepage checkout.
    – Howie Ross
    Jun 14, 2013 at 20:10
  • Vinai, Thanks for the detailed response. I'm using a standard 1.13 enterprise onepage checkout. When the Shipping Method step is submitted the sales_flat_quote record is updated however sales_flat_quote_shipping_rate record is not. Any additional details you can provide will be very much appreciated. Thanks again!
    – Howie Ross
    Jun 14, 2013 at 20:18
  • The sales_flat_quote_shipping_rate table should already be populated for that quote, at the altest after the shipping address step. Please add the output following query to your question: SELECT * FROM core_config_data WHERE path LIKE 'carriers/flatrate/%' OR path LIKE 'carriers/freeshipping/%';
    – Vinai
    Jun 14, 2013 at 20:42
  • Vinai, I've added the output of the query you requested. Sorry for the delay, I was pulled onto another project for the past 2 weeks.
    – Howie Ross
    Jul 3, 2013 at 22:01
0

This issue was caused by the introduction of a Customer Address Attribute. I created an 'Address Type' dropdown field with options for 'Commercial' and 'Residential'. I suspect that this is preventing addresses from saving properly. Turning 'Show on Frontend' to No and making 'Values Required' No did not fix the issue. However, deleting the field allowed addreses to display in the checkout progress sidebar and fixed the issue of not being able to proceed past the shipping step.

0

Go to Customers -> Customer Groups. Click on a customer group (probably NOT LOGGED IN in your case), make sure that some or all payment methods are selected and save.

Only payment methods which are selected there are available for this customer group.

1
  • there is no payment methods options in Customers > Customer Groups
    – Raptor
    Aug 29, 2016 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.