开发者

How do I go straight to the shopping cart with the item added

So I am trying add an item to the shopping cart without clicking on the add to cart in miva. For example

I go here

http://posnation.com/pos_knowledge

and i click on the Buy now button

it takes me to

http://posnation.com/pos_support/online_kbase

but on that page there is an add to开发者_如何学JAVA cart button, if you hit it the item gets added to the Miva cart. How do I skip this page

http://posnation.com/pos_support/online_kbase

and go straight to the cart with the item added

If i firebug over the add to cart there is a javascript onchange function called ComputeTotalCost but i am not sure how to get there from the first page


You would need to make it a forum:

<form method="post" name="FORM" action="/mm5/merchant.mvc?">
<input name="Product_Attribute_Count" value="-1" type="hidden">
<input name="Action" value="ADPR" type="hidden">
<input name="Screen" value="BASK" type="hidden">
<input name="Store_Code" value="POS_Systems" type="hidden">
<input name="Product_Code" value="online_kbase" type="hidden">
<input name="Category_Code" value="pos_support" type="hidden">
<input name="Quantity" value="1" size="4" type="text">
<input src="/images/buy_now.png" alt="Add to Cart" align="absmiddle" type="image">
</form>

It needs to post data to the cat in order to add it to the cart, The code above should add 1 of the items to the cart.


you can add a javascript action at the bottom of that page to submit the form.

the form name is "FORM" so the code you need to add is:

<script language="JavaScript" type="text/javascript">
document.FORM.submit();
</script>


Do you want to do this in javascript? You can just put a listener on the buy now button that will redirect to whatever page you want:

This is done in jquery:

 $("#yourbuttonid").click( 
                function(event) {
                              // do the first action (submit the button to serverside)  
                             // do the redirect                   
                });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜