Local Pickup: set prefersCollection to false if we don't have shipping.
This commit is contained in:
parent
d9fbaa5ec3
commit
963c8dcebe
|
@ -77,6 +77,9 @@ export const isCalculating = ( state: CheckoutState ) => {
|
||||||
export const prefersCollection = ( state: CheckoutState ) => {
|
export const prefersCollection = ( state: CheckoutState ) => {
|
||||||
if ( state.prefersCollection === undefined ) {
|
if ( state.prefersCollection === undefined ) {
|
||||||
const shippingRates = select( cartStoreKey ).getShippingRates();
|
const shippingRates = select( cartStoreKey ).getShippingRates();
|
||||||
|
if ( ! shippingRates || ! shippingRates.length ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const selectedRate = shippingRates[ 0 ].shipping_rates.find(
|
const selectedRate = shippingRates[ 0 ].shipping_rates.find(
|
||||||
( rate ) => rate.selected
|
( rate ) => rate.selected
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue