Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Woocommerce qty increment buttons problem

  • GP shows the increment buttons even if the qty field is set to hidden type.
    I believe this started in a recent version.

  • Hi there,

    Can you check if “Display Quantity buttons” is enabled in Appearance > Customize > Layout > WooCommerce? Reference:

    If it is, disable it.

  • 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.

  • 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.

  • 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.

  • That should work too if you return 1 as the value. The quantity buttons should disappear.

    What exact code are you using?

  • 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;
  • It’s working for me with no issues.

    Can you try #1 here to debug:

    It’s recommended to backup your site before proceeding with this.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.