Pages

Sunday, November 29, 2015

Magento- Free Shipping For International Users


Hi EveryOne, here is the trick for giving free shipping when customer is out side from you country, Just follow below steps-

1. If You are using Magento Theme the goto- /app/design/frontend/yourtheme/default/template/tax/checkout/subtotal.phtml

2. Get Current 'Country Id' and 'Shipping Amount' , just put below code

$countryId=Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getData('country_id');

$shipamount=Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingAmount();


3.Find out if( $getModuleName.$getControllerName != 'checkoutcart' ){ *Code* }

4. Copy and Paste following code instead if( $getModuleName.$getControllerName != 'checkoutcart' ){ *Code* } this loop.


Note: Please mention your '$countryid'  and '$subtotal' amount in below if block

if( $getModuleName.$getControllerName != 'checkoutcart' )
{

            if ($countryId == 'US' || 'UK' && $subtotal >= 1000 )
            {?>

                <div class="disCount clearfix">
                    <div class="fRt">
                                    <div class="clearfix discBlock">
                                        <span>Discount- FREE SHIPPING</span>
                                        <?php
                $shipamount = round( $shipamount );       
                $grandtotal = $grandtotal - $shipamount;
                ?>
        <span class="price">-<i class="WebRupee">Rs. </i><?php echo $shipamount; ?></span></div></div></div>   
                <?php
            }?>
            <span class="price"><?php  echo $this->helper('checkout')->formatPrice($grandtotal); ?></span>
   

<?php
}



4. Clear the cache and run the code.

Simple...........


Thank You, If you have any queries post it below. 

No comments:

Post a Comment