Answer the question
In order to leave comments, you need to log in
Woocommerce - how to make it so that the user can only order a product once?
Greetings! Please tell me how to make it so that one user (registered on the site) can order a specific product only once. Thanks
Answer the question
In order to leave comments, you need to log in
Hello!
When adding a product, check the "Sell individually" box in the "Inventory" tab
https://screenshots.firefox.com/Cdiu2tnpOOLbGUM9/t...
Maybe someone will need this:
/*человек добавляет в корзину товар А. Ходит по сайту и через какое-то время добавляет товар Б. При этом товар А должен автоматически быть удален из корзины.*/
add_filter( 'woocommerce_add_cart_item_data', 'my_empty_cart_before_add', 10, 3);
function my_empty_cart_before_add( $cart_item_data, $product_id, $variation_id )
{
global $woocommerce;
$woocommerce->cart->empty_cart();
return $cart_item_data;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question