Add articles to cart by GET request
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Add articles to cart by GET request
Hello,
when an article is already in the cart, then I can e.g. update the quantity or deleting the article by starting a GET request.
When I check in the reference:
https://aimeos.org/docs/Developers/Html ... mes#Basket
it should be possible to provide b_attrvarid as a parameter, too.
But how do I provide the parameter containing the key for this?
I want to provide the params to the url function
https://aimeos.org/docs/Developers/Html ... helper#url
Like this:
When I check the resulting URL, this contains a syntax error, though:
https://.../cart?ai[action]=index&ai[b_action]=add&ai[p_prodid]=1189&ai[b_attrvarid[size]=1032&ai[controller]=Basket
The closing ] is missing for the b_attrvarid .
How can I use the b_attrvarid properly?
Claudia
when an article is already in the cart, then I can e.g. update the quantity or deleting the article by starting a GET request.
When I check in the reference:
https://aimeos.org/docs/Developers/Html ... mes#Basket
it should be possible to provide b_attrvarid as a parameter, too.
But how do I provide the parameter containing the key for this?
I want to provide the params to the url function
https://aimeos.org/docs/Developers/Html ... helper#url
Like this:
Code: Select all
$params = array(
'b_action' => 'add',
'b_prodid' => 1189,
'b_attrvarid[size]' => 1032
);
https://.../cart?ai[action]=index&ai[b_action]=add&ai[p_prodid]=1189&ai[b_attrvarid[size]=1032&ai[controller]=Basket
The closing ] is missing for the b_attrvarid .
How can I use the b_attrvarid properly?
Claudia
Re: Add articles to cart by GET request
This parameter is only accepted when adding a product to the basket, not when modifying one of them. Then, only the quantity can be changed.
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
Re: Add articles to cart by GET request
Yes, that's exactly what I want to do: Add a product to the basket.
Re: Add articles to cart by GET request
After giving this a bit more thought, I was able to solve my problem. You have to provide the parameters like e.g. this:
Code: Select all
$params = array(
'b_action' => 'add',
'b_prodid' => 1189,
'b_attrvarid' => array('size' => 1032, 'color' => 134)
);