Add this as a validation in the checkout
Something like this:
add_action( 'woocommerce_after_checkout_validation', 'my_validation', 9999, 2);
function my_validation( $fields, $errors ){
if([your validation]){
return;
}else{
$errors->add( 'stock', 'your error message' );
}
}
Related Posts:
- List of JS events in the WooCommerce frontend
- Hide Add to Cart Button
- How to stop a Gutenberg Block from firing multiple GET Requests?
- “Cannot read property ‘replace’ of undefined” Javascript error when trying to add attribute terms from add product page [closed]
- Javascript / Ajax Error After Migrating To New Domain Name
- adding a script with type=”module” to woocommerce admin area
- Force uppercase on some WooCommerce checkout fields input
- Javascript error when adding an item to the cart [closed]
- Add to cart – button should be disabled
- Using the WordPress and WooCommerce REST APIs in the same Node app
- Woocommerce variable product’s total amount by javascript
- Ajax add to cart not updating Elementor mini cart totals
- Trying to run Javascript on AJAX call
- List of JS events in the WooCommerce frontend
- Woocommerce Checkout Page Total Price Inside Google Pay Script
- Running JavaScript after using WooCommerce Filter Plugin
- Deregister dequeue JS scripts except on 1 product page
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- How to make wocommerce shop products same heigt
- Format number to 2 decimal places
- currentURL is not defined
- Retrieve Woocommerce Cart Url with javascript/jquery [closed]
- How to insert link, with lightbox, that opens specific page content only
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Removing ‘woocommerce-no-js’ class from body
- How do I fix this “Uncaught ReferenceError: woodmartThemeModule is not defined”?
- WooCommerce: How to edit the get_price_html
- WooCommerce prices location in DB
- Woocommerce: How to remove page-title at the home/shop page but not category pages
- Preventing WooCommerce email sending only on particular conditions
- Is is safe to edit language files from wp-content/languages/plugins/woocommerce-ro_RO?
- Display WooCommerce only in stock sizes product attribute on shop page
- Remove “Choose An Option” on Product Variation & Auto Select Instead
- check if current url/page equals checkout page [closed]
- Mini cart in header using divi is not getting updated on changing the cart items count:
- Woocommerce Product Price Inserted programmatically doesn’t get displayed In Single Product Page
- How to Order by random on a SQL query
- Move add to cart in Woocommerce
- Separate Categories from WC Product loop when display type is set to both on the category
- Exclude products with a stock lower than the low stock threshold from the shop loop [closed]
- Remove Order List Row Link in WooCommerce Admin?
- How do I hide out of stock products from homepage but not from catalog?
- Woocommerce order processing email subject not changing
- Different translations for the same plugin inside a multisite
- wp_customize – detect post type to show/hide customizer options
- WooCommerce – Display nested list of all subcategories on archive-product.php
- Woocommerce Porto Theme Hide Selected Categroy for Breadcrumbs
- WooCommerce product archive url without value / all values
- how to get jetpack’s infinite scroll to work with woocommerce?
- WooCommerce orderby template disappears and not longer works on search page
- Woocommerce variations as a list [closed]
- Sort & Display WooCommerce Product Attributes by Order
- wp_set_object_terms being undone
- WooCommerce: One term for Many Product Attributes
- How to search variable product by its variation id in woocommerce admin product search box?
- Hide inventory message on product page based on available stock quantity
- Different Templates for Woocommerce Parent and Child Sub Categories
- Clients with empty username are not receiving request new password email
- how can i add an additional action into woocommerce admin order page through my plugin?
- Woocommerce changing add to cart button text as icon [closed]
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- Display data when category is empty
- Disable woocommerce PLACE ORDER button if user selected products that are not available for international delivery
- print script on wordpress header after user registered
- Remove sale signs from site in branded? [closed]
- Create a regular post for every WooCommerce order
- Hooks For Design variation in woo commerce single product page
- Dokan stock management
- How to hide order action button after changing order status to completed
- Access custom meta_data in processing order email
- Woocommerce : How to automatically input the same email for every order?
- Woocommerce – Change order of products in Confirmed Order
- Woocommerce – how to round up all prices to end in .99
- How do I disable “Flat Rate” radio button and remain with other shipping method in woocommerce
- How to add woocommerce product price filter widget to other page
- Remove Stripe Woocommerce Credit Card Icons (and replace with image)
- How to add external product url to woocommerce from a metadata by function.php
- Unable to call woocommerce hook in my custom php file
- Custom account page that accepts a query parameter
- Custom WooCommerce template for product
- Two types of product categories on shop page
- How to send an automatic email to a custom field in Woocommerce order meta 2 weeks after a product is bought
- Woocommerce cart table too wide [closed]
- How does one allow any customer to process any order in store on woocommerce?
- WooCommerce CSV Image URL Creates Additional Images in Media Folder
- Custom changes performed on WP + WooCom site on maintenance subdomain. How to perform a migration to a main domain?
- Allow customer to choose an optional free/paid product to add to their order (and reduce stock reduced & record sale)
- How to restrict type/size of file uploads in any plugin?
- In woocommerce some products have empty options, but how to check this
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions
- WooCommerce – Inconsistent Indexing of Orders
- Woocommerce Add to Cart function
- WooCommerce – doesn’t show product when using woocommerce.php [closed]
- How to show woocommerce login / registration form in modal
- registration_errors not working
- Translate Woocommerce tab
- Woocommerce -> gallery images per variation without a plugin? [closed]
- Why is my WordPress admin not working
- Hook for Woocommerce checkout fields