Jump to content

Wordpress / Woocommerce Question


pigsfoot

Recommended Posts

HI,

 

I have a wordpress site that uses WooCommerce and also WooThemes "Wish list" extension as part of a shop.

 

I am wanting to hide the "add to cart" button when a price is 0.00 but retain the "Add to Wish List" button.

 

I have already spoken to WooThemes and there responce is they do not offer coding assistance, i would have to employee someone to look at this for me..

 

I do have some code that kind of works... in that it does hide the "add to cart" button but it also hides the "add to wish list" button


<?php
/*
* Swop the 'Free!' price notice and hide the cart with 'Subscription Item' in WooCommerce
*/
add_filter( 'woocommerce_variable_free_price_html', 'hide_free_price_notice' );
add_filter( 'woocommerce_free_price_html', 'hide_free_price_notice' );
add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' ); 
function hide_free_price_notice( $price ) {
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
return 'Subscription Item';
}
?> 

I'm no programmer so i have no idea if this is a complex fix or something that maybe you guys on a forum can help out with. If it's out of the scope of general foum help i will have to post a job somewhere to see if i can get some help that way.

 

Many Thanks...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.