New Landing How can we help? Atelier ADD TO CART –> change text

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Atelier
  • #243028
    bioterraherbs
    Member
    Post count: 68

    Hi,

    I want to add a button on one of my webpage (http://74.206.228.55/rescue-kits/) that serve as an “add to cart” function.

    First way I did is to use the ADD TO CART BUTTON shortcode…. but how do I change the text “ADD TO CART” to other text in this page only? I searched other post, it only provide solutions that change the text of add to cart button through out the whole website.

    or

    Second, I created a button using “button” shortcode to display the text I want, but then how do I make the button to become an “add to cart” function that when people click add the specific product into the cart?

    Please advise.

    Thanks,

    #243369
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    function sf_text_strings( $translated_text, $text, $domain ) {
    	if( ($translated_text == 'Add to cart') && is_page('277')) {
    			$translated_text = __( 'Your text', $domain );
    			
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );
    

    Thanks
    Mohammad

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register