Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- copy /app/code/core/Mage/Checkout/Model/Session.php
- /app/code/local/Mage/Checkout/Model/Session.php
- $this->_quote = $quote;
- $sha = $quote->getShippingAddress();
- if (!$sha->getCountry()) {
- $country = Mage::getStoreConfig('shipping/origin/country_id');
- $state = Mage::getStoreConfig('shipping/origin/region_id');
- $postcode = Mage::getStoreConfig('shipping/origin/postcode');
- $quote->getShippingAddress()
- ->setCountryId($country)
- ->setRegionId($state)
- ->setPostcode($postcode)
- ->setCollectShippingRates(true);
- $quote->save();
- }
- /app/design/frontend/base/default/checkout/cart/shipping.phtml
- /app/design/frontend/default/YOURTEMPLATE/checkout/cart/shipping.phtml
- <form id="co-shipping-method-form" action="<?php echo $this->getUrl('checkout/cart/estimateUpdatePost') ?>">
- <dl class="sp-methods">
- <?php foreach ($_shippingRateGroups as $code => $_rates): ?>
- <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
- <dd>
- <ul>
- <?php foreach ($_rates as $_rate): ?>
- <li<?php if ($_rate->getErrorMessage()) echo ' class="error-msg"';?>>
- <?php if ($_rate->getErrorMessage()): ?>
- <?php echo $this->escapeHtml($_rate->getErrorMessage()) ?>
- <?php else: ?>
- <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" />
- <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
- <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
- <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
- <?php echo $_excl; ?>
- <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
- (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
- <?php endif; ?>
- </label>
- <?php endif ?>
- </li>
- <?php endforeach; ?>
- </ul>
- </dd>
- <?php endforeach; ?>
- </dl>
- <div class="buttons-set">
- <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>
- </div>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement