我想按价格范围购买产品。例如,列出价格在0到1000之间的所有产品(它会有所不同)。
我的代码是
[post_type] => product
[orderby] => ID
[post_status] => publish
[posts_per_page] => 18
[offset] => 0
[meta_query] => Array
(
[relation] => AND
[0] => Array
(
[key] => wpcf-price
[value] => Array
(
[0] => 0
[1] => 1000
)
[type] => NUMERICAL
[compare] => BETWEEN
)
)
此代码无法正常工作。我该如何解决此问题?
答案 0 :(得分:2)
将[type] => NUMERICAL
更改为NUMERIC