Add multiple item to cart

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Aswathy.S
Posts: 4
Joined: 24 Mar 2017, 13:48

Add multiple item to cart

Post by Aswathy.S » 27 Mar 2017, 08:33

I need to move all the items in wishlist to cart in one click.How can it is possible?

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

Re: Add multiple item to cart

Post by aimeos » 27 Mar 2017, 16:38

You can extend the account/favorite template and add a HTML form element around the items. For each item, you can add the same code as there:
https://github.com/aimeos/ai-client-htm ... t.php#L233
The "0" in "array( 'b_prod', 0, 'prodid' )" is an index you have to increase for every product.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Aswathy.S
Posts: 4
Joined: 24 Mar 2017, 13:48

Re: Add multiple item to cart

Post by Aswathy.S » 28 Mar 2017, 05:08

array( 'b_prod', 0, 'prodid' ) is take the value for 1 item.I have to pass multiple item in one array .Please check my screenshot
Attachments
screenshot.png
screenshot.png (69.2 KiB) Viewed 2835 times

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

Re: Add multiple item to cart

Post by aimeos » 28 Mar 2017, 20:20

For each product item in the template you have to add

Code: Select all

<input type="hidden" value="<?php echo $id; ?>" name="<?php echo $enc->attr( $this->formparam( array( 'b_prod', X, 'prodid' ) ) ); ?>" />
where "X" is a incremented number, so
1. item: array( 'b_prod', 0, 'prodid' )
2. item: array( 'b_prod', 1, 'prodid' )
3. item: array( 'b_prod', 2, 'prodid' )
and so on.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply