【发布时间】:2013-05-02 11:00:54
【问题描述】:
我的购物车中有这个代码(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 /* You are just <span>$<?php print ($sumtotal); ?></span> away from earning free shipping!</p> */ ?>
此代码计算客户在荷兰境内获得免费送货所需的金额。
有没有办法添加一些代码,以便当来自其他国家/地区的访客访问我们的网上商店时,金额会更改为免费送货。比如德国或者比利时。他们从 149,95 获得免费送货。
我想应该有一个php if 可以确定访问者IP 地址的来源。
谁能帮我设置一下?
【问题讨论】: