Answer the question
In order to leave comments, you need to log in
How to change the quantity of goods to 0 when selecting a certain attribute?
Hello, I am creating a site for the sale of paintings.
The painting can be purchased in different forms. For example original or digital copy.
The task is as follows:
If the buyer selects the attribute “buy the original or buy a copy with a license” from the product and pays, then the product should disappear from the site.
If you set the attribute "Manage inventory" in the product settings, then you simply cannot select this attribute, but the product remains.
I searched on Google and found nothing but this:
foreach ( $order->get_items() as $item_id => $item ) {
$variation_id = $item->variation_id;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question