I'm developing a Volusion site, and as a method of adding items to the cart, I want potential customers to be able to enter a product code to automatically add that product to the cart.
So, I need a form that will completely replace what's in the address bar with:
http://www.yourvolusionstore.com/ShoppingCart.asp?ProductCode=
And then I need a field where they put in the product code and the code gets added at the end...I've been browsing for an answer to this everywhere, but nothing seems to work...
There are several methods in Volusion to add products to the cart but this is about as basic as it gets.
<form action="ShoppingCart.asp" name="form" method="get">
<input type="text" value="" name="ProductCode">
<input type="submit" value="Add To Cart">
</form>
Do you mean, you want to do a redirect? There are only 2 ways to change what is in the address bar:
- By navigating the user to a different page, using one of several methods to do that.
- By changing the hash, using one of several methods to do that.
Other than that, you can't change the URL without navigating them to the page you are changing it to. If you want to send them to that page, you can do:
window.location.href="http://www.yourvolusionstore.com/ShoppingCart.asp?ProductCode=";
If you want to change the hash, you can do
window.location.hash='foo';
that would change the url from http://www.yourvolusionstore.com/ShoppingCart.asp
to http://www.yourvolusionstore.com/ShoppingCart.asp#foo
without navigating away from the page.
If you are trying to accomplish something else, please clarify that in your question.