generated from boboko/starter
marketing consent to recovery consent and connection with core
This commit is contained in:
@@ -164,16 +164,14 @@ public function saveAddress(string $locale, Request $request): JsonResponse
|
||||
$this->checkout->setBillingAddress($billing);
|
||||
$cart = $this->checkout->setShippingAddress($shipping);
|
||||
|
||||
$cart->meta = [
|
||||
...($cart->meta?->toArray() ?? []),
|
||||
'ship_to_billing' => $sameAsBilling,
|
||||
// Interim storage only — the proper consent record (timestamp,
|
||||
// policy version) is the back-end Task 2. This just lets the
|
||||
// checkbox round-trip on reload like every other field.
|
||||
'marketing_consent' => $request->boolean('marketing_consent'),
|
||||
];
|
||||
$cart->meta = [...($cart->meta?->toArray() ?? []), 'ship_to_billing' => $sameAsBilling];
|
||||
$cart->save();
|
||||
|
||||
// Abandoned-cart-recovery opt-in — boboko-core owns the record (bool +
|
||||
// timestamp + policy version on Cart::meta, RecoveryConsentSet event).
|
||||
// Deliberately its own scope, not merged with any future newsletter opt-in.
|
||||
$this->checkout->setRecoveryConsent($request->boolean('recovery_consent'));
|
||||
|
||||
// ShippingManifest is a request-lifetime singleton whose getOptions()
|
||||
// appends without ever clearing, and addOption() keeps the FIRST entry
|
||||
// per identifier. The setBillingAddress() recalc above ran ApplyShipping
|
||||
|
||||
Reference in New Issue
Block a user