Skip to content

Commit 253d431

Browse files
committed
MAGETWO-69236: Add configurations for change email templates [2.1 backport] #9661
- Merge Pull Request #9661 from kassner/magento2:patch-9
2 parents 8a84178 + a19ea13 commit 253d431

File tree

18 files changed

+183
-34
lines changed

18 files changed

+183
-34
lines changed

app/code/Magento/Config/Model/Config/Backend/Email/Logo.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Config\Model\Config\Backend\Email;
1313

14+
/**
15+
* @deprecated
16+
*/
1417
class Logo extends \Magento\Config\Model\Config\Backend\Image
1518
{
1619
/**

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@
176176
<frontend_class>required-entry validate-digits</frontend_class>
177177
</field>
178178
</group>
179+
<group id="account_information" translate="label" type="text" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="1">
180+
<label>Account Information Options</label>
181+
<field id="change_email_template" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
182+
<label>Change Email Template</label>
183+
<comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
184+
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
185+
</field>
186+
<field id="change_email_and_password_template" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
187+
<label>Change Email and Password Template</label>
188+
<comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
189+
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
190+
</field>
191+
</group>
179192
<group id="address" translate="label" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
180193
<label>Name and Address Options</label>
181194
<field id="street_lines" translate="label comment" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ protected function getLogoUrl($store)
389389
$store
390390
);
391391
if ($fileName) {
392-
$uploadDir = \Magento\Config\Model\Config\Backend\Email\Logo::UPLOAD_DIR;
392+
$uploadDir = \Magento\Email\Model\Design\Backend\Logo::UPLOAD_DIR;
393393
$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
394394
if ($mediaDirectory->isFile($uploadDir . '/' . $fileName)) {
395395
return $this->storeManager->getStore()->getBaseUrl(
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Email\Model\Design\Backend;
7+
8+
use Magento\Theme\Model\Design\Backend\Logo as DesignLogo;
9+
10+
class Logo extends DesignLogo
11+
{
12+
/**
13+
* The tail part of directory path for uploading
14+
*/
15+
const UPLOAD_DIR = 'email/logo';
16+
17+
/**
18+
* Upload max file size in kilobytes
19+
*
20+
* @var int
21+
*/
22+
protected $maxFileSize = 2048;
23+
24+
/**
25+
* Getter for allowed extensions of uploaded files
26+
*
27+
* @return string[]
28+
*/
29+
public function getAllowedExtensions()
30+
{
31+
return ['jpg', 'jpeg', 'gif', 'png'];
32+
}
33+
}

app/code/Magento/Email/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
6+
"magento/module-theme": "100.1.*",
67
"magento/module-config": "100.1.*",
78
"magento/module-store": "100.1.*",
89
"magento/module-cms": "101.0.*",

app/code/Magento/Email/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<item name="email_logo" xsi:type="array">
2828
<item name="path" xsi:type="string">design/email/logo</item>
2929
<item name="fieldset" xsi:type="string">other_settings/email</item>
30-
<item name="backend_model" xsi:type="string">Magento\Theme\Model\Design\Backend\Logo</item>
30+
<item name="backend_model" xsi:type="string">Magento\Email\Model\Design\Backend\Logo</item>
3131
<item name="base_url" xsi:type="array">
3232
<item name="type" xsi:type="string">media</item>
3333
<item name="scope_info" xsi:type="string">1</item>

app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockcsv.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<update handle="reports_report_product_lowstock_grid"/>
1010
<body>
11-
<container name="adminhtml.block.report.product.lowstock.grid.container" label="Export CSV"/>
11+
<block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/>
1212
</body>
1313
</page>

app/code/Magento/Reports/view/adminhtml/layout/reports_report_product_exportlowstockexcel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
99
<update handle="reports_report_product_lowstock_grid"/>
1010
<body>
11-
<container name="adminhtml.block.report.product.lowstock.grid.container" label="Excel XML"/>
11+
<block class="Magento\Backend\Block\Widget\Grid\Container" name="adminhtml.report.grid.container" template="Magento_Backend::widget/grid/container/empty.phtml"/>
1212
</body>
1313
</page>

app/code/Magento/Theme/Model/Design/Backend/Logo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Logo extends Image
2121
*/
2222
protected function _getUploadDir()
2323
{
24-
return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(self::UPLOAD_DIR));
24+
return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(static::UPLOAD_DIR));
2525
}
2626

2727
/**

app/code/Magento/Wishlist/Pricing/ConfiguredPrice/ConfigurableProduct.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ class ConfigurableProduct extends FinalPrice implements ConfiguredPriceInterface
2121
*/
2222
public function getValue()
2323
{
24-
$result = 0.;
2524
/** @var \Magento\Wishlist\Model\Item\Option $customOption */
2625
$customOption = $this->getProduct()->getCustomOption('simple_product');
27-
if ($customOption) {
28-
/** @var \Magento\Framework\Pricing\PriceInfoInterface $priceInfo */
29-
$priceInfo = $customOption->getProduct()->getPriceInfo();
30-
$result = $priceInfo->getPrice(self::PRICE_CODE)->getValue();
31-
}
32-
return max(0, $result);
26+
$product = $customOption ? $customOption->getProduct() : $this->getProduct();
27+
$price = $product->getPriceInfo()->getPrice(self::PRICE_CODE)->getValue();
28+
29+
return max(0, $price);
3330
}
3431

3532
/**

0 commit comments

Comments
 (0)