Skip to content

Commit 9a85905

Browse files
committed
Merge remote-tracking branch 'main_ce/develop' into static_tests
2 parents f1c9fdf + 2410622 commit 9a85905

File tree

32 files changed

+1085
-170
lines changed

32 files changed

+1085
-170
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<preference for="Magento\Backend\Model\Config\Structure\SearchInterface" type="Magento\Backend\Model\Config\Structure" />
1313
<preference for="Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Backend\Model\Config\Backend\File\RequestData" />
1414
<preference for="Magento\Backend\Model\Auth\Credential\StorageInterface" type="Magento\User\Model\User" />
15-
<preference for="Magento\Adminhtml\Helper\Data" type="Magento\Backend\Helper\Data" />
1615
<preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" />
1716
<preference for="Magento\Backend\Model\UrlInterface" type="Magento\Backend\Model\Url" />
1817
<preference for="Magento\Backend\Block\Widget\Button\ToolbarInterface" type="Magento\Backend\Block\Widget\Button\Toolbar" />

app/code/Magento/Checkout/Controller/Cart/Index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Index extends \Magento\Checkout\Controller\Cart
1818
*/
1919
public function execute()
2020
{
21+
$this->_eventManager->dispatch('collect_totals_failed_items');
2122
if ($this->cart->getQuote()->getItemsCount()) {
2223
$this->cart->init();
2324
$this->cart->save();

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
<preference for="Magento\Framework\Authorization\PolicyInterface" type="Magento\Framework\Authorization\Policy\DefaultPolicy" />
1515
<preference for="Magento\Framework\Authorization\RoleLocatorInterface" type="Magento\Framework\Authorization\RoleLocator\DefaultRoleLocator" />
1616
<preference for="Magento\Framework\Session\SessionManagerInterface" type="Magento\Framework\Session\Generic" />
17-
<preference for="Magento\Core\Model\DataService\ConfigInterface" type="Magento\Core\Model\DataService\Config" />
1817
<preference for="Magento\Framework\App\Config\ScopeConfigInterface" type="Magento\Framework\App\Config" />
1918
<preference for="Magento\Framework\App\Config\ReinitableConfigInterface" type="Magento\Framework\App\ReinitableConfig" />
2019
<preference for="Magento\Framework\App\Config\MutableScopeConfigInterface" type="Magento\Framework\App\MutableScopeConfig" />
2120
<preference for="Magento\Framework\App\Config\Storage\WriterInterface" type="Magento\Framework\App\Config\Storage\Writer" />
2221
<preference for="Magento\Framework\View\Design\Theme\FileInterface" type="Magento\Core\Model\Theme\File" />
2322
<preference for="Magento\Framework\Config\ConverterInterface" type="Magento\Framework\Config\Converter\Dom"/>
24-
<preference for="Magento\Core\Model\Url\SecurityInfoInterface" type="Magento\Core\Model\Url\SecurityInfo\Proxy" />
2523
<preference for="Magento\Framework\App\DefaultPathInterface" type="Magento\Framework\App\DefaultPath\DefaultPath" />
2624
<preference for="Magento\Framework\Encryption\EncryptorInterface" type="Magento\Framework\Encryption\Encryptor" />
2725
<preference for="Magento\Framework\Filter\Encrypt\AdapterInterface" type="Magento\Framework\Filter\Encrypt\Basic" />
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\OfflinePayments\Block\Form;
7+
8+
/**
9+
* Abstract class for Cash On Delivery and Bank Transfer payment method form
10+
*/
11+
abstract class AbstractInstruction extends \Magento\Payment\Block\Form
12+
{
13+
/**
14+
* Instructions text
15+
*
16+
* @var string
17+
*/
18+
protected $_instructions;
19+
20+
/**
21+
* Get instructions text from config
22+
*
23+
* @return string
24+
*/
25+
public function getInstructions()
26+
{
27+
if (is_null($this->_instructions)) {
28+
$this->_instructions = $this->getMethod()->getInstructions();
29+
}
30+
return $this->_instructions;
31+
}
32+
}

app/code/Magento/OfflinePayments/Block/Form/Banktransfer.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,12 @@
88
/**
99
* Block for Bank Transfer payment method form
1010
*/
11-
class Banktransfer extends \Magento\Payment\Block\Form
11+
class Banktransfer extends \Magento\OfflinePayments\Block\Form\AbstractInstruction
1212
{
13-
/**
14-
* Instructions text
15-
*
16-
* @var string
17-
*/
18-
protected $_instructions;
19-
2013
/**
2114
* Bank transfer template
2215
*
2316
* @var string
2417
*/
2518
protected $_template = 'form/banktransfer.phtml';
26-
27-
/**
28-
* Get instructions text from config
29-
*
30-
* @return string
31-
*/
32-
public function getInstructions()
33-
{
34-
if (is_null($this->_instructions)) {
35-
$this->_instructions = $this->getMethod()->getInstructions();
36-
}
37-
return $this->_instructions;
38-
}
3919
}

app/code/Magento/OfflinePayments/Block/Form/Cashondelivery.php

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,12 @@
88
/**
99
* Block for Cash On Delivery payment method form
1010
*/
11-
class Cashondelivery extends \Magento\Payment\Block\Form
11+
class Cashondelivery extends \Magento\OfflinePayments\Block\Form\AbstractInstruction
1212
{
13-
/**
14-
* Instructions text
15-
*
16-
* @var string
17-
*/
18-
protected $_instructions;
19-
2013
/**
2114
* Cash on delivery template
2215
*
2316
* @var string
2417
*/
2518
protected $_template = 'form/cashondelivery.phtml';
26-
27-
/**
28-
* Get instructions text from config
29-
*
30-
* @return string
31-
*/
32-
public function getInstructions()
33-
{
34-
if (is_null($this->_instructions)) {
35-
$this->_instructions = $this->getMethod()->getInstructions();
36-
}
37-
return $this->_instructions;
38-
}
3919
}

app/code/Magento/OfflinePayments/Model/Banktransfer.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,4 @@ class Banktransfer extends \Magento\Payment\Model\Method\AbstractMethod
3939
* @var bool
4040
*/
4141
protected $_isOffline = true;
42-
43-
/**
44-
* Get instructions text from config
45-
*
46-
* @return string
47-
*/
48-
public function getInstructions()
49-
{
50-
return trim($this->getConfigData('instructions'));
51-
}
5242
}

app/code/Magento/OfflinePayments/Model/Observer.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ public function beforeOrderPaymentSave(\Magento\Framework\Event\Observer $observ
2121
{
2222
/** @var \Magento\Sales\Model\Order\Payment $payment */
2323
$payment = $observer->getEvent()->getPayment();
24-
$banktransfer = \Magento\OfflinePayments\Model\Banktransfer::PAYMENT_METHOD_BANKTRANSFER_CODE;
25-
if ($payment->getMethod() === $banktransfer) {
26-
$payment->setAdditionalInformation('instructions', $payment->getMethodInstance()->getInstructions());
24+
if ($payment->getMethod() === Banktransfer::PAYMENT_METHOD_BANKTRANSFER_CODE) {
25+
$payment->setAdditionalInformation(
26+
'instructions',
27+
$payment->getMethodInstance()->getConfigData('instructions')
28+
);
2729
}
2830
}
2931
}

app/code/Magento/OfflineShipping/Model/Config/Backend/Tablerate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function __construct(
4646
*/
4747
public function afterSave()
4848
{
49-
$this->_tablerateFactory->create()->uploadAndImport($this);
49+
/** @var \Magento\OfflineShipping\Model\Resource\Carrier\Tablerate $tableRate */
50+
$tableRate = $this->_tablerateFactory->create();
51+
$tableRate->uploadAndImport($this);
5052
}
5153
}

app/code/Magento/OfflineShipping/Model/Observer/SalesRule/ActionsTab.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,24 @@ public function prepareForm($observer)
2424
$form = $observer->getForm();
2525
foreach ($form->getElements() as $element) {
2626
/** @var \Magento\Framework\Data\Form\Element\AbstractElement $element */
27-
if ($element->getId() == 'action_fieldset') {
28-
$element->addField(
29-
'simple_free_shipping',
30-
'select',
31-
[
32-
'label' => __('Free Shipping'),
33-
'title' => __('Free Shipping'),
34-
'name' => 'simple_free_shipping',
35-
'options' => [
36-
0 => __('No'),
37-
Rule::FREE_SHIPPING_ITEM => __('For matching items only'),
38-
Rule::FREE_SHIPPING_ADDRESS => __('For shipment with matching items'),
39-
]
40-
]
41-
);
27+
if ($element->getId() != 'action_fieldset') {
28+
continue;
4229
}
30+
31+
$element->addField(
32+
'simple_free_shipping',
33+
'select',
34+
[
35+
'label' => __('Free Shipping'),
36+
'title' => __('Free Shipping'),
37+
'name' => 'simple_free_shipping',
38+
'options' => [
39+
0 => __('No'),
40+
Rule::FREE_SHIPPING_ITEM => __('For matching items only'),
41+
Rule::FREE_SHIPPING_ADDRESS => __('For shipment with matching items'),
42+
]
43+
]
44+
);
4345
}
4446
}
4547
}

0 commit comments

Comments
 (0)