Get product details with basket
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Get product details with basket
Is it possible to get additional product information (product,attribute,media) from get request to jsonapi/basket and from post request for adding product to basket? I tried to use "include=product" param but with no luck. I inspected templates/client/jsonapi/basket/standard.php file and found next block:
getProductItem method returns null in my scenarios.
Laravel 9.43
"aimeos/aimeos-laravel": "2022.10.4",
"aimeos/ai-client-jsonapi": "2022.10.2",
"aimeos/aimeos-core": "2022.10.7"
Code: Select all
if( $product = $orderProduct->getProductItem() )
{
$entry['relationships']['product']['data'][] = ['type' => 'product', 'id' => $product->getId()];
$result = array_merge( $result, $this->jincluded( $product, $fields ) );
}
Laravel 9.43
"aimeos/aimeos-laravel": "2022.10.4",
"aimeos/ai-client-jsonapi": "2022.10.2",
"aimeos/aimeos-core": "2022.10.7"
Re: Get product details with basket
Unfortunately, the basket endpoint manages a serialized representation of the (future) order and doesn't store any related items (and doesn't fetch them too). Only if the basket is stored and becomes an order, you are able to retrieve the original product of each order product item along with other related items to the product.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star