【发布时间】:2023-03-16 11:10:02
【问题描述】:
我正在使用 magento 1.7.0.2 和 Google Checkout。如果想使用统一费率,超过 75 美元的免费送货和 10% 的运费在 68 - 75 美元之间。
我如何在我的 magento 商店中实现所有这三个。
【问题讨论】:
我正在使用 magento 1.7.0.2 和 Google Checkout。如果想使用统一费率,超过 75 美元的免费送货和 10% 的运费在 68 - 75 美元之间。
我如何在我的 magento 商店中实现所有这三个。
【问题讨论】:
我进行了更多搜索并找到了解决方案,更改核心文件不是一个好主意,但它正在工作。您可以在发送谷歌结帐之前计算价格和费用。在 /app/code/core/Mage/GoogleCheckout/Model/Api/Xml/checkout.php 更改 google checkout 的核心文件。
转到第 579 行并根据需要设置条件。在我的情况下,条件是:
*********************
$subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal();
if($subTotal <=68.50){
$xml .= <<<EOT
<{$nodeName} name="{$title}">
<shipping-restrictions>
<allowed-areas>
{$allowedAreasXml}
</allowed-areas>
</shipping-restrictions>
<price currency="{$this->getCurrency()}">{$price}</price>
</{$nodeName}>
EOT;
}
if(($subTotal > 68.50) && ($subTotal < 75)){
$price = $subTotal*10/100;
$xml .= <<<EOT
<{$nodeName} name="{$title}">
<shipping-restrictions>
<allowed-areas>
{$allowedAreasXml}
</allowed-areas>
</shipping-restrictions>
<price currency="{$this->getCurrency()}">{$price}</price>
</{$nodeName}>
EOT;
}
if($subTotal >=75){
$price = 0.00;
$xml .= <<<EOT
<{$nodeName} name="{$title}">
<shipping-restrictions>
<allowed-areas>
{$allowedAreasXml}
</allowed-areas>
</shipping-restrictions>
<price currency="{$this->getCurrency()}">{$price}</price>
</{$nodeName}>
EOT;
}
}
现在刷新您的商店并使用 google checkout 付款。
【讨论】: