function max_quantity_single( $max, $product ) {
$stock = get_post_meta( get_the_ID(), '_stock', true );
$max = $stock;
return $max;
}
add_filter( 'woocommerce_quantity_input_max','max_quantity_single', 10, 2 );
Add this hook in your functions.php or plugin file.
Related Posts:
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- how to get woocommerce product attribute slug
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Create WooCommerce custom stock option that is non-purchasable
- WooCommerce – Flat rate shipping based on X quantity steps?
- Where can I find a single item template
- Get Woocommerce Subscription Product
- Change “Shipping” text to “Delivery” everywhere I appears in woocommerce
- Customize WooCommerce orders displayed shipping
- WooCommerce pages accessible to logged in members only
- Woocomerce language
- paypal not showing on woocommerce payments
- Target WooCommerce Product Gallery Image (rather than Featured Image) for og:image
- How to update the WooCommerce cart Icon to show new products added with JavaScript
- Remove the link from the thumbnail and product title on woocommerce
- How to configure Woocommerce Payment Methods programmatically?
- woocommerce_package_rates not fired everytime
- how to change woocommerce shop archive description? [closed]
- How to display the result of a custom metabox in the frontend [closed]
- Remove add to cart icon/view product button woocommerce
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Subscription on Checkout
- Woocommerce – display product in page but in list format with excerpt
- how to show store name when I add a product on cart in woocommerce(woocommerce multi store)?
- When Free shipping is available hide other shipping methods except Local pickup in WooCommerce [closed]
- Create archive page for woocommerce attribute
- How to increase execution time out limit in WordPress dashboard?
- Setting an attribute as variation in woo commerce via php [duplicate]
- How to change product thumbnail size in storefront theme
- Override static method in WC_Shortcodes class (shortcode) [closed]
- Show add to cart button and quantity field when no price is entered [closed]
- Search in 1) Post, 2) Products (woocommerce) and 3) Custom post type or Taxonomy type on a single page
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- display product’s category static slider name and image in loop wordpress
- Whitespace between product image and gallery on initial load of lightbox product page
- Why is my WordPress login credentials missing, but work with WooCommerce?
- Update Customer JWT Woocommerce
- Is there a hook in woocommerce for when a payment fails to display a custom error message?
- How to reverse/swap the order of “Sales price” and “Regular prcie” in woocommerce?
- Woocommerce Canceled Order Notification email to admin
- separate functions for home VS other pages
- WooCommerce apply shipping rates based on price
- Extra items added to cart on refresh, woocommerce
- Woocommerce before and after shop loop not works
- WooCommerce Admin order – Only run action if user is loaded
- Creating child theme out of Coeur
- Hide sidebar and change layout Blog Page using is_page() function
- Change Out of Stock Error Message in WooCommerce Cart
- Woocommerce purchase date [closed]
- How to add a special Woocommerce “buy now” button?
- Woocommerce: Any way to list all products *without* a specific attribute?
- I want a simple dropdown for locations in woocommerce
- Getting hundreds of spam orders in WooCommerce with failed stripe payment [closed]
- How to fetch woocommerce highest price and lowest price in custom template page?
- Filter by Price filter button not working
- WooCommerce pagination: remove ‘page’ from url
- Coupon for product / woocommerce
- How can I show “sold out” instead of “out of stock” for some products with particular tags and categories [closed]
- How Can I fix Woocommerce Billing Address Field? [closed]
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Urgent Validate Save-Post Hooks on Woo-commerce product entry form!
- Is doing a database query in Woocommerce efficient to only display posts from a certain category?
- Call product search from custom hook
- MySQL error or data corruption after database migration
- My products are showing “not in stock” and I don’t know why
- Woocommerce change the price of products in the database
- Select all products that have a custom field ‘is_new’ set to ‘Yes’
- Woocommerce – Shop can’t find products after domain name change
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- WooCommerce product details page category display
- Woocommerce – Default product image by user role
- WooCommerce product id as permalink
- login or register then access woocommerce website
- Move woocommerce shop page image to left
- WooCommerce Tax Filter Not Working
- WooCommerce does not translate every string
- Woocommerce add a text field if specific option is selected
- Add suffix to price html does not work
- Get user active posts randomly
- Woocommerce Product category base same as product base causes 404
- Categories and products in cart Woocommerce
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- How Fragile Is DB if I Upload Completely Updated Files
- Broken 302 redirection for product subcategory (Woocommerce, Apache)
- How to allow registration only from a certain location?
- Add confirmation popup on place order button
- Custom CSS Not working on Product page
- Change WooCommerce Checkout Button – Reverts to normal
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Send form data to functions.php
- How to remove content from hacked pages? [closed]
- Disable WooCommerce Address State Dropdown
- Create custom add to cart in WordPress
- Fetch products with filter by similar categories at same time
- Trying query woocommerce product order by menu order and stock status
- editing product page template – getting template for related products not working
- Woocommerce | I want to the button ‘Add to Cart’ on the (all) product-page changed by just ‘open product’ button
- Adding line breaks in WooCommerce order processing emails
- Add second price option based on payment method at cart item price
- Woocommerce backend sorting product drag drop by menu_order to date