• Could anyone here help me, or push me in the right direction perhaps? I’m trying to create a new form for calculating shipping as it doesn’t quite do what I am hoping. I’ve extended WC_Shipping_Method and am writing a function to override ‘calculate_shipping’. My problem is that I need to access some data from the ‘cart’ class and nothing but null is ever returned. (i.e. $woocommerce->cart->get_cart_subtotal() returns null)

    I have added the line ‘global $woocommerce;’ to my function but still nothing is returned. Am I missing something else? Is it being executed before the cart is populated? Thanks to anyone for their help!

  • The topic ‘WooCommerce Plugin: Accessing cart data from Shipping Method’ is closed to new replies.