Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #788698

    I’d like to add the SKU on Woocommerce product category pages like this: http://postimg.org/image/44zk5gq7j/
    How can I do this?

    #788812

    Hey k593,

    This is a good tutorial for adding the SKU to your Shop pages:
    https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/

    Best regards,

    Jordan Shannon

    #791388

    I’ve added the following code to functions.php, but it is still not working.

    /**
    * Adds product SKUs above the “Add to Cart” buttons
    * Tutorial: http://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
    **/
    function skyverge_shop_display_skus() {

    global $product;

    if ( $product->get_sku() ) {
    echo ‘<div class=”product-meta”>SKU: ‘ . $product->get_sku() . ‘</div>’;
    }
    }
    add_action( ‘woocommerce_after_shop_loop_item’, ‘skyverge_shop_display_skus’, 9 );

    #791392

    Hi,

    If a custom solution, WooCommerce does offer an official SKU Generator Plugin that should fit your needs as well.

    Best regards,
    Jordan Shannon

    #791393

    Hi,

    Also, is there no SKU option available for you to enter in the product category itself?

    Best regards,
    Jordan Shannon

    #792840

    Hi Jordan,

    I am able to create SKUs and don’t want them to be automatically generated. What I am looking for is to have the SKU display on the product category page. Right now it is just a thumbnail and title (I’ve hidden the price). I haven’t been able to find plugins and no PHP snippets have worked so far. Is there anything further that you could suggest?

    #793166

    Hi,

    Please add this hook in the functions.php file:

    add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_after_shop_loop_item_sku_in_cart', 20, 1);
    function woocommerce_after_shop_loop_item_sku_in_cart( $template )  {
    	global $product;
    	$sku = $product->get_sku();
    	echo $sku;
    }

    Best regards,
    Ismael

    #793635

    I added this code to my child theme functions.php file and it did not work, the same as all the other code I have tried. So I added it then directly to the main Enfold theme functions.php file and it worked. I’m not sure why the child theme didn’t work, but at least I have a solution now even if I need to repeat it for theme updates. Thank you for your help!

    #793638

    Hi,

    I am glad you were able to find a solution, that is feasible for the moment. Perhaps if you contact WooCommerce plugin support directly they may have additional feedback as to why the code won’t work within the child function file.

    Best regards,
    Jordan Shannon

    #972616

    Ismael’s solution worked beautifully. However, I have two minor issues:
    1) SKU is populating next to the price. How can I move it down one line break </br>?
    2) How can I add the string/text “SKU: ” before it?

    Many thanks,
    Darrell

    #972624

    Update: Found the solution to my posted issues here:

    Add Information to the WooCommerce Shop Page

    Apologies for the trouble. I love Enfold and the support team. Great product and people.

    Cheers,
    Darrell

    • This reply was modified 5 years, 9 months ago by Darrell.
    #972883

    Hi Darrell,

    Glad you got it working for you and thank you for sharing! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1081784

    Hi Guys,

    Can you please give a update on this.. We all need to earch for the SKU in the Ajax Search. It should be not a problem for a PHP developer.

    Teh solution isn´t working by ismael. Maybe not any more.

    • This reply was modified 5 years ago by Raphael.
    #1082486

    Hi,

    @hunter75: Did you add the code in the functions.php file? That should render the sku right under the product title. Please make that html minification is disabled and purge the cache prior to checking the page.

    Best regards,
    Ismael

    #1082537

    If you don’t mind using a plugin for SKU search, this one works great in the Footer section of my site: https://logodancewear.com

    I changed ‘SKU’ to ‘Style’, per the client’s request.
    [IMG]http://i66.tinypic.com/2s8i61g.png[/IMG]

    #1082821

    Hi Darrell,

    Thank you for your input.

    Best regards,
    Victoria

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.