Guest User

Untitled

a guest
Jun 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?xml version="1.0"?>
  2. <config>
  3. <modules>
  4. <Ocra_CartShipping>
  5. <version>1.3.0</version>
  6. </Ocra_CartShipping>
  7. </modules>
  8. <global>
  9. <models>
  10. <ocra_cartshipping>
  11. <class>Ocra_CartShipping_Model</class>
  12. </ocra_cartshipping>
  13. </models>
  14. <events>
  15. <sales_quote_collect_totals_before>
  16. <observers>
  17. <ocra_cartshipping>
  18. <class>ocra_cartshipping/observer</class>
  19. <method>handleShippingMethod</method>
  20. </ocra_cartshipping>
  21. </observers>
  22. </sales_quote_collect_totals_before>
  23. </events>
  24. </global>
  25. </config>
  26.  
  27. <?php
  28. class Ocra_CartShipping_Model_Observer {
  29. public function handleShippingMethod($observer) {
  30.  
  31.  
  32. $quote = $observer->getEvent()->getQuote();
  33. $shippingAddress = $quote->getShippingAddress();
  34. $billingAddress = $quote->getBillingAddress();
  35.  
  36.  
  37. if(Mage::app()->getRequest()->getControllerName() == 'checkout_cart'){
  38. $shippingAddress->setShippingMethod(null);
  39. $shippingAddress->save();
  40.  
  41. $saveQuote = true;
  42. }
  43. }
  44. }
Add Comment
Please, Sign In to add comment