Skip to content

Using if statement in phtml

Would like to put an if statement in the below code as follows.

If saleable qty <=0 (equals 0 or under), add CSS. Otherwise, add different CSS

<div class="left-stock">
    <strong>
        <?= ($block->salebleqty() != '') ? $block->escapeHtml(__('Only %1 left in stock!', $block->salebleqty())) : '' ?>
    </strong>
</div>