Woocommerce - Remove Buy Button

Asked

Viewed 2,449 times

1

I have the following problem, actually are 2 situations:


1° situation:
I need to Remove "buy" button when the product does not have registered price.

I’m making a store with Woocommerce where there are several products and registered them as variable products, but some of them have no registered price (because we still don’t have the values of these). I included a button to redirect the customer to the contact area so we can negotiate the order. However, I need to remove the purchase option from this field when the product is at zero value. primeira situacao 2° Situation
When the product has registered value and has no stock, it is presented this way: inserir a descrição da imagem aqui I need him to appear with the same message as the 1° situation and also without the buy button. Could someone give me a light? Thank you! Product link:

Woocommerce version 3.2.5 Wordpress version 4.9.1

  • Try that one: <style>button.single_add_to_cart_button{display: none !important;}</style>

  • That one worked, the button’s gone

  • There was a mistake in a code I sent. Try this one. <script>$(document).ready(function(){$("button.single_add_to_cart_button").remove();});</script>

  • Nothing too expensive

  • I downloaded a site with Woocommerce to test and it worked here. But there’s an article that hints at how to do this using the plugin’s own feature: https://www.cloudways.com/blog/how-to-remove-hide-or-disable-add-to-cart-button-in-woocommerce/

  • So, I actually have two situations... I have to make sure that the button does not appear when the product is variable and has no value and also when the product has value, it is variable and has no stock. are 2 different situations

  • Can you create a variable in PHP that detects this? Type, $esconder_botão = true; if the product is priceless

  • So I think it’s possible, but I don’t have the expertise to create this variable and make it work, rs. that’s the problem...

  • This site is on an online server or is local?

  • is online yes http://gagamilano.com.br/manuale-48mm-pdv/ see the last product of the selection, it has registered price and is selected as out of stock this is the same example I mention in the issue here of stackoverflow The idea is for it to appear in the same way as image 1, but without the buy button too..

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.