セール中のすべての商品がそこに表示されるページを作成することは可能ですか?
このコードを試してみましたが、すべての製品にセールがあるかどうかがわかります
$args = array(
'post_type'=>'product',
'order' => 'ASC',
'showposts' =>$pageSize,
'paged' => $paged,
'meta_query' => array(
array(
'key' => '_stock_status',
'value' => 'instock',
'compare' => '='
),
array(
'relation' => 'OR',
array(// Simple products type
'key' => '_sale_price',
'value' => 0,
'compare' => '>',
'type' => 'numeric'
),
array(// Variable products type
'key' => '_min_variation_sale_price',
'value' => 0,
'compare' => '>',
'type' => 'numeric'
)
)
)
);
------------------------
デフォルトでは、woo-commerce には以下のショートコードを使用するためのオプションがあります:-
[products limit="4" columns="4" orderby="popularity" class="quick-sale" on_sale="true" ]
共有
この回答を改善します
フォローする編集
2020 年 9 月 3 日 12:32
2020 年 9 月 3 日 11:00 に回答
ユーザー13875108
ユーザー13875108
0