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

lenet

Member
Apr 25, 2019
71
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.
 

GARAYEV

Well-known member
Banned User
Jul 24, 2019
1,469
2,388
113
27
IRAN
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:

jebuboy

Member
Mar 2, 2019
93
24
8
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

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu