Conversation
supportHello, With the new version i can no longer use the function “isa_wc_get_product_max_limit” now called “wc_get_product_max_limit” in my child theme’s functions.php file. This was very handy in the previous version where i could override the “woocommerce_quantity_input” function. Now site returns the error “PHP Fatal error: Uncaught Error: Call to undefined function wc_get_product_max_limit()” Can this be fixed?
Hi, We now have namespacing on the plugin, and we weren’t expecting people would be using the plugin internal functions directly, so we’re sorry for this. You need to call \PTWooPlugins\MaxQuantityWC\wc_get_product_max_limit( $product_id ) Let me know if this fixes it for you.
Thank you for your help! I used that and also included plugin file in the functions.php before the call: require_once WP_PLUGIN_DIR . ‘/woocommerce-max-quantity/woocommerce-max-quantity.php’; I tested it and it is working again! This reply was modified 1 year, 10 months ago by geokongr .
You should not need (or do it) to include the plugin file in functions.php
Thank you for that, i was getting the same error without the file inclusion but i didn’t notice that the plugin was inactive. I activated it and no file inclusion in the end 🙂
Hi, We now have namespacing on the plugin, and we weren’t expecting people would be using the plugin internal functions directly, so we’re sorry for this. You need to call \PTWooPlugins\MaxQuantityWC\wc_get_product_max_limit( $product_id ) Let me know if this fixes it for you.
Thank you for your help! I used that and also included plugin file in the functions.php before the call: require_once WP_PLUGIN_DIR . ‘/woocommerce-max-quantity/woocommerce-max-quantity.php’; I tested it and it is working again! This reply was modified 1 year, 10 months ago by geokongr .
You should not need (or do it) to include the plugin file in functions.php
Thank you for that, i was getting the same error without the file inclusion but i didn’t notice that the plugin was inactive. I activated it and no file inclusion in the end 🙂