我们公司的订单门户涉及成千上万的产品销售。
我正在尝试向数量中添加千位分隔符,以使其更易于阅读(而不是作为输入)。它应该像价格的千位分隔符一样显示。 我一直在尝试在我的子主题功能页面中添加一些自定义代码:
// define the woocommerce_quantity callback
function filter_woocommerce_quantity( $quantity, $product ) {
// filter
return number_format($stock_quantity,0,”.”,”,”);
};
// add the filter
add_filter( ‘woocommerce_quantity’, ‘filter_woocommerce_quantity’, 10, 2 );
到目前为止,还没有运气。我是否做错了什么明显的事情,还是这是一个更加复杂的问题?