Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3759473
Change CTA-button
Open

Comments

  •  4
    Nijland Wouter started the conversation

    Hello,

    Can I change the standard CTA-button of the wishlist for a custom code?

    What I mean is to change the standard CTA-button with the text "koop bij bever" on the following page:
    Verlanglijst - Winter-Geest

    Kind regards,

    Wouter Nijland

  •  1,238
    Dustin replied

    Hi Nijiland,

    This button text comes from WooCommerce. Please add the custom code below to change it. (How to add custom code? ↗):

    add_filter( 'woocommerce_product_add_to_cart_text', function ( $text, $product ) {
    	if ( $product->is_purchasable() && $product->is_in_stock() ) {
    		if ( $product->is_type( 'variable' ) ) {
    			$text = 'Select options';
    		} else {
    			$text = 'Add to cart';
    		}
    	} else {
    		$text = 'Read more';
    	}
    
    	return $text;
    }, 99, 2 );

    You can change the text of the three states above as you want.

    Best regards,
    Dustin

  •  4
    Nijland Wouter replied

    Problem solved Dustin, big thanks!