OK, I have made some modifications, added some JS to submit the form with ajax. I'm positive that I am going about this the wrong way, but here is the code.
<script type='text/javascript'>
$("form#addProduct").submit(function(){
var product_id = $('input[name="products_id"]').val();
var cart_quantity = $('input[name="cart_quantity"]').val();
var securityToken = $('input[name="securityToken"]').val();
var url = $("#addProduct").attr('action');
/*
$("#ajaxCart").animate({
top: "0",
opacity: 1
}, 1000)
*/
//alert(securityToken+product_id);
var data= new Array();
data['product_id'] = product_id;
data['cart_quantity'] = cart_quantity;
data['securityToken'] = securityToken;
$.ajax({
type: 'POST',
url: url,
data: data,
success: function( data ) {
//this is a result
$("#ajaxCart").animate({
top: "=+350",
opacity: "1"
}, 1000, function(){
$("#ajaxCart").html("added to cart");
})
}
});
return false;
});
$("#hideCart").click(function(){
$("#ajaxCart").animate({
top: "-350",
opacity: 1
}, 1000)
return false;
});
</script>
I have modified the zen_draw_form function as well to accept another parameter (id) so that the call can be made on the form submission.
Now, I keep getting a 302 moved temporarily when it is submitted. I am positive this is how it is supposed to work, but how can I send the add to cart info to a script to process it without getting these errors.
Thanks!
Here is a link to the current implementation.
http://design.uniqueoutdoorproducts.com/