0

Is there a way to add the Item status (Ordered/Backordered) to the order confirmation email?

I tried below code.

<td class="item-status">
    <?php if ($_item->getQtyBackordered()): ?>
        <p style="font-size: 12px;"><?php echo $_item->getQtyBackordered()*1 ?> Backordered.</p>
    <?php endif; ?>
</td>

It displayed below value:

enter image description here

But it should be ordered and backordered. https://prnt.sc/wr9jez

1 Answer 1

0

you can use both condition to validate the status

<?php 
if ($_item->getQtyBackordered() || $_item->getQtyOrdered()): ?>
<?php $status =  $_item->getQtyBackordered() ? $_item->getQtyBackordered() : $_item->getQtyOrdered() ?>

        <p style="font-size: 12px;"><?php echo $status*1 ?> Backordered.</p>

    <?php endif; ?>
2
  • It displayed backordered : <p style="font-size: 12px;"><?php echo $status*1 ?> Backordered.</p>
    – kiran
    Commented Jan 16, 2021 at 14:16
  • It should be : <p style="font-size: 12px;"><?php echo $status*1 ?></p>
    – kiran
    Commented Jan 16, 2021 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.