Home Forums WoodMart support forum PHP if not quick view

PHP if not quick view

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #563339

    FreeRiderNSK
    Participant

    Hello!
    I’m using a block output on a single product page.
    Code:

    add_action('woocommerce_single_product_summary', 'block_conversion', 39);
    function block_conversion() {
    echo do_shortcode( '[html_block id="11351"]' );
    }

    But this code also displays a block in quick view.

    I don’t need to display this block in Quick View.

    CSS display: none — bad option.

    Please help me on only PHP.

    #563397

    Artem Temos
    Keymaster

    Hello,

    You can add a conditional structure as shown in the following code example

    add_action('woocommerce_single_product_summary', 'block_conversion', 39);
    
    function block_conversion() {
    	if ( 'quick-view' !== woodmart_loop_prop( 'is_quick_view' ) ) {
    		echo do_shortcode( '[html_block id="11351"]' );
    	}
    }

    Kind Regards

    #563561

    FreeRiderNSK
    Participant

    Hi Artem!
    Thank you! This solved my problem!

    #563569

    Artem Temos
    Keymaster

    Great, you are welcome!

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

The topic ‘PHP if not quick view’ is closed to new replies.