如何在woocommerce中获得免费送货的最低订单金额 [英] How to get minimum order amount for free shipping in woocommerce

查看:25
本文介绍了如何在woocommerce中获得免费送货的最低订单金额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何获取在 woocommerce 中获得免费送货所需的最低订单金额(woocommerce_free_shipping_min_amount,在管理面板 woocommerce -> 设置 -> 送货 -> 免费送货 -> 最低订单金额)?

How can i fetch minimum order amount required to get free shipping ( woocommerce_free_shipping_min_amount which is set in admin panel woocommerce -> settings -> shipping -> free shipping -> minimum order amount ) in woocommerce?

我想在前端页面显示这个价格

I want to display this price in front-end page

推荐答案

此值存储在 woocommerce_free_shipping_settings 键下的 option 中.它是一个由 WC_Settings_API->init_settings() 加载的数组.

This value is stored in an option under the key woocommerce_free_shipping_settings. It is an array that is loaded by the WC_Settings_API->init_settings().

如果你想直接访问它,你可以使用get_option():

If you want to get access to it directly you can use get_option():

$free_shipping_settings = get_option( 'woocommerce_free_shipping_settings' );
$min_amount = $free_shipping_settings['min_amount'];

这篇关于如何在woocommerce中获得免费送货的最低订单金额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆