WPIntell

Source evidence

Use a plugin function in functions.php

Maximum Quantity for WooCommerce Shops · support · 2024-07-19T00:21:00+00:00

neutralsentiment
highseverity
0.63relevance
4replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
geokongr resolved
Hello, 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 🙂

Comments

4 shown
Marco Almeida | Webdados 2024-07-19T11:02:00+00:00

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.

geokongr 2024-07-22T23:28:00+00:00

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 .

Marco Almeida | Webdados 2024-07-23T09:00:00+00:00

You should not need (or do it) to include the plugin file in functions.php

geokongr 2024-07-23T11:55:00+00:00

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 🙂