Viewing 13 replies - 1 through 13 (of 13 total)
  • I believe you are talking about changing the text “Free” to something else when product regular price is set to 0. If so, then you may use following code. Place this in your theme’s functions.php file:

    add_filter( 'woocommerce_free_price_html', 'my_custom_woocommerce_free_text', 10, 2 );
    function my_custom_woocommerce_free_text( $price, $product_instance ){
    	$price = '<span class="amount">' . __( 'Thats Free Hurry!', 'woocommerce' ) . '</span>';
    	return $price;
    }

    Where I have said Thats Free Hurry! needs to be changed as per your requirement. I hope this helps.

    Thread Starter msbazilio

    (@msbazilio)

    Sorry, but it did not work.
    I’m using this function, but the shopping trolley listed as 0

    “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)
    {
    return ‘Sob Consulta’;
    }”

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I’m using this function, but the shopping trolley listed as 0

    The code snippet does product prices, The cart values should be numeric.

    Thread Starter msbazilio

    (@msbazilio)

    ok!
    You have no way to leave a string then?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Can you screenshot me where you want the free to appear?

    Thread Starter msbazilio

    (@msbazilio)

    Hello, when the purchase is made and the item goes to the basket, the demonstration of the product is ok! But in the cart item appears $0.00.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I need a screenshot or link so I know if its coming from WC or your theme.

    Thread Starter msbazilio

    (@msbazilio)

    When you purchase this product
    http://mkmdecoracoes.com.br/produto/garrafa-wisky/
    Note that the shopping trolley value will be 0.00 and not on request.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Ah yes of course, because regardless of those products being in the cart, the cart total is still 0.

    You could use a contact form plugin or something on this page instead if it’s simply to get interest from customers.

    Thread Starter msbazilio

    (@msbazilio)

    Thank you for your attention, I would like to insert the “on request” in the application, but will study other alternative.
    Thanks again.

    You may like to take a look at WooCommerce “Catalog Visibility Options” plugin which allows you to disable prices, purchase and customize “Add to cart” button text. Please read the documentation to confirm before you purchase.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    That is also one good option if @msbazilio wants to allow selling products as well as ‘pre purchase enquiry’ through his site. With “Catalog Visibility Options” plugin however, he can disable purchase completely and disable showing prices as well. So I will say, it will be upto @msbazilio to check what suits his requirement and go ahead accordingly πŸ™‚

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘price Free’ is closed to new replies.