Skip to content

Commit

Permalink
magento#26245: Magento does not send an email about a refunded groupe…
Browse files Browse the repository at this point in the history
…d product
  • Loading branch information
atwixfirster committed Jan 6, 2020
1 parent d480fdb commit 7141278
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* Order Email items grouped renderer
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\GroupedProduct\Block\Order\Email\Items\CreditMemo;

use Magento\Sales\Block\Order\Email\Items\DefaultItems;

/**
* Class renders grouped product(s) in the CreditMemo email
*
* @api
*/
class Grouped extends DefaultItems
{
/**
* Prepare item html
*
* This method uses renderer for real product type
*
* @return string
*/
protected function _toHtml()
{
if ($this->getItem()->getOrderItem()) {
$item = $this->getItem()->getOrderItem();
} else {
$item = $this->getItem();
}
if ($productType = $item->getRealProductType()) {
$renderer = $this->getRenderedBlock()->getItemRenderer($productType);
$renderer->setItem($this->getItem());
return $renderer->toHtml();
}
return parent::_toHtml();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom">
<body>
<referenceBlock name="sales.email.order.creditmemo.renderers">
<block class="Magento\GroupedProduct\Block\Order\Email\Items\Order\Grouped" name="sales.email.order.creditmemo.renderers.grouped" as="grouped" template="Magento_Sales::email/items/creditmemo/default.phtml"/>
<block class="Magento\GroupedProduct\Block\Order\Email\Items\CreditMemo\Grouped"
name="sales.email.order.creditmemo.renderers.grouped"
as="grouped"
template="Magento_Sales::email/items/creditmemo/default.phtml"/>
</referenceBlock>
</body>
</page>

0 comments on commit 7141278

Please sign in to comment.