-
sotomedia
GP shows the increment buttons even if the qty field is set to hidden type.
I believe this started in a recent version. -
Fernando
Hi there,
Can you check if “Display Quantity buttons” is enabled in Appearance > Customize > Layout > WooCommerce? Reference: https://docs.generatepress.com/article/woocommerce-overview/#single-product
If it is, disable it.
-
sotomedia
Yes.
But that’s not the point.
When the qty field is visible(number type), the increment buttons should be visible.
When the qty field is invisible(hidden type), the increment buttons should be invisible.
That’s what it is.
The type of qty field is managed by Woo, GP should follow that. -
Fernando
I see. GP follows that. If you set the Product to “Sold individually”. The Quantity buttons should go away.
Are you using any third-party WooCommerce add-on plugin? Can you try disabling those to test?
Or are you using a third-party plugin to set products to “Sold individually”?
If you have any caching/optimization plugins, try disabling those as well.
If I’m missing something, let me know.
-
sotomedia
I’m using my own code via woocommerce_quantity_input_max hook to control max qty.
Because some of products shouldn’t be added more than 1 to the cart.If I turn off this code, off course no problem.
Both the qty field and the increment buttons are visible. -
Fernando
That should work too if you return
1
as the value. The quantity buttons should disappear.What exact code are you using?
-
sotomedia
The code has been working for years. should be no bug.
It returns 1.function mywc_quantity_input_max($max,$product){ $pid = $product->get_id(); $max = 1; if($pid == 49 || $pid == 50) { $max = 2; } elseif($pid == 88){ $max = 10; } return $max; } add_filter('woocommerce_quantity_input_max','mywc_quantity_input_max',10,2);
-
Fernando
It’s working for me with no issues.
Can you try #1 here to debug: https://docs.generatepress.com/article/debugging-tips/
It’s recommended to backup your site before proceeding with this.
- You must be logged in to reply to this topic.