| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Simple html links with product option selected | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Simple html links with product option selected
Hi,
I use xcart only as a back end shopping cart and only use the generated html links for the add to cart buttons on my website. What I am trying to do is to create a one line html link that will add a product to the cart with a particular product option pre-selected, so that when the customer clicks the link 1 item is added to the cart with option 1, 2 or 3 already selected. Below is the form that is generated by xcart but I just want a simple html link. Thank you <form name="orderform_16291" method="post" action="http://www.hollywood-collectibles.com/store/cart.php"> <input type="hidden" name="mode" value="add" /> <input type="hidden" name="productid" value="16291" /> <table width="100%"> <tr> <td valign="top"> <br /> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td class="ProductPriceConverting" valign="top">Price:</td> <td valign="top"> <font class="ProductDetailsTitle"><span class="currency">$299.95</span></font><font class="MarketPrice"> </font> </td> </tr> <tr> <td class="property-name product-input"> Order Option </td> <td class="property-value" colspan="2"> <select id="po448" name="product_options[448]"> <option value="4142" selected="selected"> Regular Order (1 payment, due when item ships) </option> <option value="4138"> 4Pay (4 installments) </option> <option value="4139"> 6Pay (6 installments) </option> </select> </td> </tr> <tr> <td height="25" width="30%"> Quantity </td> <td> <script type="text/javascript"> //<![CDATA[ var min_avail = 1; var avail = 50; var product_avail = 1001; //]]> </script> <select id="product_avail" name="amount" onchange="javascript: check_wholesale(this.value);"> <option value="1">1</option> <option value="2">2</option> </select> </td> </tr> <tr> <td colspan="2"> <br /> <table cellspacing="0" class="SimpleButton"><tr><td><a class="simple-button simple-arrow-button" href="javascript:void(0);" onclick="javascript: document.orderform_16291.submit();">Add to cart</a></td></tr></table> </td> </tr> </table> </td> </tr> </table> </form>
__________________
4.4 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Simple html links with product option selected
You can use the following link as a sample:
http://www.hollywood-collectibles.com/store/cart.php?mode=add&productid=16291&product_options[448]=4139&amount=2
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#3
|
|||||||||
|
|||||||||
Re: Simple html links with product option selected
Thanks Alex.
Is there a similar method for an add-to-cart link when the product is 0 price, that is, the price would be entered by the customer? (in 4.4.2) I would like to have an add to cart link where I can set a few other options, and provide an initial donation amount. Something that would have the effect of: cart.php?mode=add&productid=1&price=100&product_op tions[5]=9 If I can't set the price, it detects the cart as empty ---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Simple html links with product option selected
Yes, this is possible.
Please have a look at the following sample URL: Code:
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#5
|
|||||||||
|
|||||||||
Re: Simple html links with product option selected
Thanks for that Alex. It appears the price needs to be last in the URL for it work properly.
Any chance that product.php can also GET product options from the URL to pre-fill options on the product page, or is this feature only built into cart.php? Turns out the add-to-cart won't help for what I need. I have to have a few options already selected, and have the amount open for the user to fill in a donation. When I direct them to the cart with a set price - they unfortunately don't have a way to update the price inside the cart once it is set. If this is not available for product.php - I see from the Generate Links that you do provide a form I can use to have the options set and have them fill out the price. ---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: Simple html links with product option selected
It is supported for the cart.php script only.
But it can be custom programmed if required. The first option I guess will be changing the cart templates for the customers to be able to change the price for zero-priced products.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|