Jsonapi for save basket empty problem

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!
skydev
Posts: 18
Joined: 01 Jul 2021, 10:24

Jsonapi for save basket empty problem

Post by skydev » 05 Jan 2023, 06:33

We need help with JSON API.
In JSON API basket save always gives a "Basket is empty" response.
is this any solution for API calls?
We have used csrf token as well. It works when we call in a saved basket from the postman.

As we check below basket check function not working or it might become an empty basket before saving the basket and after adding to the cart.

Code: Select all

$this->controller->setType( $view->param( 'id', 'default' ) );
$this->controller->get()->check();
$this->clearCache();

$item = $this->controller->store();
$this->context()->session()->set( 'aimeos/order.baseid', $item->getId() );

$view->item = $item;
$status = 200;
Composer code for version which we use currently.

Code: Select all

"aimeos/aimeos-laravel": "~2022.07",
"guzzlehttp/guzzle": "^7.2",
"laravel/breeze": "^1.9",
"laravel/framework": "^9.2",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7"
Thanks in Advance!

User avatar
aimeos
Administrator
Posts: 7915
Joined: 01 Jan 1970, 00:00

Re: Jsonapi for save basket empty problem

Post by aimeos » 05 Jan 2023, 08:10

Can you please update to 2022.10 LTS as 2022.07 isn't supported any more.

Do you use file based or database based Laravel sessions?
Do you have example code to reproduce the issue?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply