1

enter image description hereI want to display product name only product name in magento transactional email, but using {{layout handle="sales_email_order_items" order=$order}} whole product grid comes like qty sku total etc. i only want to display product name

  • Do you want to remove the other columns like qty, total etc.? – Sukumar Gorai Jul 3 '18 at 9:11
  • yes that could also work for me – adee Jul 3 '18 at 10:01
  • Then what is your requirement? – Sukumar Gorai Jul 3 '18 at 10:13
  • i want only product name that have been ordered – adee Jul 3 '18 at 10:20
  • Can you share any screenshot what do you want? As if you want only product name then remove the other columns. – Sukumar Gorai Jul 3 '18 at 10:26
1

Goto below path:

/app/design/frontend/[package]/[theme]/template/email/order/items.phtml

and replace the code with below code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php $_order = $this->getOrder() ?>
<?php if ($_order): ?>
<table cellspacing="0" cellpadding="0" border="0" width="650" style="border:1px solid #EAEAEA;">
    <?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
    <?php if($_item->getParentItem()) continue; else $i++; ?>
    <tbody<?php echo $i%2 ? ' bgcolor="#F6F6F6"' : '' ?>>
        <?php echo $this->getItemHtml($_item) ?>
    </tbody>
    <?php endforeach; ?>

</table>
<?php endif; ?>

If you don't have items.phtml on your theme then copy it from base and then edit.

And Goto below path:

/app/design/frontend/[package]/[theme]/template/email/order/items/order/default.phtml

and replace the code with below code:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2017 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php $_item = $this->getItem() ?>
<?php $_order = $this->getItem()->getOrder() ?>
<tr>
    <td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;">
        <?php echo $this->escapeHtml($_item->getName()) ?>
    </td>
</tr>

If you don't have items.phtml on your theme then copy it from base and then edit.

| improve this answer | |
  • i tried your solution qty price gone but table heading and total still comes imgur.com/a/BVlAjll – adee Jul 3 '18 at 11:17
  • Table headers are coming from items.phtml. May be any extension override that file. Enable the template path hint and send one email from admin then you will get the exact path of that file. – Sukumar Gorai Jul 3 '18 at 11:19
  • no cant find whats overriding – adee Jul 3 '18 at 11:54
  • Did you enable template path hints? What is the template path showing on mail? – Sukumar Gorai Jul 3 '18 at 11:59
  • i enabled but nothing showing their – adee Jul 3 '18 at 12:14

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.