Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. copy /app/code/core/Mage/Checkout/Model/Session.php
  2.  
  3. /app/code/local/Mage/Checkout/Model/Session.php
  4.  
  5. $this->_quote = $quote;
  6.  
  7. $sha = $quote->getShippingAddress();
  8. if (!$sha->getCountry()) {
  9. $country = Mage::getStoreConfig('shipping/origin/country_id');
  10. $state = Mage::getStoreConfig('shipping/origin/region_id');
  11. $postcode = Mage::getStoreConfig('shipping/origin/postcode');
  12. $quote->getShippingAddress()
  13. ->setCountryId($country)
  14. ->setRegionId($state)
  15. ->setPostcode($postcode)
  16. ->setCollectShippingRates(true);
  17. $quote->save();
  18. }
  19.  
  20. /app/design/frontend/base/default/checkout/cart/shipping.phtml
  21.  
  22. /app/design/frontend/default/YOURTEMPLATE/checkout/cart/shipping.phtml
  23.  
  24. <form id="co-shipping-method-form" action="<?php echo $this->getUrl('checkout/cart/estimateUpdatePost') ?>">
  25. <dl class="sp-methods">
  26. <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
  27. <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
  28. <dd>
  29. <ul>
  30. <?php foreach ($_rates as $_rate): ?>
  31. <li<?php if ($_rate->getErrorMessage()) echo ' class="error-msg"';?>>
  32. <?php if ($_rate->getErrorMessage()): ?>
  33. <?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
  34. <?php else: ?>
  35. <input name="estimate_method" type="radio" value="<?php echo $this->escapeHtml($_rate->getCode()) ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio" />
  36. <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
  37. <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
  38. <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
  39. <?php echo $_excl; ?>
  40. <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
  41. (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
  42. <?php endif; ?>
  43. </label>
  44. <?php endif ?>
  45. </li>
  46. <?php endforeach; ?>
  47. </ul>
  48. </dd>
  49. <?php endforeach; ?>
  50. </dl>
  51. <div class="buttons-set">
  52. <button type="submit" title="<?php echo $this->__('Update Total') ?>" class="button" name="do" value="<?php echo $this->__('Update Total') ?>"><span><span><?php echo $this->__('Update Total') ?></span></span></button>
  53. </div>
  54. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement