How can we help?

If you are looking for support for our PokaTheme, this is the place!

Home Forums PokaTheme support How to disable Affiliate Button on specific reviews?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17564
    pnp
    Participant

    If a brand closes or, for whatever reason, I would like to disable the Play Now button on the review. Since an affiliate link is already selected, there is no way to remove the link from the review.

    So, how can I disable the Affiliate Button on a review (to be shown, but disabled maybe)?

    Thanks!

    #17569
    admin
    Keymaster

    Hi pnp,

    Currently there is no option for this in the backend, but we are currently working on this addition and it will be available on next theme release. But for now you could do it using the below code.

    You can do this by copy pasting the following code inside your child theme functions.php

    if ( ! function_exists( 'poka_affiliate_button' ) ) {
    	function poka_affiliate_button( $review_id, $classes = '' ) {
    		if ( in_array( $review_id, array( '314', '23', '58' ) ) ) {
    			return '';
    		}
    
    		$classes = apply_filters( 'poka_affiliate_button_classes', 'btn btn-primary ' . $classes );
    		$btn     = '<a href="' . poka_affiliate_link( $review_id ) . '" ' . poka_affiliate_link_atts( $review_id ) . ' class="' . $classes . '">' . poka_get_translation( 'Play Now' ) . '</a>';
    
    		return apply_filters( 'poka_affiliate_button', $btn );
    	}
    }
    

    The above code will hide the “Play now” button for Reviews with IDs “314”, “23”, “58”. You can add the ones you want.

    • This reply was modified 1 year, 2 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.