我使用WooCommerce及以下插件: https://codecanyon.net/item/woocommerce-point-of-sale-pos/7869665獲取訂單總額前順序被放置在payment_fields功能
下面的代碼應打印在支付領域,應在計算機上打開一個應用程序的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我很抱歉,但我想我沒有說清楚,我使用以下插件的銷售點系統:https://codecanyon.net/item/woocommerce-point- sale-pos/7869665 選擇某個項目時,它不會存儲在默認的WC購物車中,而是存儲在插件的系統中。 – Rick
這是一個商業插件,我們無法測試...很抱歉給您 – LoicTheAztec