marketing consent

This commit is contained in:
elvira
2026-09-09 14:09:59 +03:00
parent 0fb606ff3f
commit 7a8b9cf4c0
3 changed files with 109 additions and 92 deletions
@@ -164,7 +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];
$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->save();
// ShippingManifest is a request-lifetime singleton whose getOptions()