Skip to content

Commit 7bb68c0

Browse files
committed
Merge pull request #447 from magento-api/MAGETWO-37843-responsive-email-templates-in-blank-theme
[API] Responsive Email Template - Merging outsourced PR 21
2 parents cabd186 + 2489d63 commit 7bb68c0

File tree

309 files changed

+5571
-3605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+5571
-3605
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ before_install:
2828
$HOME/.cache/bin/composer self-update; echo '';
2929
else
3030
mkdir -p $HOME/.cache/bin;
31-
curl --connect-timeout 30 -sS https://getcomposer.org/installer \
31+
curl --connect-timeout 30 -sS https://getcomposer.org/installer
3232
| php -- --install-dir $HOME/.cache/bin/ --filename composer;
3333
fi
3434
fi'

app/code/Magento/AdvancedPricingImportExport/i18n/en_US.csv

Whitespace-only changes.

app/code/Magento/Authorization/i18n/en_US.csv

Whitespace-only changes.

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@
352352
<resource>Magento_Config::config_admin</resource>
353353
<group id="emails" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
354354
<label>Admin User Emails</label>
355-
<field id="forgot_email_template" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
355+
<field id="forgot_email_template" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
356356
<label>Forgot Password Email Template</label>
357+
<comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
357358
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
358359
</field>
359360
<field id="forgot_email_identity" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function truncateString($value, $length = 80, $etc = '...', &$remainder =
3636
* @param \Magento\Framework\Object $item
3737
* @return array|null
3838
*/
39-
public function getChilds($item)
39+
public function getChildren($item)
4040
{
4141
$itemsArray = [];
4242

app/code/Magento/Bundle/Block/Sales/Order/Items/Renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function getValueHtml($item)
125125
* @param \Magento\Framework\Object $item
126126
* @return array
127127
*/
128-
public function getChilds($item)
128+
public function getChildren($item)
129129
{
130130
$itemsArray = [];
131131

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra
1818
* @param \Magento\Framework\Object $item
1919
* @return array
2020
*/
21-
public function getChilds($item)
21+
public function getChildren($item)
2222
{
2323
$itemsArray = [];
2424

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function draw()
6767
$pdf = $this->getPdf();
6868
$page = $this->getPage();
6969

70-
$items = $this->getChilds($item);
70+
$items = $this->getChildren($item);
7171
$prevOptionId = '';
7272
$drawItems = [];
7373
$leftBound = 35;

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function draw()
6969
$page = $this->getPage();
7070

7171
$this->_setFontRegular();
72-
$items = $this->getChilds($item);
72+
$items = $this->getChildren($item);
7373

7474
$prevOptionId = '';
7575
$drawItems = [];

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function draw()
6666

6767
$this->_setFontRegular();
6868

69-
$shipItems = $this->getChilds($item);
69+
$shipItems = $this->getChildren($item);
7070
$items = array_merge([$item->getOrderItem()], $item->getOrderItem()->getChildrenItems());
7171

7272
$prevOptionId = '';

app/code/Magento/Bundle/Test/Unit/Block/Adminhtml/Sales/Order/Items/RendererTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
4040
$item->expects($this->once())->method('getOrderItem')->will($this->returnValue($this->orderItem));
4141
$this->orderItem->expects($this->any())->method('getId')->will($this->returnValue(1));
4242

43-
$this->assertSame(null, $this->model->getChilds($item));
43+
$this->assertSame(null, $this->model->getChildren($item));
4444
}
4545

4646
public function getChildrenEmptyItemsDataProvider()
@@ -79,7 +79,7 @@ public function testGetChildren($parentItem)
7979
$item->expects($this->once())->method('getInvoice')->will($this->returnValue($salesModel));
8080
$item->expects($this->any())->method('getOrderItem')->will($this->returnValue($this->orderItem));
8181

82-
$this->assertSame([2 => $this->orderItem], $this->model->getChilds($item));
82+
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
8383
}
8484

8585
public function getChildrenDataProvider()

app/code/Magento/Bundle/Test/Unit/Block/Sales/Order/Items/RendererTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
4040
$item->expects($this->once())->method('getOrderItem')->will($this->returnValue($this->orderItem));
4141
$this->orderItem->expects($this->any())->method('getId')->will($this->returnValue(1));
4242

43-
$this->assertSame(null, $this->model->getChilds($item));
43+
$this->assertSame(null, $this->model->getChildren($item));
4444
}
4545

4646
public function getChildrenEmptyItemsDataProvider()
@@ -79,7 +79,7 @@ public function testGetChildren($parentItem)
7979
$item->expects($this->once())->method('getInvoice')->will($this->returnValue($salesModel));
8080
$item->expects($this->any())->method('getOrderItem')->will($this->returnValue($this->orderItem));
8181

82-
$this->assertSame([2 => $this->orderItem], $this->model->getChilds($item));
82+
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
8383
}
8484

8585
public function getChildrenDataProvider()

app/code/Magento/Bundle/Test/Unit/Model/Sales/Order/Pdf/Items/AbstractItemsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testGetChildrenEmptyItems($class, $method, $returnClass)
4040
$item->expects($this->once())->method('getOrderItem')->will($this->returnValue($this->orderItem));
4141
$this->orderItem->expects($this->any())->method('getId')->will($this->returnValue(1));
4242

43-
$this->assertSame(null, $this->model->getChilds($item));
43+
$this->assertSame(null, $this->model->getChildren($item));
4444
}
4545

4646
public function getChildrenEmptyItemsDataProvider()
@@ -79,7 +79,7 @@ public function testGetChildren($parentItem)
7979
$item->expects($this->once())->method('getInvoice')->will($this->returnValue($salesModel));
8080
$item->expects($this->any())->method('getOrderItem')->will($this->returnValue($this->orderItem));
8181

82-
$this->assertSame([2 => $this->orderItem], $this->model->getChilds($item));
82+
$this->assertSame([2 => $this->orderItem], $this->model->getChildren($item));
8383
}
8484

8585
public function getChildrenDataProvider()

app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/create/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
?>
1616

1717
<?php $_item = $block->getItem() ?>
18-
<?php $items = $block->getChilds($_item); ?>
18+
<?php $items = $block->getChildren($_item); ?>
1919
<?php $_count = count($items) ?>
2020
<?php $_index = 0 ?>
2121

app/code/Magento/Bundle/view/adminhtml/templates/sales/creditmemo/view/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
?>
1616

1717
<?php $_item = $block->getItem() ?>
18-
<?php $items = $block->getChilds($_item); ?>
18+
<?php $items = $block->getChildren($_item); ?>
1919
<?php $_count = count($items) ?>
2020
<?php $_index = 0 ?>
2121

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/create/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
?>
1616

1717
<?php $_item = $block->getItem() ?>
18-
<?php $items = $block->getChilds($_item); ?>
18+
<?php $items = $block->getChildren($_item); ?>
1919
<?php $_count = count($items) ?>
2020
<?php $_index = 0 ?>
2121

app/code/Magento/Bundle/view/adminhtml/templates/sales/invoice/view/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
?>
1616

1717
<?php $_item = $block->getItem() ?>
18-
<?php $items = $block->getChilds($_item); ?>
18+
<?php $items = $block->getChildren($_item); ?>
1919
<?php $_count = count($items) ?>
2020
<?php $_index = 0 ?>
2121

app/code/Magento/Bundle/view/adminhtml/templates/sales/shipment/create/items/renderer.phtml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10-
<?php
11-
/**
12-
* @see \Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer
13-
*/
14-
?>
10+
11+
<?php /** @var $block \Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer */ ?>
1512

1613
<?php $_item = $block->getItem() ?>
17-
<?php $items = $block->getChilds($_item); ?>
14+
<?php $items = $block->getChildren($_item); ?>
1815
<?php $_count = count($items) ?>
1916
<?php $_index = 0 ?>
2017

app/code/Magento/Bundle/view/adminhtml/templates/sales/shipment/view/items/renderer.phtml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
// @codingStandardsIgnoreFile
88

99
?>
10-
<?php
11-
/**
12-
* @see \Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer
13-
*/
14-
?>
10+
<?php /** @var $block \Magento\Bundle\Block\Adminhtml\Sales\Order\Items\Renderer */ ?>
1511

1612
<?php $_item = $block->getItem() ?>
1713
<?php $items = array_merge([$_item->getOrderItem()], $_item->getOrderItem()->getChildrenItems()) ?>
18-
<?php $shipItems = $block->getChilds($_item) ?>
14+
<?php $shipItems = $block->getChildren($_item) ?>
1915
<?php $_count = count($items) ?>
2016
<?php $_index = 0 ?>
2117

app/code/Magento/Bundle/view/frontend/templates/email/order/items/creditmemo/default.phtml

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,78 @@
1111
<?php $parentItem = $block->getItem() ?>
1212
<?php $_order = $block->getItem()->getOrder(); ?>
1313

14-
<?php $items = $block->getChilds($parentItem) ?>
15-
16-
<?php $_prevOptionId = '' ?>
17-
18-
<?php foreach ($items as $_item): ?>
14+
<?php $items = $block->getChildren($parentItem) ?>
1915

2016
<?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?>
2117
<?php $_showlastRow = true ?>
2218
<?php else: ?>
2319
<?php $_showlastRow = false ?>
2420
<?php endif; ?>
2521

26-
<?php if ($_item->getOrderItem()->getParentItem()): ?>
27-
<?php $attributes = $block->getSelectionAttributes($_item) ?>
28-
<?php if ($_prevOptionId != $attributes['option_id']): ?>
29-
<tr>
30-
<td align="left" valign="top" style="padding:3px 9px"><strong><?php echo $attributes['option_label'] ?></strong></td>
31-
<td>&nbsp;</td>
32-
<td>&nbsp;</td>
33-
<td>&nbsp;</td>
34-
</tr>
35-
<?php $_prevOptionId = $attributes['option_id'] ?>
22+
<?php $_prevOptionId = '' ?>
23+
24+
<?php foreach ($items as $_item): ?>
25+
26+
<?php
27+
// As part of invoice item renderer logic, the order is set on each invoice item.
28+
// In the case of a bundle product, this template takes over rendering its children,
29+
// so it is necessary to pass the order along to each child.
30+
$_item->setOrder($_order);
31+
?>
32+
33+
<?php if ($_item->getOrderItem()->getParentItem()): ?>
34+
<?php $attributes = $block->getSelectionAttributes($_item) ?>
35+
<?php if ($_prevOptionId != $attributes['option_id']): ?>
36+
<tr class="bundle-option-label">
37+
<td colspan="3">
38+
<strong><?= $attributes['option_label'] ?></strong>
39+
</td>
40+
</tr>
41+
<?php $_prevOptionId = $attributes['option_id'] ?>
42+
<?php endif; ?>
3643
<?php endif; ?>
37-
<?php endif; ?>
38-
<tr id="order-item-row-<?php echo $_item->getId() ?>">
3944
<?php if (!$_item->getOrderItem()->getParentItem()): ?>
40-
<td align="left" valign="top" style="padding:3px 9px"><strong><?php echo $block->escapeHtml($_item->getName()) ?></strong></td>
45+
<tr class="bundle-item bundle-parent">
46+
<td class="item-info">
47+
<p class="product-name"><?= $block->escapeHtml($_item->getName()) ?></p>
48+
<p class="sku"><?= __('SKU'); ?>: <?= $block->escapeHtml($block->getSku($_item)) ?></p>
49+
</td>
4150
<?php else: ?>
42-
<td align="left" valign="top" style="padding:3px 19px"><?php echo $block->getValueHtml($_item)?></td>
51+
<tr class="bundle-item bundle-option-value">
52+
<td class="item-info">
53+
<p><?= $block->getValueHtml($_item)?></p>
54+
</td>
4355
<?php endif; ?>
44-
<td align="left" valign="top" style="padding:3px 9px"><?php echo $block->escapeHtml($_item->getSku()) ?></td>
45-
<td align="center" valign="top" style="padding:3px 9px">
46-
<?php if ($block->canShowPriceInfo($_item)): ?>
47-
<?php echo $_item->getQty()*1 ?>
48-
<?php else: ?>
49-
&nbsp;
50-
<?php endif; ?>
51-
</td>
52-
<td align="right" valign="top" style="padding:3px 9px">
53-
<?php if ($block->canShowPriceInfo($_item)): ?>
54-
<?php echo $block->getItemPrice($_item); ?>
55-
<?php else: ?>
56-
&nbsp;
57-
<?php endif; ?>
58-
</td>
59-
</tr>
56+
<td class="item-qty">
57+
<?php if ($block->canShowPriceInfo($_item)): ?>
58+
<?= $_item->getQty() * 1 ?>
59+
<?php else: ?>
60+
&nbsp;
61+
<?php endif; ?>
62+
</td>
63+
<td class="item-price">
64+
<?php if ($block->canShowPriceInfo($_item)): ?>
65+
<?= $block->getItemPrice($_item) ?>
66+
<?php else: ?>
67+
&nbsp;
68+
<?php endif; ?>
69+
</td>
70+
</tr>
71+
6072
<?php endforeach; ?>
6173

6274
<?php if ($_showlastRow): ?>
63-
<tr>
64-
<td align="left" valign="top" style="padding:3px 9px">
65-
<?php if ($block->getItemOptions()): ?>
66-
<dl style="margin:0; padding:0;">
67-
<?php foreach ($block->getItemOptions() as $option): ?>
68-
<dt><strong><em><?php echo $option['label'] ?></em></strong></dt>
69-
<dd style="margin:0; padding:0 0 0 9px;"><?php echo $option['value'] ?></dd>
70-
<?php endforeach; ?>
71-
</dl>
72-
<?php endif; ?>
73-
<?php echo $block->escapeHtml($_item->getDescription()) ?>
74-
</td>
75-
<td>&nbsp;</td>
76-
<td>&nbsp;</td>
77-
<td>&nbsp;</td>
78-
</tr>
75+
<tr>
76+
<td colspan="3" class="item-extra">
77+
<?php if ($block->getItemOptions()): ?>
78+
<dl>
79+
<?php foreach ($block->getItemOptions() as $option): ?>
80+
<dt><strong><em><?= $option['label'] ?></em></strong></dt>
81+
<dd><?= $option['value'] ?></dd>
82+
<?php endforeach; ?>
83+
</dl>
84+
<?php endif; ?>
85+
<?= $block->escapeHtml($_item->getDescription()) ?>
86+
</td>
87+
</tr>
7988
<?php endif; ?>

0 commit comments

Comments
 (0)