I have add product in cart after that i have checkout page, now in checkout page i will fill the all details also select shipping method but not proceed order.after that i have going on cart then my grandtotal showing with shipping cost so i have to remove this shipping cost in my cartgrand total because customer can confusion how that total will increase.so i will only show product total with text in cart if i am select shipping method they can't be display in cart only show at checkout time. Is this possible in magento 1.9 ?
-
U must remove shipping from the quote before rending your cart, overide the controller– Mohamed El MrabetNov 28, 2017 at 8:40
-
Can you explain in detail ? like file name or else method etc..– meetNov 28, 2017 at 8:42
-
I ll send you ana answer after one hour ok– Mohamed El MrabetNov 28, 2017 at 8:45
1 Answer
Try this Create an observer in checkout_cart_save_before
<frontend>
<events>
<checkout_cart_save_before>
<observers>
<your_module_shipping_observer>
<type>singleton</type>
<class>Your_Module/observer</class>
<method>setFreeShipping</method>
</your_module_shipping_observer>
</observers>
</checkout_cart_save_before>
</events>
</frontend>
And in your observer try this
public function setFreeShipping($observer) {
$event = $observer->getEvent();
$cart = $event->getCart();
$shippingaddress = $cart->getQuote()->getShippingAddress();
$shippingaddress->setShippingMethod('')->save();
return;
}
Tell me if that's helped you?
-
Only one changes in our method name is setShipping and you can defined method is setFreeShipping.other wise all are working fine.thanks– meetNov 28, 2017 at 9:29
-