PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Modules/Shipping/ShippingModule.php +9 -0 1.4.1 → 1.6.5 View file →
@@ -89,8 +89,16 @@
89 89 {
90 90 $shippingCountry = Arr::get($fillData, 'checkout_data.form_data.shipping_country', null);
91 91 $shippingState = Arr::get($fillData, 'checkout_data.form_data.shipping_state', null);
92 92
93 + // Checkout renderer resolves shipping methods with a billing fallback when no
94 + // shipping address is set (ship-to-different unchecked). Resolve the same way
95 + // here, otherwise this chain zeroes the method/charges the renderer just offered.
96 + if (!$shippingCountry) {
97 + $shippingCountry = Arr::get($fillData, 'checkout_data.form_data.billing_country', null);
98 + $shippingState = Arr::get($fillData, 'checkout_data.form_data.billing_state', null);
99 + }
100 +
93 101 $availableShippingMethods = AddressHelper::getShippingMethods($shippingCountry, $shippingState);
94 102
95 103 if (!$availableShippingMethods || is_wp_error($availableShippingMethods)) {
96 104 Arr::set($fillData, 'checkout_data.shipping_data.shipping_charge', 0);
@@ -100,8 +108,9 @@
100 108 foreach ($cartData as &$cartItem) {
101 109 $cartItem['shipping_charge'] = 0;
102 110 $cartItem['itemwise_shipping_charge'] = 0;
103 111 }
112 + unset($cartItem);
104 113
105 114 Arr::set($fillData, 'cart_data', $cartData);
106 115
107 116 return $fillData;