SKU not visible while searching. - by raaj.champ

This topic has 9 replies, 3 voices, and was last updated 8 years, 4 months ago ago by Eva Kemp

  • Avatar: raaj.champ
    raaj.champ
    Participant
    December 4, 2015 at 05:42

    When I search product with its name, i want SKU number to be visible.
    Please help me on this?

    8 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 4, 2015 at 08:29

    Hello,

    Please add this code in functions.php file:

    add_action( 'woocommerce_before_shop_loop_item_title', 'shop_sku' );
    function shop_sku(){
    global $product;
    echo '<div class="sku">Code: ' . $product->sku . '</div>';
    }

    Best regards,
    Jack Richardson.

    Avatar: raaj.champ
    raaj.champ
    Participant
    December 4, 2015 at 09:18

    I pasted the code you gave but it did not worked. Kindly help

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 4, 2015 at 10:05

    Hello,

    I’ve added this code in functions.php file:

    add_action( 'woocommerce_after_shop_loop_item', 'prima_custom_shop_item', 5);
    function prima_custom_shop_item() {
    	global $post, $product;
    	/* product sku */
    	echo '<p>SKU: '.$product->get_sku().'</p>';
    }

    Please check products page now.

    Best regards,
    Jack Richardson.

    Avatar: raaj.champ
    raaj.champ
    Participant
    December 4, 2015 at 10:42

    Yeah that worked buddy. Thank You very much

    Avatar: raaj.champ
    raaj.champ
    Participant
    December 4, 2015 at 11:42

    After sku change , In my home page add to cart button is not visible. Need urgent help.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 4, 2015 at 14:24

    Hello,

    Please add this code in custom.css file:

    .product-slider .carousel {
         height: 500px !important;
    }

    To create custom.css you need rename default.custom.css to custom.css in wp-content/themes/xmarket directory via FTP and enable it in Xmarket – Theme Settings, tick “Enable Custom CSS file”.

    Best regards,
    Jack Richardson.

    Avatar: raaj.champ
    raaj.champ
    Participant
    December 5, 2015 at 06:56

    Yeah Thank You

    Avatar: Eva
    Eva Kemp
    Support staff
    December 5, 2015 at 16:11

    Hello,

    You’re welcome.

    Regards,
    Eva Kemp.

  • Viewing 9 results - 1 through 9 (of 9 total)

The issue related to '‘SKU not visible while searching.’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.