Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <config>
- <modules>
- <Ocra_CartShipping>
- <version>1.3.0</version>
- </Ocra_CartShipping>
- </modules>
- <global>
- <models>
- <ocra_cartshipping>
- <class>Ocra_CartShipping_Model</class>
- </ocra_cartshipping>
- </models>
- <events>
- <sales_quote_collect_totals_before>
- <observers>
- <ocra_cartshipping>
- <class>ocra_cartshipping/observer</class>
- <method>handleShippingMethod</method>
- </ocra_cartshipping>
- </observers>
- </sales_quote_collect_totals_before>
- </events>
- </global>
- </config>
- <?php
- class Ocra_CartShipping_Model_Observer {
- public function handleShippingMethod($observer) {
- $quote = $observer->getEvent()->getQuote();
- $shippingAddress = $quote->getShippingAddress();
- $billingAddress = $quote->getBillingAddress();
- if(Mage::app()->getRequest()->getControllerName() == 'checkout_cart'){
- $shippingAddress->setShippingMethod(null);
- $shippingAddress->save();
- $saveQuote = true;
- }
- }
- }
Add Comment
Please, Sign In to add comment