Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_api_request function for MWP Hubspot Integration (and others) plugin(s) #361

Open
gvelasquez85 opened this issue Dec 11, 2022 · 0 comments

Comments

@gvelasquez85
Copy link

gvelasquez85 commented Dec 11, 2022

Hello Everybody! I was looking for a real CRM plugin or solution to use with ClassicPress and ended up finding one of the best plugins (for many specialized WP websites) to integrate Classic Commerce with a real CRM like Hubspot (https://wordpress.org/plugins/makewebbetter-hubspot-for-woocommerce/) is the "MWB hubspot for woocommerce" however, when you active this plugin your site will get a "Error 500" because there is a method missing on the WooCommerce (ClassicCommerce) class "Fatal error: Uncaught Error: Call to undefined method WooCommerce::is_rest_api_request()".

This is a known issue and worked around by the developer on this link https://wordpress.org/support/topic/fatal-error-after-activation-woocommerceis_rest_api_request/

I've been searching high and low for any info on how to solve it and resolved to edit the WooCommerce class and add the complete method, because this method was added on further versions of WooCommerce where the fork of ClassicCommerce was born.

You can find the is_api_request method here:
https://github.com/woocommerce/woocommerce/blob/9347c728e9cb0bcfde201cd708a34b2d0715326f/includes/class-woocommerce.php#L301-L319

I know is not ok to edit the source-code of the plugin, because it will be dropped on the next update, however I was looking for a permanent fix to this issue and to share the knowledge with the community, because I've just added the method and everything is working (for now... :|)...

Any thoughts on how to do this or where to put this fix?

Best Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant