Zen Cart Logo
Forums / Customization from the Admin / Don't display the add to cart button

Don't display the add to cart button

Locked

Views: 2,794

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
12 Mar 2009, 8:20 PM
#1
tyankee avatar

tyankee

Zen Follower

Join Date:
Apr 2008
Posts:
159
Plugin Contributions:
0

Don't display the add to cart button

I'd like some products to NOT show the 'Add to Cart' button AND to now show the 'Out of Stock' image. In other words, I'd like nothing to appear. These products will have their own link to a sales page outside of zen cart. I'm sure someone must have done this.

thanks.

12 Mar 2009, 9:07 PM
#2
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Don't display the add to cart button

One simple way is to create a page-specific (or category-specific) stylesheet, following the directions in the readme file in the default CSS folder. You would simply set those elements you don't want to show to display: none; and they would not appear on those pages.

You do have to create a stylesheet for each page or category you want this behaviour on, so if there's a lot of them it might be better to do some code smacking, about which others will no doubt advise.

Rob

13 Mar 2009, 12:42 AM
#3
tyankee avatar

tyankee

Zen Follower

Join Date:
Apr 2008
Posts:
159
Plugin Contributions:
0

Re: Don't display the add to cart button

yikes... are there any examples anywhere - that went way over my head..

thanks...

13 Mar 2009, 1:27 AM
#4
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Don't display the add to cart button

Do you mean that what I said went over your head? Or was it the readme file's explanation?

In either case, here's how it would work. If you go to your site and click on a category and then on a product, you'll see something like this in the address bar of your browser...

http: // www. somesite .com /catalog/index.php?main_page=product_info&cPath=6&products_id=8

That indicates that it is product id #8 in category id #6. (You can also get this from the admin/products and categories listings.)

So to make a stylesheet for that particular product, you'd make a blank document in a suitable text editor (not a word processor) and name it p_8.css, or if you wanted one for all products in that category, you'd name it c_6.css. If it was a subcategory, you'd name it maybe c_6_11.css or whatever numbers were required.

Then, in these custom stylesheets, you'd put something like this...

#cartAdd { display: none; }

That would have the effect of hiding the div that contains the Add To Cart button and the field where you enter a quantity. There's no need for anything except those lines used for hiding elements in this stylesheet. Your regular stylesheet will still be used by Zen Cart for everything else.

When you've got your custom stylesheets done, ftp them into your custom folder's css folder and you're done.

Try it; it can't hurt.

Rob

13 Mar 2009, 3:15 AM
#5
tyankee avatar

tyankee

Zen Follower

Join Date:
Apr 2008
Posts:
159
Plugin Contributions:
0

Re: Don't display the add to cart button

thanks so much for taking the time to help me..

that worked partially.. it got rid of the cart but added an image of a shopping cart and an image of 'zen cart' watermark.. very strange.. see http://www.skinzee.com/website-templates-wordpress-c-1_6/shopping-template-for-wordpress-p-114

the only css i put in that file was
@charset "utf-8";
/* CSS Document */
#cartAdd { display: none; }

any ideas??

13 Mar 2009, 11:39 AM
#6
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Don't display the add to cart button

The cart image and the other one appear to be extra images for that product. When I disabled that page-specific stylesheet momentarily using the Web Developer tools in Firefox, the add to cart area reappeared. Those extra images were still there.

You must have added extra images of the product, or at least have some images which have been named in such a way that they appear as extra images.

Rob

13 Mar 2009, 7:47 PM
#7
tyankee avatar

tyankee

Zen Follower

Join Date:
Apr 2008
Posts:
159
Plugin Contributions:
0

Re: Don't display the add to cart button

so sorry about that - i didn't think to check that.. you're right, i have no idea how those images got there on that product but when i removed them, it works fine..

13 Mar 2009, 8:35 PM
#8
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Don't display the add to cart button

Glad I could help.

Rob

22 Mar 2009, 3:52 PM
#9
beeunique avatar

beeunique

New Zenner

Join Date:
Jan 2006
Posts:
51
Plugin Contributions:
0

Re: Don't display the add to cart button

Hi,

I created a c_122.css file with #cartAdd { display: none; } in it and that is whats removed it from each individual product description page, however when you click on the category and view all products together it still shows each with an add to catr button underneath it (but not in each product description). The items are marked as £0 price and I say in description they wont be shipped but I am fairly sure some customers will still try to buy them - is there anyway to remove the add to cart from the category when all items viewed together?

23 Mar 2009, 12:05 AM
#10
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Don't display the add to cart button

In admin, under Configuration/Product listing, find this one...

Display Product Price/Add to Cart

... and set it to 0.

I think that'll do the trick. But it is a site-wide switch, so if you only want this to happen for certain products, this won't work.

Rob

23 Mar 2009, 2:19 PM
#11
beeunique avatar

beeunique

New Zenner

Join Date:
Jan 2006
Posts:
51
Plugin Contributions:
0

Re: Don't display the add to cart button

Hi - that wont work as we have 1000's of propducts that need to hvae the add to cart button on them all apart from the 9 in this 'display/view only' section. Is there anything I can do with attributes to make them unable to be purchased - some compulsory attribute which is hidden (quite possibly clutching at straws here lol). Thanks, N