Shipping Is Not Calculating
-
Details:
I’ve changed: Line 121 in:
wp-content/plugins/woocommerce/includes/class-wc-shipping.php
replaced:
return apply_filters( ‘woocommerce_shipping_methods’, $shipping_methods );
with:
$array = apply_filters( ‘woocommerce_shipping_methods’, $shipping_methods );
$allowed_classes = array();
foreach ( $array as $mthd) {
$allowed_classes[$mthd->id] = get_class ($mthd);
}
return $allowed_classes ;Why did I make that change:
Wherever the return value is used, it expects it to be in a (‘flat_rate’=>’Class_Name’) array format, but the previous code returns a (indexNumber=>Object)
So wherever the code uses it. it expects one format but gets another, So I add a code that tansforms the return value to what is expectedThe Questions are: Does this change break anything? is there an official fix for this issue?
- The topic ‘Shipping Is Not Calculating’ is closed to new replies.