I am having some trouble dynamically adding an Add To Cart button that I was wondering if anyone has ever tried this.
Due to the large inventory of products I have I fetch more details from the server about the item the user has requested to see more info about. Below is a snippet of code that I am return to the client in order for them to add this item to cart.
The item exists within the database, but this doesn't add anything. I have copied this HTML code from the DEMO Store page by right clicking the Add To Cart and seeing how it has been done by that. Obviously, I am getting errors because things are missing.
I am wondering what is most important information that I need to pass to the client? Can someone help me setup my form?
If you need me to clarify anything or show more code please don't hesitate to ask.
Thank you.
Due to the large inventory of products I have I fetch more details from the server about the item the user has requested to see more info about. Below is a snippet of code that I am return to the client in order for them to add this item to cart.
PHP Code:
$easyCart = "<form action="https://example.com/cart/" method="POST" enctype="multipart/form-data" class="ec_add_to_cart_form">
<input type="hidden" name="ec_cart_form_action" value="add_to_cart_v3">
<input type="hidden" name="product_id" value="11">
<div class="ec_details_add_to_cart_area">
<div class="ec_details_add_to_cart">
<input type="submit" value="ADD TO CART" onclick="return ec_details_add_to_cart_2( );">
</div>
</div>
</form>"
I am wondering what is most important information that I need to pass to the client? Can someone help me setup my form?
If you need me to clarify anything or show more code please don't hesitate to ask.
Thank you.
Comment