Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 0e9c4cd

Browse files
Tarun Vijwanitarhi-saad
authored andcommitted
Fix the local pickup price in the shipping type selector and pickup options (#8623)
* Fix local pickup price in the shipping type selector - While calculating min and max value for local pickup, if the rate is not for local pickup, it will take already calculated lowest value instead of comparing it with the value of other shipping rate. * Add the typecasting for price and tax to fix tax calculation - We were concatenating the two strings instead of adding the integers. Add the typecasting for price and tax to fix it in local pickup. --------- Co-authored-by: Saad Tarhi <[email protected]>
1 parent 635a233 commit 0e9c4cd

File tree

2 files changed

+3
-3
lines changed
  • assets/js/blocks/checkout/inner-blocks

2 files changed

+3
-3
lines changed

assets/js/blocks/checkout/inner-blocks/checkout-pickup-options-block/block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const renderPickupLocation = (
6565
packageCount: number
6666
): RadioControlOption => {
6767
const priceWithTaxes = getSetting( 'displayCartPricesIncludingTax', false )
68-
? option.price + option.taxes
68+
? parseInt( option.price, 10 ) + parseInt( option.taxes, 10 )
6969
: option.price;
7070
const location = getPickupLocation( option );
7171
const address = getPickupAddress( option );

assets/js/blocks/checkout/inner-blocks/checkout-shipping-method-block/shared/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function getLocalPickupPrices(
8484
lowestRate: CartShippingPackageShippingRate | undefined,
8585
currentRate: CartShippingPackageShippingRate
8686
) => {
87-
if ( hasCollectableRate( currentRate.method_id ) ) {
87+
if ( ! hasCollectableRate( currentRate.method_id ) ) {
8888
return lowestRate;
8989
}
9090
if (
@@ -102,7 +102,7 @@ export function getLocalPickupPrices(
102102
highestRate: CartShippingPackageShippingRate | undefined,
103103
currentRate: CartShippingPackageShippingRate
104104
) => {
105-
if ( hasCollectableRate( currentRate.method_id ) ) {
105+
if ( ! hasCollectableRate( currentRate.method_id ) ) {
106106
return highestRate;
107107
}
108108
if (

0 commit comments

Comments
 (0)