Jump to content

How can I hide the Add to Cart, Quantity and Price from my product page?

Go to solution Solved by amcg,

Recommended Posts

Posted (edited)

I would like to use the product pages on my site to display my products, but because I am not actually selling online, I need to hide the following elements:

  • Add to Cart button
  • Quantity area
  • Price
Edited by ashmac
  • Solution
Posted (edited)

There are a couple of other, related answers to this questions, however this is the code I found which works.

The main section of the code is:


.product-price,
.product-quantity-input,
.sqs-add-to-cart-button-wrapper {
 display:none;
}

This code can be altered to only affect one or two of the elements by removing certain lines. Remove .product-price, from the code if you want to continue to display the price of the product.

Add this code to the Custom CSS Editor if you want all product pages to be affected.

If you would like this code to affect individual product pages, you can add it to the Page Code Injection area. Go to Product Settings > Advanced > Page Header Code Injection on your product page and paste in this code:


<style>
.product-price,
.product-quantity-input,
.sqs-add-to-cart-button-wrapper {
 display: none;
}
</style>

This code can be used if you would like to add PayPal buttons within your products pages. Add the PayPal button code within the Additional Info area of each product, and then hide the Add to Cart button with the above CSS.

Hopefully this helps anyone else!

Edited by ashmac
  • 3 months later...
Posted

I have added about 20 pages (separate from the woocommerce product page) and want quantity + price on the add-to-cart button, currently only the price shows (as per the woocommerce page), how do I add the "quantity" part to just those pages?thanks

Posted

Hi there - I'm not sure I understand you here. Are you using the built in Product Pages on your Squarespace site? Or have you linked to a WooCommerce store?

Posted

sorry, it was a general question, there are WooCommerce pages and these are separate from those, I just wanted to add a Quantity option for just those pageRuss

Posted

no, these are Pages I've created, kind of a display page for the product, now I've added an add-to-cart button to them, but there are no Quantity parts to it, I want to add a Quantity part on just these pages, in case the customer wants to buy from here

  • 2 months later...
Posted (edited)

How I can add PayPal pay butons to my site? I have searched many website platforms and no one seems to have the ability to accomplish this simple (or what i think is simple) thing:

  1. Add products to a cart for immediate payment as pick up will be at the warehouse where they are located. OR
  2. Add products to a form or a list for this list to be emailed as a QUOTE where we will need to determine a shipping cost based on on the size of the order and where it is being shipped to in Canada (it’s furniture thus this isn’t a case of UPS-PUROLATOR).

Any help would be of great appreciation.

Stephanie

Edited by Rustic99
  • 2 weeks later...
Posted

I'm not sure if the '.product-price' code on this link answers this. Are we talking about the whole suite of elements on the product page, or one product itself (are there singular pages of code for each product described, so that CSS would work on just one?). But this is the closest I've found so far to the problem of 'disabling' a product on the product page so that it is basically just an image and not associated with the shopping cart or any mouseovers. I am trying to disable a single item, and keep the image on the product page. But am not familiar with CSS code. Please comment. This seems to be a popular question. Link:
http://answers.squarespace.com/questions/56666/how-can-i-hide-the-add-to-cart-quantity-and-price-from-my-product-page

Posted (edited)

Also! This will only stop the price from displaying on each individual product’s page. For the main product page, use this code in the Style Editor/Page Settings:

#productList .product .product-price { display: none !important }

Edited by ashmac
Posted

@willateamThis was originally for each individual product's page - I've added an additional comment above for the main page.If you want to disable these options on just one specific product, this code won't work.

Instead, you'll need to target each specific item before using code similar to this. Here is another Answers post to help:

http://answers.squarespace.com/questions/38508/only-hiding-price-and-add-to-cart-from-some-products

Here's a screenshot of the exact code that worked for me using those instructions:

http://take.ms/n0DGK

**Note the Quantity line has changed to "-input"

Posted

@Rustic99 - this isn't possible using Squarespace I'm afraid. The Form Block with areas to allow people to link to the products they want might work. Otherwise, you'll need to look into third party apps which can be embedded on your Squarespace site.

  • 1 month later...
Posted

This worked great, up to a point. The fatal flaw is in the display of the thumbnail gallery images, which continue to show the price, whereas the individual items do not.

Arrgghh..

alt text

alt text

  • 9 months later...
Posted

@ashmac Thanks so much for all the info on this thread! It looks exactly like what I need! The one crucial part I'm missing though: Go to Product Settings > Advanced > Page Header Code InjectionI cannot find anywhere the Product Settings tab!!! Please help, thank you!

  • 3 months later...
  • 1 month later...
Posted

Hi. I have tried this but it is not working. Any help very appreciated.

Goal: To hide Price - Quantity - Cart button from a product page collection.

Tested but FAILED:

1) Custom CSS Editor:

collection-576dcb613e00bed84f035031 {

.product-price, .product-variants, .product-quantity-input, .sqs-add-to-cart-button-wrapper {display:none;}

2) Page Header Code Injection:

Neither work. Can some tell me what needs to be adjusted? Thank you.

  • 2 weeks later...
Posted

@ashmac @willateam @Laurie616 Any updates? This code isn't working. Please see my comment below in thread. Any help would be really appreciated. Thank you!

Posted

Thanks Ashmac!

Regarding hiding the price on the main products page... got to Design > Style Editor, find the PRODUCTS heading and uncheck "Show Product Price".

L.

  • 2 months later...
Posted

Hi, it looks like people are missing the ".sold-out" container, which is higher up in the DOM.

This is an answer that actually works. Put this in the custom CSS for your site:

.sold-out .sqs-add-to-cart-button{ visibility:hidden;}

Posted

Hello, this worked great for me.. but how do i remove the TEXT that says "Sold Out" above the Add To Basket on a Product detail page?

thanks!

  • 3 weeks later...
  • 10 months later...
Posted (edited)

You don't have to worry about how you going to remove the add to cart buttons from shop page or any specific product page. Now you just have to follow these simple steps to disable the add to cart button from your Shop page.

Add this code to woocommerce.php (located wp-content/plugins/woocommerce):

function WpBlog() {

removeaction( 'woocommerceaftershoploopitem', 'woocommercetemplateloopaddtocart');

removeaction( 'woocommercesingleproductsummary',

'woocommercetemplatesingleaddto_cart');

return WooCommerce::instance();}

You will see that the add to cart button has been disabled.

Now you can also remove or hide the button from product pages. Just put this code in functions.php

addfilter('woocommerceispurchasable', 'wpblogspecific_product');

function wpblogspecificproduct($purchaseableproductwpblog, $product) {

return ($product->id == specificproductid (512) ? false : $purchaseableproductwpblog);

}

If you still having difficulty doing the following steps you can just see that as reference https://www.wpblog.com/add-to-cart-button-in-woocommerce-store/

Edited by alexanderbiscajin
Initial Revision

I am a WordPress expert. I have been working on WordPress since last Three years.

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.