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/Hooks/Cart/WebCheckoutHandler.php +7 -1 1.5.3 → 1.6.5 View file →
@@ -1038,9 +1038,9 @@
1038 1038 return new \WP_Error('no_cart', __('No active cart found', 'fluent-cart'));
1039 1039 }
1040 1040
1041 1041 $checkoutData = $cart->checkout_data;
1042 - if (!empty($checkoutData['upgrade_data']) || !empty($checkoutData['is_locked'])) {
1042 + if (!$cart->acceptsAdditionalItems()) {
1043 1043 return new \WP_Error('invalid_request', __('This cart is locked or already has an upgrade applied.', 'fluent-cart'));
1044 1044 }
1045 1045
1046 1046 $upgradeFromVariationId = (int) Arr::get($requestData, 'upgrade_form', 0);
@@ -1053,8 +1053,14 @@
1053 1053 'bump_id' => $bumpId,
1054 1054 'cart' => $cart,
1055 1055 'request_data' => $requestData
1056 1056 ]);
1057 + }
1058 +
1059 + // A locked cart may still take bumps through the accepts_additional_items
1060 + // filter, but must never let an item it pinned be swapped out.
1061 + if (Arr::get($checkoutData, 'is_locked') === 'yes') {
1062 + return new \WP_Error('invalid_request', __('This cart is locked and cannot be modified.', 'fluent-cart'));
1057 1063 }
1058 1064
1059 1065 if (!$upgradeFromVariationId || !$targetVariationId) {
1060 1066 return new \WP_Error('invalid_request', __('Invalid upgrade request.', 'fluent-cart'));