早上!这应该很简单,我正在尝试按“区域”过滤产品,但我的args似乎对通过此查询生成的woocommerce产品列表没有任何影响?非常感谢您的帮助。
$args = array(
    'type' => 'product',
    'meta_query' => array(
        '_stock_status' => 'instock',
        'Region' => 'Mexico'
    )
);
foreach ( wc_get_products( array( $args, 'limit' => -1 ) ) as $product ) {
    foreach ( $product->get_attributes() as $attr_name => $attr ) {}}发布于 2019-12-24 18:17:13
可能您需要将R更改为r
 'Region' => 'Mexico' change to   'region' => 'Mexico'https://stackoverflow.com/questions/59464907
复制相似问题