Developer forum

Forum » Templates » eCom: Add to basket

eCom: Add to basket


Reply
I'm about to make a "add to basket" with the possibility to enter how many of one product you want to put in it. But it fails when you use custom urls "Side navn med ID
parameter (/Sidenavn.aspx?ID=Side ID)"

If I use one of the other custom urls it works, but I have to use the
"Side navn med ID
parameter (/Sidenavn.aspx?ID=Side ID)" because it's on an existing solution.

My code:
                      <div class="ProductListAddToCart">
                        <a href="javascript:document.getElementById('<!--@Ecom:Product.ID-->').submit();"><!--@Translate(addtobasket, "L&aelig;g i kurv", global)--></a>
                    </div>
                    <div class="ProductListQuantity">
                        <form name="<!--@Ecom:Product.ID-->" id="<!--@Ecom:Product.ID-->" method="get">
                            <input type="hidden" name="CartCmd" id="CartCmd" value="add" />
                            <input type="hidden" name="ProductID" id="ProductID" value="<!--@Ecom:Product.ID-->" />
                            <input type="hidden" name="VariantID" id="VariantID" value="" />
                            <input type="hidden" name="UnitID" id="UnitID" value="" />
                            <input type="text" name="Quantity" id="Quantity" value="1" size="1" maxlength="2" />
                        </form>
                    </div>

Replies

 
Nicolai Høeg Pedersen
Reply
Just tried with success on my training site:
http://site0.training.dynamicweb.dk/Webshop.aspx?ID=48&GroupID=GROUP25

Attached the template used.

I think it is your form definition that is the issue:
<form action="<!-- @Global:Pageview.Url.Raw-->" id="<!-- @Ecom:Product.ID-->" name="<!-- @Ecom:Product.ID-->" method="get">
<!-- @Ecom:Product.Form.Clean-->

 

You must be logged in to post in the forum