$cartErrors =
new ErrorCollection();
if ($blockShippingMethod) { $cartErrors->
add( new ShippingMethodBlockedError( 'original-shipping-method-name'
) );
} if ($blockPaymentMethod) { $cartErrors->
add( new PaymentMethodBlockedError( 'original-payment-method-name',
''
) );
} return $cartErrors;
} /**
* @param callable(ErrorCollection, SalesChannelContext): ShippingMethodEntity|null $shippingSwitcherCallbackMethod
* @param callable(ErrorCollection, SalesChannelContext): PaymentMethodEntity|null $paymentSwitcherCallbackMethod
*/