【发布时间】:2017-02-16 19:54:10
【问题描述】:
我正在使用 WooCommerce 和以下插件: https://codecanyon.net/item/woocommerce-point-of-sale-pos/7869665
以下代码应在支付字段上打印一个 URL,该 URL 应在计算机上打开一个应用程序。所有这些都工作正常,但 URL 需要包含总订单价格(以美分为单位,因此乘以 100),我无法完成这项工作。我已经编写了以下代码,唯一缺少的是 $order_price_cents。
public function payment_fields()
{
$smartpinurl = "smartpin://payment?price=" . $order_price_cents . "&vat=zero&reference=Bestelling%20bij%DE-IT%20";
echo '<a class="x-btn x-btn-rounded x-btn-regular" href="' . $smartpinurl . '" target="_blank">Activeer Smartpin App</a>';
}
单击此按钮时尚未下订单,因此我无法使用默认方式获取价格。
例如:我在 POS 系统中选择了价值 10.00 欧元的产品。所以 $order_price_cents 需要为 1000。
【问题讨论】:
-
@LoicTheAztec 很抱歉,但我认为我没有说清楚,我将以下插件用于销售点系统:codecanyon.net/item/woocommerce-point-of-sale-pos/7869665 选择项目时,它没有存储在默认的 WC 购物车中,而是存储在插件的系统中。
-
这是一个商业插件,我们无法测试……对不起
标签: php wordpress woocommerce point-of-sale