SKU — any options for its visibility?
-
Hi WCJ,
I quickly tested SKU, and it works fine (at least when adding new products). Thanks!
However, it’s now viewed in many places, partly in vain. I’d like to e.g. remove it from the category views, nobody needs it there.
Is there a way to adjust SKU’s visibility?
-
Hi again,
Do you mean WooJetpack’s SKU module (WooCommerce > Settings > Jetpack > Products > SKU)? If that is the case – SKU module only deals with SKU generation and format, not the displaying the SKU on frontend. The SKU displaying part totally depends on WooCommerce itself and theme you are using. You could use WooJetpack’s
[wcj_product_sku]
shortcode to display SKU in places you need, but this won’t hide it from theme templates. So I think that the easiest way is to edit the theme templates. Hope that helped.Best regards,
TomThat’s what I meant, yes: SKU module and frontend. (Sorry to be imprecise.)
Perfect answer. Now I know where and how to start tweaking. Thanks!
Hello Tom, Hello yesper,
I have the same needs.. I don’t want to display SKU as default in the product description because it appears not in a good presentation. I would like to use the [wcj_product_sku] shortcode to make it better. I searched :
– In Woocommerce : very few options.. I didn’t found the one which could erase display.
– In my theme (Evolve) : No options in the custom tools.Did you found something in a code template of your theme ? I search, I search..
NB : I got the same problem of anarchic display with “Key words” and “Categories” in my products pages. Do you have this problem too yesper ?
Thanx for the help.
Hello Ben,
The thing was I didn’t want to display any SKU on my category views. It looked stupid. However, SKU is still displayed on my product pages, which is fine with me. And, I haven’t check up yet how it is on my Cart, Checkout, E-mail or Invoice. Basically, doesn’t bother me if it’s shown. I think it’s good to show it for the customer, during the process and after the purchase.
It looks like we have different needs now. In fact, I replaced the original category SKU with another info (Author Name).
Have you contacted your theme authors? Perhaps additional CSS would do.
# yesper
Hello yesper,
Oh! Sorry yes, you told about “category page” and not product page. My bad.. My english is not very well, moreover if I miss some words, it will be worse ??
Anyway, I think, as you told, that it is not a bad point for the customers to check SKU while visiting and processing order. Personnaly, I display it too (on the category page and, of course, on the product page). But for your information, there is a way to not display SKU in category page, under WooCommerce Jetpack : Via the dashboard, go to WooCommerce settings/Jetpack/Products/Products and uncheck the activation box on the archives pages which contains the SKU span style.. Well it works for me here. Make a try? Here is a screen shot (sorry this is in french). I don’t know if this is exactly what you wanted to do -_-‘ I hope.
But your tips (to replace SKU by another data) is a good idea! ??
Concerning my problem (bad and anarchic display of SKU, meta category and meta tags on the products pages), I’ve found the solution in the french WordPress community. There are even 2 possibilities but only by coding :
FIRST ONE : add this code into the style.css (of course in the css childtheme is better in case of theme update!) :
/* hide SKU on product meta section */ .product_meta .sku_wrapper { display:none; } /* hide product CATEGORIES on product meta section */ .product_meta .posted_in { display:none; } /* hide product TAGS on product meta section */ .product_meta .tagged_as { display:none; }
SECOND ONE : modify the meta.php file located here : plugins/woocommerce/templates/single-product/meta.php and comment this line to block execution (but I don’t know how to work it on a child theme.. that’s why I used FIRST solution) :
<span class="sku_wrapper"><?php _e( 'SKU:', 'woocommerce' ); ?> <span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); ?></span>.</span>
It will maybe help other people ??
Best Regards yesper
Ben.Hi again Ben,
I’m a Finnish guy myself, so what you find here is Finglish. ??
Your solution (on the screenshot) works, surely.
Anyway, I instead used the other definition section on the same tab, the one under “Even More Products Info”. Like this:
Product Info on Archive Pages
Enable [X]
– – –
<p>[wcj_product_custom_field name=”product_author”]</p>
– – –
Before product title
15That adds an Author field under the product picture. Required author info will be given via WordPress Custom Field menu.
Yes, your “First one” method was the one I was after. This CSS code “display: none” works in many cases. Nice and easy.
As for the tweaking core php theme files, that’s something I’m always trying to avoid. At least a child theme must be used — as you quite obviously know. ??
Off topic: Comment preview would be really useful here. Let’s see what we see. *post*
Regards
# yesper
Edit: Oh, the Edit link was there, too. Didn’t notice earlier. :/
Hey yesper,
Lol, you made my evening! So we are not so far, as geographically as Finglish or Frenglish langages. The most important is that we understand ourselves :))
Using shortcodes in these fields is very useful. Hum.. visibely you create your own shortcode. You masterize. I do my first steps since few weeks :/ I only tried with an existing original WCJ shortcode, and yes, that works good. “Author name” goes just between the photo/cover and the title/or price ?? perfect shot, which replace SKU intelligently.
Now that we have seen how to not display SKU and how to add some field, I try to find a way to <center> all fields under the photo/cover. This is quite easy to do with fields that we create, but with original fields (like SKU (R.I.P ^^), Prices, Titles) I’m afraid this is not so easy. Maybe like SKU, I should have to not display all of them and (re)add them with shortocdes.. Hum not sure it should be a good way to follow.. It will probably be for a future topic. hehe ?? I will try to search.
And yes, preview posting would be welcome ?? but not so bad, we can edit as you notice! This is funny, on the french WP community we have the preview, but not the editing.
Best Regards,
Ben.
- The topic ‘SKU — any options for its visibility?’ is closed to new replies.