6

In front end on checkout page in shipment section shipping methods and name appears in bracket along with shipping and handling.

Now it looks like Shipping & Handling (title - method name): 5$

I want look like Shipping & Handling: 5$

Kindly help..

11

You can override the method: Mage_Sales_Model_Quote_Address_Total_Shipping::fetch(). Inside it, there is this piece of code:

$title = Mage::helper('sales')->__('Shipping & Handling');
if ($address->getShippingDescription()) {
    $title .= ' (' . $address->getShippingDescription() . ')';
}

You can comment out the if statement and not show the shipping description.

  • is there any other way to do it? may be template! – Sandesh Jun 25 '13 at 7:39
  • You can try to modify this template: tax/checkout/shipping.phtml and use a regular expression to remove what is inside '(..)' from <?php echo $this->getTotal()->getTitle() ?> . But I really suggest the method in the answer. It's cleaner. – Marius Jun 25 '13 at 7:45
  • Thanks man. I will override method rather than using regular expression. – Sandesh Jun 25 '13 at 7:52
0

You can simply do that by going to System->Configuration->Shipping Method and delete the description text.

it won't show the description text. You do not need to edit any code for this.

  • 1
    The shipping description is generated like this $shippingDescription = $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle(). if you delete the titles of the carier and the methods you will still see ' - ' in the description and you will confuse the customers because they will not see a label on the shipping method step of the checkout. – Marius Jun 25 '13 at 10:16
  • Indeed Marius. You are right! – Sandesh Jun 25 '13 at 11:10
0

You can hide shipping method from front end with observer, write this code in config.xml

<frontend>
<events>
    <sales_quote_collect_totals_before>
        <observers>
            <frontend_shipping_rates_sales_quote_collect_totals_before>
                <class>yourmodule/observer</class>
                <method>hideShippingMethods</method>                    
            </frontend_shipping_rates_sales_quote_collect_totals_before>
        </observers>                
    </sales_quote_collect_totals_before>
</events>

Second in Observer.php use this code

public function hideShippingMethods( Varien_Event_Observer $observer )
{
    if (Mage::getDesign()->getArea() ===   Mage_Core_Model_App_Area::AREA_FRONTEND)
    {
        $quote              = $observer->getEvent()->getQuote();
        $store              = Mage::app()->getStore($quote->getStoreId());
        $carriers           = Mage::getStoreConfig('carriers', $store);

        $hiddenMethodCode   = 'freeshipping'; 

        foreach ($carriers as $carrierCode => $carrierConfig) 
        {
            if( $carrierCode ==  $hiddenMethodCode )
            {
                $store->setConfig("carriers/{$carrierCode}/active", '0');
            }
        }
}
 }

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.