title | issue |
---|---|
Restoring Cart after customer logged in |
NEXT-10527 |
- Added
sales_channel_id
nullable column insales_channel_api_context
table. - Added
customer_id
nullable column insales_channel_api_context
table. - Added unique constraint to a pair (
sales_channel_id
andcustomer_id
) insales_channel_api_context
table. - Added new
Shopware\Core\Checkout\Cart\Event\CartMergedEvent
is fired after the guest's cart is merged with the customer's cart. - Added new
Shopware\Core\System\SalesChannel\Event\SalesChannelContextRestoredEvent
is fired after a sales channel context is restored. - Added new
Shopware\Core\System\SalesChannel\Context\SalesChannelContextRestorer
class that handles restoring a customer's sales channel context and cart after logging in. - Added two new parameters
sales_channel_id
andcustomer_id
inShopware\Core\System\SalesChannel\Context\SalesChannelContextPersister::save()
method that allow save a customer's context. - Added two new parameters
sales_channel_id
andcustomer_id
inShopware\Core\System\SalesChannel\Context\SalesChannelContextPersister::load()
method that allow load a customer's context using a customer_id. - Changed
Core/Checkout/Customer/SalesChannel/LogoutRoute::logout()
method that returnsContextTokenResponse
instead ofNoContentResponse
. - Changed
Core/Checkout/Customer/SalesChannel/LogoutRoute::logout()
method that allows areqplace-token
request parameter that allow to replace context's token after logging out. - Changed
Core/Checkout/Customer/SalesChannel/ChangePasswordRoute::change()
method that returnContextTokenResponse
instead ofSuccessResponse
.
- Added Cart merged hints in session flash bag after the customer's shopping cart is merged with the last visited
- Each customer now has a unique sales channel context, which means it will be shared across devices and browsers, including its cart.
- Which this change, when working with
SalesChannelContextPersister
, you should pass a 3rd parametersales_channel_id
and 4th parametercustomer_id
inSalesChannelContextPersister::save()
to save customer's customer's context.