Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 1

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


amcg

Question

Recommended Posts

  • 5

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
Link to comment
  • 0

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
Link to comment
  • 0

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

Link to comment
  • 1

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
Link to comment
  • 0

@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"

Link to comment
  • 0

@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.

Link to comment
  • 0

@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!

Link to comment
  • 1

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.

Link to comment
  • 0

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.

Link to comment

Create an account or sign in to comment

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

×
×
  • Create New...