Add to cart button on product listing
Just wanting to do what it says - in the main product list, I would like an add to cart button rather than having to click on see details before doing this.
Has anyone done this already before I try and figure it out? Cheers |
FD
We did ours this way. Here is the code for our products.tpl (skin1/customer/main). As our products show in 2 columns, 2 rows, so you may have to juggle around with the placement of the code (form/endform>) to get it to work. Good Luck LeeD Code:
{* $Id: products.tpl,v 1.16 2002/09/25 10:12:05 zorg Exp $ *} |
Ooops ..just noticed a [/i] in the 2nd line of bold code....remove it ..
|
Presumeably the morinfo.tpl is a button template that you have created?
Will try this - thanks. |
yep it is ..you can just ignore it
|
Perfect - work a treat
cheers |
Okay I've installed this script to ad item to cart from product listing and it works like a charm.
But one small problem. I also need to have the color selections display on the product listing page with the ad item to cart button. Thanks John |
In Stock?
You should check to see if it is in stock before displaying the Add to Cart button.
|
Actually you see its the code itself. I think it needs to be modified to be able to do more than just display the ad buttom it needs to display the choice of which color.
Do you understand? |
LeeD, Just wanted to say thanks, I was looking for help with something else, came across this, - a little cutting and pasting, and Wa La, it works like a charm. :lol:
|
Thanks
This code took 2 items of my TODO list at one time!! Thanks LeeD!!
|
Okay I'm gonna start a new thread with my question then.
|
would anyone be so kind and paste in the code for 3 columns layout ?
thx !!! |
fantastic, but one slight bug??;o(
Hi LeeD
I've implemented the addtocart to show up in the main product list, however whenever I press the addtocart for the first top most product listed, I get an error and it doesn't work, however it works for all the products that follow beneath it. Any ideas? I tried it in Netscape and it works fine.. the url for the first product is document.orderform_0.submit is it something to do with it being Zero? Cheers Aj.. |
Excellent Work
leed,
Just wanted to say thanks for the great code. It worked like a charm, kudos to you. P.S. - You can edit your original post to remove the [/i] so that it doesn't keep tripping people up. Then just delete your "Oops..." post. |
Thanks for this code :) I changed it slightly for people who only want one product per row....
Quote:
|
1st item in list to cart
Hi Aussieb
Cheers for that.. much cleaner than I one I fudged, Im still getting the same problem though, I cant seem to add the first item, comes up with error, it doesnt submit, yet all the ones below all add to cart perfectly. Any ideas.. Cheers -Aj.. |
sorry I can't be of help - I didn't have that problem when I made the change - all products were working fine.,
I have actually just done a total re install so am back to square one myself - teach me for hurrying and not making backup copies won't it?! ;) |
ok - I have added this code again and I am not not sure what you mean. Do you mean the first listed product won't add? Mine will so not sure what the prob you are having is?
I have tested all the products on all the pages and they work a treat? Is it skin1/customer/main/products.tpl that you changed? |
Hey, cheers for responding.
I blew away the db, reimported, and it works fine now.. bizarre!!! thanks matey Aj.. |
Worked good, but my permissions?
I am having trouble with my permissions. When I implemented the new products.tpl, the buttons were on there, but when I clicked add to cart, it said access denied, you do not have permission, what folder should I set to what permissions?
|
Is this happening on the live site? Not sure what you mean - but all the permissions needed are listed in the read me files etc. I don't want to tell you what to do cos I am bad with setting wrong permissions then having to reset them ;)
|
How about "remove from cart" button
Anyone has an idea how to do it?
I'm making a mod that will display a list of products in the cart right underneath the cart image as such: (2) Product Name ... and when u press add/remove the number inside of parentesis will increase/decrease... so anyone got remove function.. i'd appreciate if you share (i'll share too) |
Wow - that was so unbelievably easy to implement I can't believe I didn't do it sooner.
Thanks for the code ! For the record - all that's needed is the addition of this form and button to customer/products.tpl (place where approriate): Code:
<form name=orderform_{%product.index%} method=post action="cart.php?mode=add"> Nice.... :P |
suppose we should put this in custom templates :idea:
|
Eh? I dont follow you.
Aren't we already in Custom Templates ? |
we are now :wink:
|
LOL
I get it... :oops: |
this isnt working for v 3.4.2
|
use the option to add the "buy now" button that is built into v3.4.x branh
|
Thanks for the code, works great :lol:
|
How about this feature
|
YuriC
I like yours a lot. Is any chance that you will share the code?
|
I dont see why not
Here you go. Replace your products.tpl with this code
Code:
{* $Id: products.tpl,v 1.21.2.2 2003/03/11 10:49:14 svowl Exp $ *} |
OK great job you guys this is exactly what I was looking for.
:) |
Quote:
Did you ever receive a reply to this?????? |
All times are GMT -8. The time now is 08:19 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.