This topic has 9 replies, 3 voices, and was last updated 8 years, 11 months ago ago by Eva Kemp
When I search product with its name, i want SKU number to be visible.
Please help me on this?
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.
I pasted the code you gave but it did not worked. Kindly help
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.
Yeah that worked buddy. Thank You very much
After sku change , In my home page add to cart button is not visible. Need urgent help.
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.
Yeah Thank You
Hello,
You’re welcome.
Regards,
Eva Kemp.
The issue related to '‘SKU not visible while searching.’' has been successfully resolved, and the topic is now closed for further responses