We have the following two attributes that are used in our transactional emails:

  • {{supplier_qty}}
  • {{qty}}

We would like to output the result of: {{supplier_qty * qty}}

For example, 5 * 1 = 5 (so 5 should be the resulting output).

How can we do this in Magento variables?

1 Answer 1


An option could be that you add a block to your email template so that you can calculate the items in the block. You can do that by adding the following to your email template:

{{layout handle="modulename_email_items" supplier={{supplier_qty}} qty={{qty}}}}

Then in your layout.xml file in your theme add the following:

        <block type="core/template" name="items" template="modulename/email/items.phtml"/>

Then in your template specified above modulename/email/items.phtml add the look at calculating it there:

<table cellspacing="0" cellpadding="0" border="0" width="600">        
              <?php if ($supplierQty = $this->getSupplierQty() && $qty = $this->getQty()) : ?>
                 Qty: $supplierQty * $qty
              <?php endif ?>
  • interesting approach. +1 Oct 1, 2015 at 1:43

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.