While building a website and the product sku appears to be concealed from the product page. I found it to be added to the catalog (shop) page, but I need it to be displayed on the product page.
By changing the single-product.php so far, I managed to add it at the end of the page (something we don't want) or before the title at the top left of the page which I don't want, I didn't find any way to incorporate it before the price and under the product description. see the code I am using for single-product.php theme
<?php
/**
* Single Product title
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/title.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
?>
<?php echo '<div class="sku">' . $product->sku . '</div>'; ?>
The last line I 'd added.
Nonetheless, I can see that sku should be shown on the theme / woocommerce / single-product / meta.php, which is not
<?php
/**
* Single Product Meta
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $post, $product;
?>
<div class="product_meta">
<?php if ( $product->is_type( array( 'simple', 'variable' ) ) && get_option('woocommerce_enable_sku') == 'yes' && $product->get_sku() ) : ?>
<span itemprop="productID" class="sku"><?php _e('SKU:','qns' ); ?> <?php echo $product->get_sku(); ?>.</span>
<?php endif; ?>
<?php echo $product->get_categories( ', ', ' <span class="posted_in">'.__('Category:','qns' ).' ', '.</span>'); ?>
<?php echo $product->get_tags( ', ', ' <span class="tagged_as">'.__('Tags:','qns' ).' ', '.</span>'); ?>
</div>
Please tell me how to show the product SKU number inside the product page?