• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Replace the "Add to cart" button with "Contact advertiser".

lenet

Member
Apr 25, 2019
67
12
8
Côte d’Ivoire
hello I work on a marketplace. and I want to find a way to define some product as ads. And change the title of the "Add to cart" button to "Contact advertiser". Thank you for putting me on a track.
 
hello I work on a marketplace. and I want to find a way to define some product as ads. And change the title of the "Add to cart" button to "Contact advertiser". Thank you for putting me on a track.
https://wordpress.org/plugins/woo-custom-add-to-cart-button/

Put this code in this file functions.php

add-to-cart-changed-to-buy-now-768x488.png

Code:
add_filter('woocommerce_product_single_add_to_cart_text', 'binary_carpenter_replace_single_text');
function binary_carpenter_replace_single_text()
{
    return 'Contact advertiser';
}
 
Last edited:
simply create a new product as external/affiliate product type
add all details for new product
then change button message to "contact advertiser", effectively replaces "add to cart" for that product only.

easy peasy!
 
  • Like
Reactions: lenet
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock