• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Adding multiple products to the cart

Explorer ,
Aug 19, 2015 Aug 19, 2015

Copy link to clipboard

Copied

I want to give the user the choice to order one product (a bottle of wine) or a box (six bottles). So I'm looking to have two buttons: one that adds one product and one that adds 6 products.

Any idea on how to do this?

This is my code. Right now both buttons add 1 product:

                                                <button class="btn btn-greensea btn-order" name="AddToCart_Submit" onclick="AddToCart({tag_catalogueid},{tag_productid},'',4,'','',false);return false;">

                                            <em class="icon-plus"> </em>  Bestel doos </button>

                                        </div>

                                        <div class="bestel">

                                            <button class="btn btn-greensea btn-orderfles" name="AddToCart_Submit" onclick="AddToCart({tag_catalogueid},{tag_productid},'',4,'','',false);return false;">

                                            <em class="icon-plus"> </em>  Bestel fles ({{totalprice | replace: ",", "." | currency}}) </button>

Thanks.

Views

313

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 21, 2015 Aug 21, 2015

Copy link to clipboard

Copied

LATEST

I got ordering six at a time to work this way:

<div class="bestel">

                                        <div class="hide">

                                        <select id="Units_{tag_productid}" class="productTextInput" name="AddToCart_Amount">

                                            <option selected="selected" value="6"></option> 

                                        </select>

                                        </div>

                                            <button class="btn btn-greensea btn-order" name="AddToCart_Submit" onclick="AddToCart({tag_catalogueid},{tag_productid},'',4,'','',false);return false;">

                                            <em class="icon-plus"> </em>  Bestel doos (6) </button>

                                        </div>

                                        <div class="bestel">

                                            <button class="btn btn-orderfles" name="AddToCart_Submit" onclick="AddToCart({tag_catalogueid},{tag_productid},'',4,'','',false);return false;">

                                            <em class="icon-plus"> </em>  Bestel fles ({{totalprice | replace: ",", "." | currency}}) </button>

                                        </div>

But now the second button also adds 6 products at once. Does anyone have an idea on how to get the second button to order only one product?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines