i got a little problem with displaying the stock quantity correctly.
heres the loop:
<?php
/**
* Loop Price
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $product;
?>
<?php if ( $price_html = $product->get_price_html() ) : ?>
<span class="price">PREIS:<span class="amount"><?php echo $price_html; ?></span></span><p class="stock-m13"><?php get_sku(get_the_ID()); ?></p>
<?php endif; ?>
i want to show the user in the stock-m13 p the available quantity but im just gettin errors like "call to undefined function get_sku()".
what am i doing wrong? thx for any help.
I'm using as following.
Additional
Show total sold items.
Hope this help. Thanks
Simply add these lines in your single.php // your template for displaying he single post Or Id you want to display it on single product page
Simply dd these lines in single-product.php in your theme directory
get_sku is a method of the product class, not a global function:
Note that this will just get the stock code, not the actual quantity, perhaps you want:
EDIT to clarify: