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

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 Jan 16 at 14:16
  • It should be : <p style="font-size: 12px;"><?php echo $status*1 ?></p> – kiran Jan 16 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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