x

Hide the Purchase Button on an Individual Product Page

After reading Adam's guide on hiding the navigation on a page of a site, I got to thinking about a request a few people have made from me. They had an individual product or two in their store that they wanted people to call for the price on, but the rest of the their products needed to available for purchase online.

The steps involved are a lot like hiding the navigation except for a couple things, so if you can handle doing that then doing this should be a snap.

First, go to the live product page and use the Web Inspector to view your the product button code.

image

Next, move up the element tree until you find the element that contains the purchase button.

image

The ID for the product button is "wsite-com-product-buy", so this is what I want to hide. Next, go to your product page in the editor and drag an Embed Code element to the long description area for the product. Then add this code:

<style>
#wsite-com-product-buy { display:none; }
</style>

Publish your site and check your product. Success! But you know what, I think I'd like to hide the inventory while I'm at it. Follow the same steps above and get the ID of the quantity field, "wsite-com-product-inventory". Next, add it to your style code with a comma, so you now have:

<style>
#wsite-com-product-buy, #wsite-com-product-inventory { display:none; }
</style>

Publish again and check it out!

image

20,868 Views
Message 1 of 30
Report
29 REPLIES 29

Woah, nice! Very well written guide, this is sure to help a lot of customers out. Thanks! Smiley Very Happy
20,504 Views
Message 2 of 30
Report

Great article - thanks for the tip. In addition to the "Add to Cart" and "Quantity" items, I also removed the "Price" using the following code:

<style>

#wsite-com-product-buy, #wsite-com-product-inventory, #wsite-com-product-price-area { display:none; }

</style>

One issue I am having is removing the price from the category view - any thoughts?

20,392 Views
Message 3 of 30
Report

Thanks for the post/code. Helped me out big time.

Any new developments on that last question? It's a good one......... 

"One issue I am having is removing the price from the category view - any thoughts?"

12,042 Views
Message 4 of 30
Report

Any news on removing price in category view??
9,660 Views
Message 5 of 30
Report

I removed the price from the category view by going into Themes and editing the HTML.  

Under Partials, Commerce > Category> Product.tpl    Find {{{price_html}}} and delete it.  

Disclaimer:  I have not fully tested this on a live website and do not know the full ramifications of this action.  Do so at your own risk.  

@Adam do you forsee any issues with this action?  

Always appreciative.

8,449 Views
Message 7 of 30
Report

Thank you wolfer7

To add, If you put that code:

<style>

#wsite-com-product-buy, #wsite-com-product-inventory, #wsite-com-product-price-area { display:none; }

</style>

Into the SEO Settings under Header Code, it has that impact on all of your product pages, instead of just single items.  We provide services.  We like the ability to create detailed service pages, but don't want the product related items.  This worked great for us.

7,921 Views
Message 8 of 30
Report

What do you mean by "go to your product page in the editor and drag an Embed Code element to the long description area for the product".

Also, what if there is only a short description?

20,338 Views
Message 8 of 30
Report

From inside the site editor, click on the STORE tab (on the blue bar, upper left), then click Products on the left side bar. Once there, click on the product you want to edit, then click the "View Product" button on the upper right corner.

This will put you on the product page in the editor. On the page, toward the bottom, you will see "Your long description is empty. Drag elements here" (see image below)

image

To add a long description, drag a text element (the gray squares) into the long description area.  If you do not have a long description to add, you can leave this area empty.

20,333 Views
Message 9 of 30
Report

Great tip! Maybe you can help me out with a related issue.

I would like to limit the quantity that a customer can purchase of one of my products to a maximum of 12. It's not a question of limited inventory; so I don't want to set the product inventory to 12 since it will show Sold Out as soon as someone buys 12 of this item. Is there a way to use embed code to set the maximum quantity to 12?

20,218 Views
Message 10 of 30
Report
Square

We don't have a way right now to do that with our inventory option, although I would definitely recommend posting that on our Vote on Features board (it's a great idea!):

https://community.weebly.com/t5/Vote-on-Features/idb-p/IdeaExchange

One possible work-around would be to make a "quantity" product option with 1 - 12 as options for that.

15,927 Views
Message 11 of 30
Report

Thank you! this helps a lot, do you happen to know how to change this on the CSS level so I can have the same look across all my products?

15,596 Views
Message 12 of 30
Report

This helps so much!!!  Thanks, a lot!

11,810 Views
Message 13 of 30
Report

I made a page on weebly for the new site version to solve this Problem.

http://commerceedits.weebly.com

4,925 Views
Message 14 of 30
Report

Hey I am trying to remove the price, quantity and inventory for the Haberdasher theme.  Any ideas on how to alter the css for this? I'm a bit lost.

4,653 Views
Message 15 of 30
Report

Ho, I Try to remove the button of buy, quantity and the price, I already do the step 1 and 2 of the list but I have trouble with the step 3 witch is the coding

Please Anyone can help me??

4,518 Views
Message 16 of 30
Report
Square

Hi. What do you mean by 3rd step? And what are you trying to hide from the product page again?

4,515 Views
Message 17 of 30
Report

When you modify the Embed Code

4,510 Views
Message 18 of 30
Report
Square

Did you try following this page? It's a really good step by step. Smiley Happy

4,506 Views
Message 19 of 30
Report
Square

Also, I'm pretty sure you don't have to modify the embed code. Should just be a copy/paste into the Embed Element that you will drag and drop from the Build tab. 

4,504 Views
Message 20 of 30
Report

This is way past cool, I have 80 or so products that I would like to do this would this work if a duplicate from the first product?
4,069 Views
Message 21 of 30
Report