【问题标题】:Free shipping on google checkout in magentoMagento 谷歌结账免运费
【发布时间】:2023-03-16 11:10:02
【问题描述】:

我正在使用 magento 1.7.0.2 和 Google Checkout。如果想使用统一费率,超过 75 美元的免费送货和 10% 的运费在 68 - 75 美元之间。

我如何在我的 magento 商店中实现所有这三个。

【问题讨论】:

    标签: magento google-checkout


    【解决方案1】:

    我进行了更多搜索并找到了解决方案,更改核心文件不是一个好主意,但它正在工作。您可以在发送谷歌结帐之前计算价格和费用。在 /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 付款。

    【讨论】:

      猜你喜欢
      • 2012-04-03
      • 1970-01-01
      • 2012-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-30
      • 2018-11-27
      相关资源
      最近更新 更多