Magento Forum

   
Your Just X Dollars away from Free shipping
 
wjohan
Member
 
Avatar
Total Posts:  46
Joined:  2011-03-08
Monnickendam
 

Hi guys,

DId anyone of you encounter a extensions for magento which can display the following in a block.

“You’re Just X Dollars away from Free shipping”

Has anyone ideas to make it? I’m a php noob but it doesn’t look that difficult (or is it?)

Thnx

Joey

 
Magento Community Magento Community
Magento Community
Magento Community
 
furnitureforyoultd
Enthusiast
 
Total Posts:  833
Joined:  2009-03-09
 

There was some code on snippi.net (gone) which did this

<?php if ($this->getSubtotal() < freeshippingamount): ?><br/>

         <
b>Add <span><font color="red"><?php echo Mage::helper('checkout')->formatPrice(freeshippingamount $this->getSubtotal()) ?></font></spanto your order to get Free Delivery.</b>

      
<?php else: ?><br/>   
       
Free Delivery!

Depending on how you display your prices you may need to mess around with the actual free shipping price or change getSubtotal to something else.

 
Magento Community Magento Community
Magento Community
Magento Community
 
wjohan
Member
 
Avatar
Total Posts:  46
Joined:  2011-03-08
Monnickendam
 

I will try this thnx very much..

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
reflexiv
Jr. Member
 
Avatar
Total Posts:  17
Joined:  2011-11-29
 

For getting the subtotal in the above code I needed to use:

$this->getQuote()->getSubtotal()
Otherwise it worked great, thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
wjohan
Member
 
Avatar
Total Posts:  46
Joined:  2011-03-08
Monnickendam
 

For anyone who would like to know, this is the latest version. I putted in another if function to make sure the message isn’t shown when no products are in the shopping cart, to be not very pushy. I placed it in de sidebar cart block just beneath the title, looks very neat.

<div class="xaway">
<?php $freeshippingamount 25?>
<?php $rest 
Mage::helper('checkout')->formatPrice($freeshippingamount $this->getSubtotal()); ?>
<?php 
if ($_cartQty>0): ?>
<?php 
if ($this->getSubtotal() < $freeshippingamount)

        

            
echo "<b>You are just<span><font color=\"red\">$rest</font></span> dollars away from <br />FREE SHIPPING!</b>";
        
}

    
else    
            
echo " ";
        
}
?> 
<?php 
endif ?>
</div>

Cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
jshayne
Jr. Member
 
Total Posts:  2
Joined:  2010-04-07
 

The above solutions only partially worked for me. I tweaked the code and successfully added this to the 2columns-left.phtml template:

<?php $freeshippingamount 250?>
<?php $subtotal 
Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal(); ?>
<?php 
if ($subtotal $freeshippingamount): ?><br/>
<
b>Add <span><font color="red">$<?php echo ($freeshippingamount $subtotal?>
</font></span>of eligible items to your order to qualify for FREE Shipping!</b>
<?php else: ?><br/>   
You've Got Free Shipping!
<?php endif ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cameron_iWeb
Member
 
Avatar
Total Posts:  62
Joined:  2012-03-22
 

Worked perfect.

Much appreciated.

The only difference I used was where free shipping used a hardcode amount, I assigned this into a custom variable so the admin can change this as they need.

<?php $freeshippingamount = 250; ?>
<?php $subtotal = Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal(); ?>
<?php if ($subtotal < $freeshippingamount): ?><br/>
<b>Add <span><font color="red">$<?php echo ($freeshippingamount - $subtotal) ?>
</font></span>of eligible items to your order to qualify for FREE Shipping!</b>
<?php else: ?><br/>
Youve Got Free Shipping!
<?php endif ?>

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top