Custom shipping add-on shows Fatal error: Class 'WC_Shipping_Method' not found
I’m creating a custom shipping add-on for WooCommerce to have the shipping price based on amount of articles in cart.
The add-on is almost done, and I’ve followed WooCommerce’s docs to create it, and copied some from the Flat Rate shipping class.
Now, I cant get it to work as an add-on, but if I put the code in functions.php in my theme it works.
When having it as a seperate wp-plugin the site crashes and error-log shows:
PHP Fatal error: Class ‘WC_Shipping_Method’ not found in /var/www/wp-content/plugins/class-wc-shipping-per-product/class-wc-shipping-per-product.php on line 43
Code of class-wc-shipping-per-product.php: http://pastebin.com/rrhxzaSw
- The topic ‘Custom shipping add-on shows Fatal error: Class 'WC_Shipping_Method' not found’ is closed to new replies.