Attribute Link to bypass product display?
Hi,
Does anyone know how I can add my attributes as a link on index categories page that goes directly to shopping cart and bypasses the product_info_display page?
I have tried to implement this link code
PHP Code:
<form action="http://[your domain name]/index.php?main_page=product_info&cPath=[your cPath]/&products_id=[your products_id]/&action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
<input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
<input type="hidden" name="products_id" value="[your products_id]" />
<input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
</form>
that I found in this thread - http://www.zen-cart.com/forum/showthread.php?t=43054 and the product goes straight to cart, which is great. However I can not get the attributes of that product to go straight to cart. Anyone know of any solutions or what needs to be replaced in the above code for attributes to work?
Re: Attribute Link to bypass product display?
You would have to write a lot more code to make that happen. I've seen it done on a couple of Zencart sites. Both had slow page load problems, but I don't know if the attributes in the product listing was definitely the cause. There's a discussion here:
http://www.zen-cart.com/forum/showthread.php?t=98641
Re: Attribute Link to bypass product display?
Hi Stevesh,
I have got it to work using this code addition just before the closing tags on the form
PHP Code:
<form action="index.php?main_page=product_info&cPath=3_143_41&products_id=532/&action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
<input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
<input type="hidden" name="products_id" value="532">
<input name="image" type="image" title=" Add to Cart " src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" />
<select name="id[3]" id="attrib-3"><option value="3">x 250 ( £146.00 )</option></select>
</form>
However it displays as a dropdown box and while it displays the price it also displays the quantity. I need a way now to remove the name of the option name, for example, the x250 part, but keep the price?
Re: Attribute Link to bypass product display?
I think I have what I need now in the following code. It allows me to place an add to cart for attributes anywhere on my site. All I had to change was option name to radio.
PHP Code:
<form action="index.php?main_page=product_info&cPath=3_143_41&products_id=532/&action=add_product" method="post" enctype="multipart/form-data" name="cart_quantity" id="cart_quantity">
<input type="hidden" name="cart_quantity" value="1" maxlength="6" size="4" />
<input type="hidden" name="products_id" value="532">
<input name="image" type="image" title=" Add to Cart " src="includes/templates/pnwtemplate/buttons/english/button_in_cart.gif" alt="Add to Cart" />
<input type="hidden" id="attrib-3-3" value="3" name="id[3]">
</form>
Re: Attribute Link to bypass product display?
Hi moesoap,
I think that this exactly what I am looking for. Just wanted to know into which file you put the code in? (Hope that is not too dumb a question)
Cheers
Pacu
Re: Attribute Link to bypass product display?
Quote:
Originally Posted by
pacu
Hi moesoap,
I think that this exactly what I am looking for. Just wanted to know into which file you put the code in? (Hope that is not too dumb a question)
Cheers
Pacu
Hi Pacu,
Only just seen this. If you still need this answered, The code can be placed in any custom page that you created using the html defines in languages. There is one issue with it though, the code is too long if you have loads of products and different options. It creates a very large file that needs to be transmitted from server to browser, so it is not ideal.