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
PHP Prepared Statements and Transactions in a Loop
How to Automatically Read in Calculated Values with PHPexcel
Optimizing MySQL Fulltext Search
Automatically Cancel Order After X Days If No Payment in Woocommerce
Looping Through a Simplexml Object, or Turning the Whole Thing into an Array
File_Get_Contents(): Stream Does Not Support Seeking/When Was PHP Behavior About This Changed
How to Rename a Filename After Uploading with PHP
A Better Way to Replace Emoticons in PHP
How to Get Products from a Particular Category in Magento Ecommerce
PHP Warning: Unknown: Input Variables Exceeded 1000
Why Doesn't PHP Permit Private Const
How to Put Double Quotes Inside a String Within an Ajax JSON Response from PHP