Order Properties Should Not Be Accessed Directly - Woocommerce 3.0

Order properties should not be accessed directly - WooCommerce 3.0

it says "id was called incorrectly. Order properties should not be accessed directly."

Try $order->get_id()

WooCommerce error: Coupon properties should not be accessed directly

Since WooCommerce 3, you need to use the WC_coupon method get_code() instead of trying to access the coupon "code" property directly, so you will have to replace in your code:

            <!-- Print the Coupon Code -->
<td><?php echo $coupon->code; ?></td>

simply by

            <!-- Print the Coupon Code -->
<td><?php echo $coupon->get_code(); ?></td>

This will solve this issue.


You can use woocommerce_get_order_item_totals filter hook, instead of overriding order-details.php template, to add some custom lines to order total displayed lines.

See those examples using woocommerce_get_order_item_totals filter hook.

woocommerce notice product_type was called incorrectly . Product properties should not be accessed directly

The product_type property is deprecated. Use get_type() to get internal type.

So you need to change this:

$product->product_type;

to this:

$product->get_type();

Woocommerce - internal server error: Notice: id was called incorrectly

It’s because of Woocommerce deprecated some methods in the new version, but your existing code in plugins or theme are using the old methods to get the cart data that’s why you are receiving this notice.

Best way to ignore this type of notices is to check all the plugins and theme with the new version of the WooCommerce before making live.

I hope this finds you well with your concern.



Related Topics



Leave a reply



Submit