Title: Use a plugin function in functions.php
Last modified: July 19, 2024

---

# Use a plugin function in functions.php

 *  Resolved [geokongr](https://wordpress.org/support/users/geokongr/)
 * (@geokongr)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/)
 * 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?

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

 *  Plugin Author [Marco Almeida | Webdados](https://wordpress.org/support/users/webdados/)
 * (@webdados)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/#post-17900714)
 * 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.
 *  Thread Starter [geokongr](https://wordpress.org/support/users/geokongr/)
 * (@geokongr)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/#post-17906327)
 * 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](https://wordpress.org/support/users/geokongr/).
 *  Plugin Author [Marco Almeida | Webdados](https://wordpress.org/support/users/webdados/)
 * (@webdados)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/#post-17907060)
 * You should not need (or do it) to include the plugin file in functions.php
 *  Thread Starter [geokongr](https://wordpress.org/support/users/geokongr/)
 * (@geokongr)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/#post-17907416)
 * 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 🙂

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

The topic ‘Use a plugin function in functions.php’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-max-quantity/assets/icon.svg?rev=3563132)
 * [Maximum Quantity for WooCommerce Shops](https://wordpress.org/plugins/woocommerce-max-quantity/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-max-quantity/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-max-quantity/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-max-quantity/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-max-quantity/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-max-quantity/reviews/)

## Tags

 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [plugin function](https://wordpress.org/support/topic-tag/plugin-function/)

 * 4 replies
 * 2 participants
 * Last reply from: [geokongr](https://wordpress.org/support/users/geokongr/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/use-a-plugin-function-in-functions-php/#post-17907416)
 * Status: resolved