@@ -56,9 +56,14 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b
56
56
{
57
57
$ customerAddressId = $ billingAddressInput ['customer_address_id ' ] ?? null ;
58
58
$ addressInput = $ billingAddressInput ['address ' ] ?? null ;
59
- $ sameAsshipping = isset ($ billingAddressInput ['same_as_shipping ' ])
59
+ $ sameAsShipping = isset ($ billingAddressInput ['same_as_shipping ' ])
60
60
? (bool )$ billingAddressInput ['same_as_shipping ' ] : false ;
61
61
62
+ if (!isset ($ billingAddressInput ['same_as_shipping ' ])) {
63
+ $ sameAsShipping = isset ($ billingAddressInput ['use_for_shipping ' ])
64
+ ? (bool )$ billingAddressInput ['use_for_shipping ' ] : false ;
65
+ }
66
+
62
67
if (null === $ customerAddressId && null === $ addressInput ) {
63
68
throw new GraphQlInputException (
64
69
__ ('The billing address must contain either "customer_address_id" or "address". ' )
@@ -72,15 +77,15 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b
72
77
}
73
78
74
79
$ addresses = $ cart ->getAllShippingAddresses ();
75
- if ($ sameAsshipping && count ($ addresses ) > 1 ) {
80
+ if ($ sameAsShipping && count ($ addresses ) > 1 ) {
76
81
throw new GraphQlInputException (
77
82
__ ('Using the "same_as_shipping" option with multishipping is not possible. ' )
78
83
);
79
84
}
80
85
81
86
$ billingAddress = $ this ->createBillingAddress ($ context , $ customerAddressId , $ addressInput );
82
87
83
- $ this ->assignBillingAddressToCart ->execute ($ cart , $ billingAddress , $ sameAsshipping );
88
+ $ this ->assignBillingAddressToCart ->execute ($ cart , $ billingAddress , $ sameAsShipping );
84
89
}
85
90
86
91
/**
0 commit comments