javascript - Redirecting customers based on the product they select -
I have a shopping cart and based on Here's my HTML: Can I read the In short, I need to redirect the prospective customer to a different page, depending on the order of their product. How can I do this? You can do this: product.id , I need to send one A potential customer for the relevant URL (Farm Action URL)
value field in some way with javascript or without some jQuery code (which I will include in the header section ) And then, within the code, something defined as the result:
if id = "00001" form action = "http://domain.com/page1.php" if id = " 00002 "form action =" addomain.com/page2.php "if id =" 00003 "form action =" http://domain.com/page3.php "if id =" 00004 "form action =" http: / / Domain.com/page4.php "If ID =" 00005 "form action So, if the user clicks on the order ID = "00002" and "Add to cart" button, he / she will not < Code> http://domain.com/page2.php . Or, if a user chooses the product ID "00004" and clicks the "Add to Cart" button, then they will go straight to
http://domain.com/page4.php .
& lt; Script & gt; Var yourid = $ ("input [name = 'id']") Val (); If (yourid = "someid") $ ("form [name = 'product_form']"). Attr ("action", "your_link"); & Lt; / Script & gt;
Comments
Post a Comment