Page 1 of 1

Add multiple item to cart

Posted: 27 Mar 2017, 08:33
by Aswathy.S
I need to move all the items in wishlist to cart in one click.How can it is possible?

Re: Add multiple item to cart

Posted: 27 Mar 2017, 16:38
by aimeos
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.

Re: Add multiple item to cart

Posted: 28 Mar 2017, 05:08
by Aswathy.S
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

Re: Add multiple item to cart

Posted: 28 Mar 2017, 20:20
by aimeos
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.