Support » Plugin: Change Quantity on Checkout for WooCommerce » Undefined Variable

  • Hi, Love this plugin!! It is super helpful for my project. Thanks a lot!

    However, i ran into the error on the checkout page (above the product title) showing:

    Notice: Undefined variable: product in /nas/content../change-quantity-on-checkout-woocommerce.php on line 55

    Notice: Undefined variable: product in /nas/content/…/change-quantity-on-checkout-woocommerce.php on line 56

    Could you help to take a look at this error?

    Cheers,
    Lo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bhavik.kiri

    (@bhavikkiri)

    Hi @ronlolo

    Can you please drop me an email on kiribhavik4 at gmail dot com? So I can provide you the solution.

    Regards,
    Bhavik

    Hello

    Facing the exact same problem.

    Could you post the solution here to help us and others that may be facing the same “undefined variable” error on lines 55 and 56?

    Thank you

    Plugin Author bhavik.kiri

    (@bhavikkiri)

    Hi @sitesme,

    You can replace the below 2 lines of code with the given code. I assume you are comfortable with editing the plugin files.

    Please open the file “change-quantity-on-checkout-woocommerce.php” file located under my plugin folder.

    Code:

    'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(), $product ),
    
    'min_value'   => apply_filters( 'woocommerce_quantity_input_min', 1, $product ),

    New Code

    'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $_product->backorders_allowed() ? '' : $_product->get_stock_quantity(), $_product ),
    
    'min_value'   => apply_filters( 'woocommerce_quantity_input_min', 1, $_product ),

    Please let me know the result.

    Note: Please take the backup of the website before doing the changes.

    Regards,
    Bhavik

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