Saturday, 3 November 2012

Magento Add Free Shipping promotions to the sidebar my cart block

app/design/frontend/base/default/template/checkout/cart/sidebar.phtml

 

 

replace the following code :

 

 
        <!--The section we want is around line 48-->
<p>
<?php if ($this->canApplyMsrp()): ?>
<span><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
<?php else: ?>
<span><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
<?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
<br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
<?php endif; ?>
<?php endif; ?>
</p>
</div>
<?php endif ?>
<!--Here is our conditional statement, if more that $60 in cart, then $free_delivery is less than zero, and first message gets displayed -->
<?php $free_delivery=60-$this->getSubtotal();?>
<?php if ($free_delivery<0): ?>
<br /><p><b>Free UPS Ground delivery with this order!</b></p>
<!--Here is the second part, if less that $60 in cart, then $free_delivery message displays a teaser to add more stuff to cart-->
<?php else: ?>
<br /><p>Free UPS Ground delivery when spending $60 or more!
<!--Here is where the amount they need to spend is displayed-->
<br><b>Spend another <?php echo Mage::helper('checkout')->formatPrice($free_delivery) ?> to get free delivery with this order!</b></p>
<?php endif ?>
<?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>

No comments:

Post a Comment