This is for use with WP e-Commerce plugin. Use this code if you want to display the “SKU” item number on the single product page (in wpsc-single_product.php
). The SKU number is not the same as the Product ID number. The Product ID number (which is like the post ID) is assigned automatically by WordPress. The difference between that and the SKU number is this: You get to assign your own SKU number for each item in your store. Assigning a SKU number is optional.
If you do use SKU numbers for your products, this code will show the SKU on the single product page:
<?php echo wpsc_product_sku(wpsc_the_product_id()); ?>
To display the SKU preceded by “Item #”, like this:
Item #: 203403
Then use the following code in wpsc-single_product.php
. (The following also includes “itemprop=”identifier”, which is microdata that helps generate rich snippets in search engines. This item property only works within the “Product” type.)
<?php $isa_sku = wpsc_product_sku(wpsc_the_product_id()); ?> <span class="isa_sku">Item #: <span itemprop="identifier" content="sku:<?php echo $isa_sku; ?>"><?php echo $isa_sku; ?></span></span>
Show the SKU in the shopping cart widget
If you want to show the SKU in the shopping cart widget (in cart_widget.php
), instead of the above code, use:
<?php echo wpsc_product_sku(wpsc_cart_item_product_id()); ?>
Forest
September 22nd, 2012 at 4:36 pm
Hey Isabel.
What would be the code to insert the SKU number into (after) the product title on the checkout page?
Forrest
Diego
October 21st, 2012 at 7:21 am
Hi,
I want to show the SKU number on my single products page, item list and shopping cart.
I added the code mentioned in your article in the respective php-files, but the SKU number is not shown on my site.
What can I do?
Thanks!
Diego
Isabel
October 21st, 2012 at 5:32 pm
Have you assigned a SKU number to each product? If yes, and it still doesn’t work, then it may be a WP E-commerce bug. I’ve stopped using this plugin altogether several months ago. Aside from all its bugs, the plugin creators (http://getshopped.org) claim to be working on a complete rewrite of the plugin, so I don’t see a point in working with their code until then. I’ve switched to WooCommerce, and it’s excellent.
Diego
October 22nd, 2012 at 6:21 am
Hi,
The SKU number is filled in the wp e-commerce product site.
I now also activated the WooCommerce. And it looks great. I have 1 problem, the WooCommerce CSV import does not function on my side. I use regular CSV-files for this plugin, but when entering the ‘start’-button, I get a white screen.
How can I easily import a lot of products in WooCommerce through the use of a free plugin?
Thanks!
Diego
Tom
February 13th, 2013 at 5:50 pm
How can I display the SKU in the transaction results email that goes to the admin?
Nick
December 5th, 2013 at 1:34 am
Hi Isabel,
Not sure if you can do the same thing in woocommerce as mentioned above – I want the SKU to appear on the cart page or better still in the order at the back end. All my products have SKUs.
Hope you can help..
Thanks anyway,
☮ Nick