Error in property
-
Hi,
I have a code over 2 years now to restrict COD payments for orders that the cart total is above 200€. The code working very good but the last days I see a bug in my debug page that says “Notice: Trying to get property ‘total’ of non-object”
Is there any change to woocommerce code files and now I must edit my code too?
I’m searching but I can’t find something.I’m appriciate it if your can help to find what’s going wrong all of a sudden.
My code is:
function xr_limit_cod_gateway( $available_gateways ) { global $woocommerce; $cart_total = $woocommerce->cart->total; if ( isset( $available_gateways['cod'] ) && $cart_total > 200) { unset( $available_gateways['cod'] ); } return $available_gateways; } add_filter( 'woocommerce_available_payment_gateways', 'xr_limit_cod_gateway' );
Thank you
Xrisa
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Error in property’ is closed to new replies.