Title: PHP Warning
Last modified: September 2, 2022

---

# PHP Warning

 *  Resolved [Chad Cloman](https://wordpress.org/support/users/chadcloman/)
 * (@chadcloman)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/php-warning-369/)
 * I receive the following PHP warning from this plugin:
 *     ```
       [01-Sep-2022 21:44:53 UTC] PHP Warning:  Undefined variable $product in <path-to-wordpress>/wp-content/plugins/change-quantity-on-checkout-for-woocommerce/change-quantity-on-checkout-woocommerce.php on line 56
       ```
   
 * Viewing the code, the warning comes from these lines:
 *     ```
       '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 ),
       ```
   
 * The error appears to be the use of `$product` (which is not defined) instead 
   of `$_product` (which is defined).
 * Hope this helps.
    -  This topic was modified 3 years, 7 months ago by [Chad Cloman](https://wordpress.org/support/users/chadcloman/).
      Reason: scroll bar overwrites code section unless there's an extra blank line
      at the end

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [bhavik.kiri](https://wordpress.org/support/users/bhavikkiri/)
 * (@bhavikkiri)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-369/#post-16151447)
 * Hi [@chadcloman](https://wordpress.org/support/users/chadcloman/)
 * I apologize for the delay in response.
 * I have updated the plugin and released the fix in version 2.1, can you please
   update and confirm whether the warning is fixed or not
 * Regards,
    Bhavik
 *  Thread Starter [Chad Cloman](https://wordpress.org/support/users/chadcloman/)
 * (@chadcloman)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-369/#post-16209611)
 * I let it run a couple weeks and it looks good. None of those messages in the 
   error log.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP Warning’ is closed to new replies.

 * ![](https://ps.w.org/change-quantity-on-checkout-for-woocommerce/assets/icon-
   256x256.png?rev=3139823)
 * [Change Quantity on Checkout for WooCommerce](https://wordpress.org/plugins/change-quantity-on-checkout-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/change-quantity-on-checkout-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/change-quantity-on-checkout-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/change-quantity-on-checkout-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/change-quantity-on-checkout-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/change-quantity-on-checkout-for-woocommerce/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 2 participants
 * Last reply from: [Chad Cloman](https://wordpress.org/support/users/chadcloman/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-369/#post-16209611)
 * Status: resolved