ich es geschafft, die Produkte ohne SALE zum Ausfiltern mit dem folgenden Code direkt über den, wenn platziert (have_posts()):
$ args = array (
'post_type' => 'product',
'meta_query' => 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'
)
)
);
query_posts ($ args);
Der Code wird in eine Kopie von archive-product.php gelegt, die ich archive-product_withoutale.php umbenannte und als Seitenvorlage erstellte.
Möchten Sie die Schaltfläche "In den Warenkorb" entfernen und nur Produktdaten anzeigen? –
Ich möchte alle Produkte anzeigen, aber ich möchte kein Produkt anzeigen, das zum Verkauf steht. – Manish