【问题标题】:Shipping cost is not including in paypal express checkout in wordpress woocommerce运费不包括在 wordpress woocommerce 中的贝宝快递结帐中
【发布时间】:2014-05-17 19:46:33
【问题描述】:

我为我的运行 woocommerce 的 wordpress 网站带来了 http://www.woothemes.com/products/paypal-express/ 插件。但运费不包括在贝宝快递结帐期间。

我检查了 woocommerce shipping 中的所有设置。我还检查了其他支付网关,它们包括运费

谁能建议如何在 woocommerce 的贝宝快递结账中包含运费。

【问题讨论】:

  • 不幸的是,我对 Woo PayPal 扩展的体验让我想要更多……更多。因此,我开发了自己的独立扩展程序PayPal for WooCommerce,如果您想试一试,我可以向您保证运输是正确的。哦,是的,它也是免费的!

标签: wordpress woocommerce payment shipping paypal


【解决方案1】:

这样做的唯一方法是编辑插件文件 woocommerce-gateway-paypal-express.php 中的实际代码,基本上我所做的是使用文件中的 cart->get_cart_shipping_total()。不幸的是,它是用 html 格式化的,所以我不得不把一些东西分解出来,我已经包含了下面的代码。

$shipping = WC_PayPal_Express_Compatibility::WC()->cart->get_cart_shipping_total();
$shippingarray = explode(";", $shipping);
$shippingarray = explode("</span>", $shippingarray[1]);
$shippingamt = str_replace("_",".", $shippingarray[0]);
$nvpstr .= "&PAYMENTREQUEST_0_SHIPPINGAMT=" . $shippingamt;

然后您还必须编辑总金额行:

$nvpstr .= "&PAYMENTREQUEST_0_AMT="     . number_format($order_total + $shippingamt, 2);

【讨论】:

    猜你喜欢
    • 2013-01-13
    • 1970-01-01
    • 2017-03-26
    • 2018-09-03
    • 2014-09-06
    • 2019-05-08
    • 2017-09-26
    • 2019-01-11
    • 2015-11-18
    相关资源
    最近更新 更多