WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Custom shipping add-on shows Fatal error: Class 'WC_Shipping_Method' not found (3 posts)

  1. DanielHolm
    Member
    Posted 12 months ago #

    Hi,

    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

    http://wordpress.org/plugins/woocommerce/

  2. ronaldfuquay
    Member
    Posted 11 months ago #

    I am having the exact same situation with my site, if I find anything out I will post it here.

  3. sp4cecat
    Member
    Posted 5 months ago #

    If you haven't already tracked it down, WooCommerce has updated the shipping plugins instructions to get you to wrap a function around your shipping class, and hook it to WooCommerce init:

    http://docs.woothemes.com/document/shipping-method-api/

Reply

You must log in to post.

About this Plugin

About this Topic