如果您管理使用以下語言構建的在線商店,那麼這篇文章很有用 WooCommerce 並且您想知道如何設置最低訂單金額 WooCommerce。在線上商店的預設設定中 self-hosted,結帳選項不存在。 因此,確定訂單的最低金額將通過另一種方法完成。
與實體店相比,網上商店通常會根據其針對的客戶、銷售產品的類型、價值以及支付和交付方式施加新的規則。
如果我們去實體店花 10 美分購買產品沒有問題,那麼在網上商店情況就有些不同了。 客戶下的任何訂單也涉及商店的一些費用。 從訂單的簡單處理到包裝發貨,所有這些操作都需要時間。
當銷售報價包含非常便宜的產品時,最好為每個訂單設置最低金額。 例如,如果購物籃中的產品總數未達到 10 歐元的總和,則無法完成訂單。
如何設置最低訂單金額 WooCommerce
最簡單的方法是在 functions.php 您可以通過它設置訂單的最低金額 WooCommerce.
打開文件 functions.php 活動主題(最好是子主題)並添加以下代碼:
// Set Minimum Order Amount in WooCommerce
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
$minimum = 10; // Set this variable to specify a minimum order value
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order ' ,
wc_price( WC()->cart->total ),
wc_price( $minimum )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to place your order' ,
wc_price( WC()->cart->total ),
wc_price( $minimum )
), 'error'
);
}
}
}
這裡也是設置消息的地方,提示買家沒有總金額未達到下單最低限額的商品。

- 如何自動刪除產品圖片 WooCommerce,與產品一起
- 固定 wc-ajax = get_refreshed_fragments 高 CPU 用法(禁用 AJAX 購物車片段)
- 如何快速刪除所有訂單(Orders) WooCommerce [SQL提示]
- 如何取消選中默認值 “Ship to different address” 從 Woocommerce 結帳頁面
至 WooCommerce 一些在線支付模塊提供自動支持設置下訂單的限額。
此功能適用於以低價銷售產品,無法支付加工和運輸成本的在線商店。