Function: tcp get the current stock

Description

Returns the current stock of the given product or the current product. In this last case, this tag must be within The Loop.
Current stock is calculated using the stock of the product minus the current units of the same product in the cart.

Usage

<?php echo tcp_get_the_current_stock();
echo tcp_get_the_current_stock( get_the_ID() );
echo tcp_get_the_current_stock( $post_id ); ?>

Parameters

$post_id 
(Integer) The ID of the product you’d like to returns its current stock. Defaults to the current product. In this case this tag must be within The Loop.

Change Log

Since 1.3.0

Related

tcp_get_the_stock