Developer forum

Forum » Templates » Cart add doesn't work

Cart add doesn't work

Alexandru Aliu
Reply

Hey guys,

I need help with a ( probably) entrylevel front end issue .

I have this DW9 website and I have to add this feature "Wrap as a gift" The way I found to fix this is to add a product to the cart when the button is pressed. It works on localhost, but for some reason doesn't work on staging. The request is made as it should (I think), but for some reason nothing happens in the cart. Am I missing something ?

This is the product that can be added

https://kaffebrenneriet.stagingsite.dk/filter/aeropress-filter

This is on the cart page
<form method="post" id="giftForm">
<input class="form-check-input" type="checkbox" id="KbwOrderIsGift" name="KbwOrderIsGift" onchange="wrappAsAGiftSubmitter()">
<label class="form-check-label" for="KbwOrderIsGift">
Pack as a gift
</label>
<input type="hidden" name="ProductId" value="PROD333">
<input type="hidden" name="OrderContext" value="ORDERCONTEXT2">
<input type="hidden" name="CartCmd" value="Add">
</form>
This is what happens 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Alexandru

I can see that you sumbit to an OrderContext - that requires that you have a cart with that context. Try the submit without using the OrderContext parameter - simply remove the field from the post form.

 

You must be logged in to post in the forum