If you give me an example of what you are trying to do then I should be able to better understand your requirement and give you an answer.
eStore has an option that allows you to add item to the cart using a URL/link which will probably do the job.
I’m displaying a list of classes from another system and I’m using the shortcode to place a add to cart button for each.
Each class will also have a donate button that will redirect to a page where a person can state the amount and also will have the add to cart button to add it to the cart (with the amount specified).
I got the redirection and the form in place, also I’m listening for the POST of that form with the amount to donate information but what I’m missing is how to add that amount to the cart in that POST call.
Thanks for your help.
The support has been excellent for a free product.
I have replied to the question you asked on our support forum. We will handle it over there.
Hi,
Instead of listening for the post back and add the product on php, I tried to recreate the form the Add to Cart button creates with an input visible for price, something similar to this
<form id="form1" name="form1" method="POST" action="" onsubmit="return ReadForm(this, true);">
<label for="price">Amount to Donate</label>
<input id="price" name="price" type="number" step="50.00" value="50">
<input type="hidden" name="shipping" value="0">
<input type="hidden" id="classid" name="classid" value="1234">
<input type="hidden" name="addcart" value="1">
<input type="hidden" name="cartLink" value>
<input type="hidden" name="product_tmp" value="S1234-Class ABC">
<input type="hidden" name="item_number" value="">
<input type="submit" value="Add to Cart">
</form>
on submit, the item is added to the cart correctly and the price and total are also correct but there is no description (no S1234-Class ABC), just a blank line.
Am I missing a field?
Thanks
You need to have the item name in the “wspsc_product” field. see example below:
<input type=”hidden” name=”wspsc_product” value=”S1234-Class ABC” />
Thanks, worked like a charm
@glondono great to hear 🙂
Can you mark this support thread as resolved.
Thank you