persisting basket data between different customer sessions?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kopz
Posts: 8
Joined: 18 Jan 2024, 14:11

persisting basket data between different customer sessions?

Post by kopz » 21 Feb 2024, 12:01

Hi,

Using:
- aimeos/aimeos-headless (2023.10.10)
- PHP 8.2
- Laravel v10.40.0
- using an external auth provider (Keycloak); requests from frontend include a Bearer token auth. header + csrf token

Scenario:
- authenticated user adds items to basket
- items are present in mshop_order_basket with the correct customer id and basket data
- user clears all cookies
- user login again
- jsonapi/basket is empty for the user

Any ideas on where this problem could be?

Gagik
Posts: 38
Joined: 05 Dec 2023, 06:58

Re: persisting basket data between different customer sessions?

Post by Gagik » 21 Feb 2024, 12:55

Hi

It's not a problem, it's a default behavior of this use-case. Yes, from some point of view, 'mshop_order_basket' basket is an archive of baskets.

You can change this behavior by overwriting this file.
https://github.com/aimeos/aimeos-core/b ... andard.php

Or make a different decision by rewriting it on another business logic layer after login.

kopz
Posts: 8
Joined: 18 Jan 2024, 14:11

Re: persisting basket data between different customer sessions?

Post by kopz » 21 Feb 2024, 13:13

Thanks for the fast and helpful reply.

Making an extension to extend the original order manager seems like the way to go if this is the default behavior (and the shop will only support registered users).

Post Reply