运费不包括在 wordpress woocommerce 中的贝宝快递结帐中

Posted

技术标签:

【中文标题】运费不包括在 wordpress woocommerce 中的贝宝快递结帐中【英文标题】:Shipping cost is not including in paypal express checkout in 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,如果您想试一试,我可以向您保证运输是正确的。哦,是的,它也是免费的! 【参考方案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);

【讨论】:

以上是关于运费不包括在 wordpress woocommerce 中的贝宝快递结帐中的主要内容,如果未能解决你的问题,请参考以下文章

javascript 不包括运费,这是价格

在购物车和结帐时将运费金额向右移动

在产品页面上显示运费 - WooCommerce

为啥会在WordPress URL中有v = XXXX字符串?

wordpress/woocommerce 使用于拉菜单的“theme_location”等于页面标题 ID。

WooCommerce Admin创建订单并在订单支付上添加运费