Can any one put me in the right direction to remove sku from email and pdf?
If you want to remove from order email then go to
vendor\magento\module-sales\view\frontend\templates\email\items\order
open default.phtml
comment below line
<p class="sku"><?= /* @escapeNotVerified */ __('SKU'); ?>: <?= $block->escapeHtml($block->getSku($_item)) ?></p>
then flush cache and check it.
for invoice and credmit memo it is different template call.
After that work, you need to call that phtml file into your theme or your module.
for invoice
module-sales\Model\Order\Pdf\Items\Invoice\DefaultInvoice.php
in draw function
// draw SKU
$lines[0][] = [
'text' => $this->string->split($this->getSku($item), 17),
'feed' => 290,
'align' => 'right',
];
you need to comment that code.
If that work then you need to override that model using di.xml
Hope it wiill help you.
You need to edit two files:
File 1:
app/design/frontend/base/default/template/email/order/items.phtml
Find the following line and comment it:
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px"><?php echo $this->__('Sku') ?></th>
-----OR-----
empty the value as:
<th align="left" bgcolor="#EAEAEA" style="font-size:13px; padding:3px 9px">&nsbp;</th>
File 2:
app/design/frontend/base/default/template/email/order/items/order/default.phtml
And comment the following line:
<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"><?php echo $this->escapeHtml($this->getSku($_item)) ?></td>
-----OR-----
empty the value as:
<td align="left" valign="top" style="font-size:11px; padding:3px 9px; border-bottom:1px dotted #CCCCCC;"> </td>
Hope this helps.
It worked like a charm on magento 2.1.7 thank you !
The description above works great for simple products (items). If you need to remove the SKU for the Bundle, Downloadable, and Group items, you need to override the following classes.
This is because the PDF renderer checks on the product type and then pulls the corresponding model.