country - Php if selection by origin visitor (ip adress) -
i have code in shopping cart (magento 1.6.2)
<?php if ($this->getquote()->getsubtotal() < 41.28): ?> <?php $subtotalamt = $this->getquote()->getsubtotal(); ?> <?php $freeshipamt = 41.28; ?> <?php $sumtotal = ($freeshipamt - $subtotalamt )* 1.21; ?> <?php mage::helper('checkout')->formatprice($sumtotal); ?> <p>gratis verzending vanaf € 49,95 <br/>(binnen nederland)</p><p> <strong>nog <span>€ <?php print number_format($sumtotal, 2, ',', ' '); ?></span> tot gratis verzending!</strong></p> <?php else: ?><p><strong>uw bestelling wordt gratis verzonden!</strong> <br/>(binnen nederland)</p> <?php endif ?> <?php /* <span>$<?php print ($sumtotal); ?></span> away earning free shipping!</p> */ ?>
this code calculates needed amount customer receive free shipping within netherlands.
is there way add code when vistor other country visits our webshop amount changed free shipping. germany or belgium. receive free shipping 149,95.
i guess there should php if
whick can determine origin of vistors ip-adress. can me set up?
the ip country databases , apis. apis might work fine end paying money them...
take time check php class + db:
https://github.com/magorski/php-ip-2-country
ps: maybe dbs not bad, right i'm using on real system php class simple db job , smaller 1 pointed at. (maybe less precise or something).
Comments
Post a Comment