WooCommerce(多重货币)的最低订单
此代码适用于所有内容,我想将其指定为某些货币 例如,14 $
是usd
中的最小顺序,但是当货币转换器转换为AED
时,它保持14,应该为51.52 AED
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 14;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'You must have an order with a minimum of 52.5 AED Or 14 $ to place your order' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'You must have an order with a minimum of %s to place your order, your current order total is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
}
}
}
this code works for everything, I want to specify it to certain currency
for example, 14$
is the minimum order in USD
, but when currency converters to AED
it stays 14 it should be 51.52 AED
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 14;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'You must have an order with a minimum of 52.5 AED Or 14 $ to place your order' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'You must have an order with a minimum of %s to place your order, your current order total is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
}
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以定义最小变量如下:
对其进行测试和工作
you can define the minium variable as following:
tested it and working