cancel
Showing results for 
Search instead for 
Did you mean: 

How to re showing shipping method in cart page after hide in magento 1.9

How to re showing shipping method in cart page after hide in magento 1.9

Hello,

 

I am hiding shipping method from cart page using following code in my observer, now shipping method is hide from the cart page and now i want to show again shipping method in cart page but i could not show shipping method in cart page.

 

I have setup two shipping method

1) Free shipping method

2) Table Rate

 

Before run this code both method showing properly.

 

I used following code for hide shipping method.

 

public function setFreeShipping($observer) {
$event = $observer->getEvent();
$cart = $event->getCart();
$shippingaddress = $cart->getQuote()->getShippingAddress();
$shippingaddress->setShippingMethod('')->save();
return;
}

 

Now i am removed my observer but still not showing shipping method in cart page.

 

 

Please suggest any one

 

Thanks

1 REPLY 1

Re: How to re showing shipping method in cart page after hide in magento 1.9

Hello @mahen_nag ,

 

You can use this script.

 

$shippingMethod = $quote->getShippingAddress()->getShippingMethod();
if($shippingMethod){    $quote->getShippingAddress()->setShippingMethod(null);  //setting method to null    $quote->save(); 
} 

 

If my answer is useful, please Accept as Solution & give Kudos