I'm just wondering if it's possible to allow a customer to select a shipping method on the cart/basket page without entering country or postcode? I have added an image of a mockup to show what it is I'm looking to do. If anyone knows a tutorial or extension that would do this that would be great.

enter image description here

1 Answer 1


If you don't ship to different countries, or if you don't use the matrixrate extension, you can edit the estimate tax & shipping box to get this effect.

I've used this tutorial as a base:


copy /app/code/core/Mage/Checkout/Model/Session.php 



and before:

$this->_quote = $quote;

add this

$sha = $quote->getShippingAddress();
if (!$sha->getCountry()) {
$country = Mage::getStoreConfig('shipping/origin/country_id');
$state = Mage::getStoreConfig('shipping/origin/region_id');
$postcode = Mage::getStoreConfig('shipping/origin/postcode');

then copy




and change it, I've changed it to:

  <div class="shipping">
<h2><?php echo $this->__('Estimate Shipping and Tax') ?></h2>
<div class="shipping-form">

    <?php if (($_shippingRateGroups = $this->getEstimateRates())): ?>
    <form id="co-shipping-method-form" action="<?php echo $this->getUrl('checkout/cart/estimateUpdatePost') ?>">
        <dl class="sp-methods">
            <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
                <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
                    <?php foreach ($_rates as $_rate): ?>
                        <li<?php if ($_rate->getErrorMessage()) echo ' class="error-msg"';?>>
                           <?php if ($_rate->getErrorMessage()): ?>
                                <?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
                           <?php else: ?>
                                <input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
                                <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
                                <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
                                <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
                                <?php echo $_excl; ?>
                                <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
                                    (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
                                <?php endif; ?>
                           <?php endif ?>
                    <?php endforeach; ?>
            <?php endforeach; ?>
        <div class="buttons-set">
            <button type="submit" title="<?php echo $this->__('Update Total') ?>" class="button" name="do" value="<?php echo $this->__('Update Total') ?>"><span><span><?php echo $this->__('Update Total') ?></span></span></button>
    <?php endif; ?>


  • No, this hasn't worked for me. My shipping methods are not visible.
    – Duggy G
    Commented Nov 4, 2014 at 9:36
  • I've edited the two files, it should work now. I've added a reset in Session.php and removed the form fields in shipping.phtml I took the information from this link: magentocommerce.com/boards/v/viewthread/194314/#t245813 Commented Nov 4, 2014 at 10:17
  • Brilliant, I have this working. Thankyou for your help.
    – Duggy G
    Commented Nov 6, 2014 at 23:43
  • hi the above URL is not working (magentocommerce.com/boards/v/viewthread/194314/#t245813) I need to set select Shipping method option in cart page. Please help Commented Oct 3, 2017 at 10:42
  • I tried the above code its not working.please help Commented Oct 3, 2017 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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