La fonction que je vous ai indiquée est une statique donc utilisable partout, même dans le tpl.
Du coup, vous n'avez qu'à modifier le début de la boucle:
{assign var='available_quantity' value=$product->quantity}
{if isset($smarty.get.bt_product_attribute)}
{assign var='available_quantity' value=StockAvailable::getQuantityAvailableByProduct($product->id,$smarty.get.bt_product_attribute)}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.get.bt_product_attribute, 6)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.get.bt_product_attribute)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.get.bt_product_attribute, 6)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.get.bt_product_attribute)}
{/if}
{else}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.get.price, 6)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, 6)}
{assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
{/if}
Et remplacer les $product->quantity par $available_quantity dans le reste du tpl