• Resolved geokongr

    (@geokongr)


    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

    (@webdados)

    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

    (@geokongr)

    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 3 months ago by geokongr.
    Plugin Author Marco Almeida | Webdados

    (@webdados)

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

    Thread Starter geokongr

    (@geokongr)

    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)
  • You must be logged in to reply to this topic.