Place additional articles in the cart on the cart page
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!
Place additional articles in the cart on the cart page
Hello,
I am looking for a way so that the customer may add additional articles into the cart, when he is already on the cart page.
Example:
If he has a Tennis racket in his cart, then I would like him to buy Tennis balls, too. Therefore, I would like to display the Tennis balls as an additional article and add an input field for the number of Tennis balls which he wants to buy.
(Tennis balls are suggested products for a Tennis racket.)
Technically, this would be a mix of different types of input parameters:
Cart articles: ai[b_prod][0][quantity] and ai[b_prod][0][position]
Other artices: ai[b_prod][2][quantity] and ai[b_prod][2][prodid]
Can aimeos handle this if I ensure that the numbers are unique? How can I achieve this?
Claudia
I am looking for a way so that the customer may add additional articles into the cart, when he is already on the cart page.
Example:
If he has a Tennis racket in his cart, then I would like him to buy Tennis balls, too. Therefore, I would like to display the Tennis balls as an additional article and add an input field for the number of Tennis balls which he wants to buy.
(Tennis balls are suggested products for a Tennis racket.)
Technically, this would be a mix of different types of input parameters:
Cart articles: ai[b_prod][0][quantity] and ai[b_prod][0][position]
Other artices: ai[b_prod][2][quantity] and ai[b_prod][2][prodid]
Can aimeos handle this if I ensure that the numbers are unique? How can I achieve this?
Claudia
Re: Place additional articles in the cart on the cart page
Aimeos implements the "Basket related" component that already suggests products that have been bought together with the products in the basket - provided, you execute the job controller that calculates the products bought together:
https://github.com/aimeos/ai-client-htm ... andard.php
You can copy and adapt the code to display "suggested" products too. We would love to get a pull request for that
https://github.com/aimeos/ai-client-htm ... andard.php
You can copy and adapt the code to display "suggested" products too. We would love to get a pull request for that
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: Place additional articles in the cart on the cart page
I checked this, but unfortunately it is not enough to just display the related (or suggested) products with a link to their details page. I need a way so that the user can order these items directly on the cart page.
I had a look at the plugin "basket bulk order", too. This has an input form. But if I put a (default) article number in the form, the price is not filled (JSON page is configured for this plugin). When I click on the "Add to cart" button, then I get an error response: Item with ID "" in "product.id" not found
Adding the product number of a selectable product doesn't work either. (Obviously)
I had a look at the plugin "basket bulk order", too. This has an input form. But if I put a (default) article number in the form, the price is not filled (JSON page is configured for this plugin). When I click on the "Add to cart" button, then I get an error response: Item with ID "" in "product.id" not found
Adding the product number of a selectable product doesn't work either. (Obviously)
Re: Place additional articles in the cart on the cart page
The basket related component uses the products partial and this supports adding products directly to the basket if configured:
https://github.com/aimeos/ai-client-htm ... #L244-L301
Please keep in mind that you have to select one of the offered products in the drop-down of the basket bulk component. Just entering a text or a number doesn't work.
https://github.com/aimeos/ai-client-htm ... #L244-L301
Please keep in mind that you have to select one of the offered products in the drop-down of the basket bulk component. Just entering a text or a number doesn't work.
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: Place additional articles in the cart on the cart page
I don't find a dropdown in the basket bulk component. Just one input field for the article number and one input field for the quantity. I configured the cart page and the JSON page for the plugin.
I enabled the Add to Basket button on the product list. However, my products are selectable products and nothing happens when I click on this button. Nothing is added to the cart.
When I tweak the HTML of the "Add to Basket" to use the ID of a default product (with stock available) instead of the ID of the selectable product, then this results in an error:
Adding product with ID "7716" is not allowed.
I enabled the Add to Basket button on the product list. However, my products are selectable products and nothing happens when I click on this button. Nothing is added to the cart.
When I tweak the HTML of the "Add to Basket" to use the ID of a default product (with stock available) instead of the ID of the selectable product, then this results in an error:
Adding product with ID "7716" is not allowed.
Re: Place additional articles in the cart on the cart page
I was able to solve this by adding the necessary attrvarid hidden fields.
Re: Place additional articles in the cart on the cart page
Make sure, you have no JS error in the browser console.
For selection products, drop-downs for selecting the variant attributes should show up.
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: Place additional articles in the cart on the cart page
No JS errors in the console. I think that a lookup with the product number should be done, but actually, this request is not started.
And no dropdowns appear for the selectable products, either. I disabled my own products-standard.php for the test.
And no dropdowns appear for the selectable products, either. I disabled my own products-standard.php for the test.
Re: Place additional articles in the cart on the cart page
Do you use your own or an old version of the aimeos.js file without the necessary code for the basket bulk component?
Seen, that the "basket-add" option is not passed to the products partial in the basket/related/bought-body-standard.php by default, so you have to add it in your own template. Please also ensure that you also adapt the domain configuration and include the "product" and "attribute" domain so the data for the drop-downs is available:
https://aimeos.org/docs/Configuration/C ... rd/domains
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: Place additional articles in the cart on the cart page
Thank you, I will check to use the latest js file and will provide the additional parameter.