Hi,
I’ve been trying to solve this since MAY 30, I have some ideas about why variable product’s shipping shows “0” but you guys stopped responding on that topic. My php version is 7.1.6 and here is my log
[20-Jun-2017 14:41:37 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 346
[20-Jun-2017 14:41:37 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 377
[20-Jun-2017 14:41:37 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 378
[20-Jun-2017 14:41:40 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 346
[20-Jun-2017 14:41:40 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 377
[20-Jun-2017 14:41:40 UTC] PHP Warning: A non-numeric value encountered in /wp-content/plugins/wc-vendors-pro/admin/class-wcvendors-pro-shipping.php on line 378
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7147 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7146 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7147 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7121 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7120 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7146 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7120 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7158 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7146 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:42:32 UTC] PHP Notice: Undefined offset: 7121 in /wp-content/plugins/wc-vendors-pro/templates/dashboard/order/order_details.php on line 126
[20-Jun-2017 14:40:34 UTC] The The "add_to_cart_fragments" hook uses out of date data structures and
function is deprecated since version 3.0.8. Replace with woocommerce_add_to_cart_fragments.
Here is the solution I have found but I am not sure that is the case, maybe you can test it.
It seems that in PHP 7.1, a Warning will be emitted if a non-numeric value is encountered. See this link.
Here is the relevant portion that pertains to the Warning notice you are getting:
New E_WARNING and E_NOTICE errors have been introduced when invalid strings are coerced using operators expecting numbers or their assignment equivalents. An E_NOTICE is emitted when the string begins with a numeric value but contains trailing non-numeric characters, and an E_WARNING is emitted when the string does not contain a numeric value.
I'm guessing either $item['quantity'] or $product['price'] does not contain a numeric value, so make sure that they do before trying to multiply them. Maybe use some sort of conditional before calculating the $sub_total, like so:
<?php
if (is_numeric($item['quantity']) && is_numeric($product['price'])) {
$sub_total += ($item['quantity'] * $product['price']);
} else {
// do some error handling...
}