• In the log it says you have added Filter for button html ‘wooscp_button_html’ but could you explain how it can be used. I have been trying to play around with it without success.

    Thanks

Viewing 1 replies (of 1 total)
  • Hi @adam198,
    You can add below snippet to current-theme (or child-theme) / functions.php:

    add_filter( 'wooscp_button_html', 'wooscp_custom_button_html', 99, 2 );
    function wooscp_custom_button_html( $html, $product_id ) {
    	$button_text = get_option( '_wooscp_button_text' );
    
    	if ( empty( $button_text ) ) {
    		$button_text = esc_html__( 'Compare', 'wooscp' );
    	}
    
    	// change the link as you want here
    	return '<a href="#" class="woosc-btn wooscp-btn wooscp-btn-' . esc_attr( $product_id ) . ' ' . get_option( '_wooscp_button_class' ) . '" data-id="' . esc_attr( $product_id ) . '">' . esc_html( $button_text ) . '</a>';
    }
    • This reply was modified 3 years, 7 months ago by miemie.
    • This reply was modified 3 years, 7 months ago by miemie.
    • This reply was modified 3 years, 7 months ago by miemie.
    • This reply was modified 3 years, 7 months ago by miemie.
Viewing 1 replies (of 1 total)
  • The topic ‘wooscp_button_html’ is closed to new replies.