• Barry

    (@barryhughes-1)


    This is really in answer to this (now closed) post from 1yr ago or so (“how do you display the product SKU on the frontend?”) – sharing just in case it helps anyone else exploring iThemes Exchange and related plugins.

    The quick answer is to use the it_exchange_add_product_sku_get_feature() function. It’s first parameter is unused, the second parameter should be the post ID of the product you’re interested in. Quick example:

    function ix_single_products_sku() {
    	$sku = it_exchange_add_product_sku_get_feature( null, get_the_ID() );
    	if ( ! empty( $sku ) ) print "<span class='sku'> $sku </span>";
    }
    
    add_action( 'it_exchange_content_product_after_product_info_loop', 'ix_single_products_sku' );

    The above would display the SKU right below the Buy Now button. Of course, you could also quite easily switch to a different action, such as:

    it_exchange_content_product_before_product_info_loop

    https://www.ads-software.com/plugins/exchange-addon-add-product-sku/

  • The topic ‘SKU display (pt 2)’ is closed to new replies.