WordPress.org

Forums

WooCommerce - excelling eCommerce
Adding SKU on products page/catalog page? (4 posts)

  1. yahboyvinchi
    Member
    Posted 7 months ago #

    Here's the link to the website that I'm managing for one of my clients
    http://rgtdistribution.phantompoint.com/portfolio/
    My clients would like to have the SKU number shown on the catalog page along with the product name and image. However, instead of "SKU #####", they want it to be "Products #####." Also, they the same thing in the single product page--this, I managed to do by simply leaving the SKU box in the Product Data section (when editing product) and add "Product #####" in the short description. However, I do not know how to show it in the catalog page. Can you please show me how? Thank you!

    https://wordpress.org/plugins/woocommerce/

  2. terrytsang
    Member
    Posted 7 months ago #

    hi @yahboyvinchi, you can add below code into your theme functions.php by going to WordPress Admin > Appearance > Editor:

    add_action( 'woocommerce_after_shop_loop_item', 'custom_after_shop_loop_item', 5);
    function custom_after_shop_loop_item() {
      global $post, $product;
    
      echo '<p>Product: '.$product->get_sku().'</p>';
    }
  3. yahboyvinchi
    Member
    Posted 7 months ago #

    @terrytsang thank you so much! It worked like magic! Now on the catalog page, the Product ##### has appeared, as you can see
    http://rgtdistribution.phantompoint.com/portfolio/
    Now, is it possible to do this on the single product page?
    http://rgtdistribution.phantompoint.com/product/15w-40-cj-4-heavy-duty-truck-oil-1-gal/
    My client wants to replace the phrase "SKU" with "Product," so it will show "Product #####" instead of "SKU #####." On the back-end for managing/administrating, it is still the SKU number, but on the front-end for display, it shows "Product." Can you please help me on this? I really appreciate it.

  4. terrytsang
    Member
    Posted 7 months ago #

    Hi @yahboyvinchi, if you want to replace all SKU in WooCommerce backend/frontend, i will recommend you use Codestyling Localization plugin, which allows you to translate the plugin directly in the WP admin panel.

    Translation WooCommerce official documentation link here.

Reply

You must log in to post.

About this Plugin

About this Topic