Developer forum

Forum » Ecommerce - Standard features » Gift card with custom amount

Gift card with custom amount

Martin Christensen
Reply

Hello,

I'm looking to create gift cards with custom amounts. According to the documentation I should replace the price of the product (if the product is a gift card, of course) with an input field. But I don't know what the input field should be called, and the documentation refers to a template example which doesn't seem to exist: http://doc.dynamicweb.com/documentation-9/ecommerce/product-catalog/products#sideNavTitle1-3-2-1

It refers to ProductGiftCard.html 

Has anyone implemented this?

 

Thanks!

BR Martin


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Martin,

 

The field name is Amount

 

//Nuno

Votes for this answer: 1
 
Martin Christensen
Reply

Of course it is, I should probably have been able to guess that :)

Thanks!

 
Andrew Rushworth
Reply

Hi Guys,

I know this is an old post but i've added the input as belwo and it still just uses the price associated with the product. I'm using the Rapido template.

<input type="text" name="Amount" id="Amount" value=""></input>

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And the product is of type Giftcard?

Can you show how your POST looks like in developer tools? And maybe som context of your template - it is add multi or just adding one product?

BR Nicolai

 
Andrew Rushworth
Reply

Hi Nicolai,

Yes, Product is of type giftcard.
Post Url: http://localhost/Default.aspx?ID=6308&Quantity=1&redirect=false&ProductID=PROD215&cartcmd=add&feedtype=Counter

It uses the standard AddToCartButton that uses the AddToCart - but I see there is no "Amount" that gets used by the js functions. So it just uses the product amount as per the setup.
But I see this will not be a solution currently anyway, as the site is is using Live Integration with LS adn this only seems to cater for "Product" Product Types and gets the Amount from LS. - So it doesn't matter what amount we send through from DW, it will get overwritten.

Thanks,
Andrew

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Thanks for getting back - as you say, live integration complicates things as that calculates - and yes, the amount field also has to be part of the request (that in this case should probably be a post).

BR Nicolai

 
Andrew Rushworth
Reply

Ok, so you mean we would have to change the template to a POST and wont' be able to use the AddToCart js?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

no, you should be able to use GET. It is just me that is not fan of get requests with amounts in them - but code wise both works.

 
Andrew Rushworth
Reply

Thanks Nicolai - makes sense.

 

You must be logged in to post in the forum