Skip to content

Commit 191200c

Browse files
Merge branch 2.3-develop into ENGCOM-4394-magento-magento2-21474
2 parents 18e164f + 062662d commit 191200c

File tree

67 files changed

+1606
-436
lines changed

Some content is hidden

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

67 files changed

+1606
-436
lines changed

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* @method Quote setOrderId($orderId)
2525
* @method int getOrderId()
2626
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
27+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2728
* @since 100.0.2
2829
*/
2930
class Quote extends \Magento\Framework\Session\SessionManager
@@ -149,7 +150,8 @@ public function getQuote()
149150
$this->_quote = $this->quoteFactory->create();
150151
if ($this->getStoreId()) {
151152
if (!$this->getQuoteId()) {
152-
$this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId());
153+
$customerGroupId = $this->groupManagement->getDefaultGroup($this->getStoreId())->getId();
154+
$this->_quote->setCustomerGroupId($customerGroupId);
153155
$this->_quote->setIsActive(false);
154156
$this->_quote->setStoreId($this->getStoreId());
155157

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ public function testGetQuoteWithoutQuoteId()
267267
$cartInterfaceMock->expects($this->atLeastOnce())->method('getId')->willReturn($quoteId);
268268
$defaultGroup = $this->getMockBuilder(\Magento\Customer\Api\Data\GroupInterface::class)->getMock();
269269
$defaultGroup->expects($this->any())->method('getId')->will($this->returnValue($customerGroupId));
270-
$this->groupManagementMock->expects($this->any())->method('getDefaultGroup')->willReturn($defaultGroup);
270+
$this->groupManagementMock
271+
->method('getDefaultGroup')
272+
->with($storeId)
273+
->willReturn($defaultGroup);
271274

272275
$dataCustomerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)
273276
->disableOriginalConstructor()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
<group id="debug" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
113113
<label>Debug</label>
114114
<field id="template_hints_storefront" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
115-
<label>Enabled Template Path Hints for Storefront</label>
115+
<label>Enable Template Path Hints for Storefront</label>
116116
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
117117
</field>
118118
<field id="template_hints_storefront_show_with_parameter" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
@@ -132,7 +132,7 @@
132132
<comment>Add the following parameter to the URL to show template hints ?templatehints=[parameter_value]</comment>
133133
</field>
134134
<field id="template_hints_admin" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
135-
<label>Enabled Template Path Hints for Admin</label>
135+
<label>Enable Template Path Hints for Admin</label>
136136
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
137137
</field>
138138
<field id="template_hints_blocks" translate="label" type="select" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1">

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,11 @@ public function delete(ProductInterface $product)
644644
unset($this->instancesById[$product->getId()]);
645645
$this->resourceModel->delete($product);
646646
} catch (ValidatorException $e) {
647-
throw new CouldNotSaveException(__($e->getMessage()));
647+
throw new CouldNotSaveException(__($e->getMessage()), $e);
648648
} catch (\Exception $e) {
649649
throw new \Magento\Framework\Exception\StateException(
650-
__('The "%1" product couldn\'t be removed.', $sku)
650+
__('The "%1" product couldn\'t be removed.', $sku),
651+
$e
651652
);
652653
}
653654
$this->removeProductFromLocalCache($sku);

app/code/Magento/Catalog/Pricing/Price/MinimalTierPriceCalculator.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public function __construct(CalculatorInterface $calculator)
2929
}
3030

3131
/**
32-
* Get raw value of "as low as" as a minimal among tier prices
33-
* {@inheritdoc}
32+
* Get raw value of "as low as" as a minimal among tier prices{@inheritdoc}
33+
*
34+
* @param SaleableInterface $saleableItem
35+
* @return float|null
3436
*/
3537
public function getValue(SaleableInterface $saleableItem)
3638
{
@@ -49,15 +51,17 @@ public function getValue(SaleableInterface $saleableItem)
4951
}
5052

5153
/**
52-
* Return calculated amount object that keeps "as low as" value
53-
* {@inheritdoc}
54+
* Return calculated amount object that keeps "as low as" value{@inheritdoc}
55+
*
56+
* @param SaleableInterface $saleableItem
57+
* @return AmountInterface|null
5458
*/
5559
public function getAmount(SaleableInterface $saleableItem)
5660
{
5761
$value = $this->getValue($saleableItem);
5862

5963
return $value === null
6064
? null
61-
: $this->calculator->getAmount($value, $saleableItem);
65+
: $this->calculator->getAmount($value, $saleableItem, 'tax');
6266
}
6367
}

app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
$label = $block->getChildData($alias, 'title');
2323
?>
2424
<div class="data item title"
25-
aria-labelledby="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title"
2625
data-role="collapsible" id="tab-label-<?= /* @escapeNotVerified */ $alias ?>">
2726
<a class="data switch"
2827
tabindex="-1"
29-
data-toggle="switch"
28+
data-toggle="trigger"
3029
href="#<?= /* @escapeNotVerified */ $alias ?>"
3130
id="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title">
3231
<?= /* @escapeNotVerified */ $label ?>
3332
</a>
3433
</div>
35-
<div class="data item content" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
34+
<div class="data item content"
35+
aria-labelledby="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
3636
<?= /* @escapeNotVerified */ $html ?>
3737
</div>
3838
<?php endforeach;?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogInventory\Ui\DataProvider\Product;
9+
10+
use Magento\Framework\Data\Collection;
11+
use Magento\Ui\DataProvider\AddFieldToCollectionInterface;
12+
13+
/**
14+
* Add quantity_and_stock_status field to collection
15+
*/
16+
class AddQuantityAndStockStatusFieldToCollection implements AddFieldToCollectionInterface
17+
{
18+
/**
19+
* @inheritdoc
20+
*/
21+
public function addField(Collection $collection, $field, $alias = null)
22+
{
23+
$collection->joinField(
24+
'quantity_and_stock_status',
25+
'cataloginventory_stock_item',
26+
'is_in_stock',
27+
'product_id=entity_id',
28+
'{{table}}.stock_id=1',
29+
'left'
30+
);
31+
}
32+
}

app/code/Magento/CatalogInventory/etc/adminhtml/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<arguments>
2424
<argument name="addFieldStrategies" xsi:type="array">
2525
<item name="qty" xsi:type="object">Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFieldToCollection</item>
26+
<item name="quantity_and_stock_status" xsi:type="object">Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityAndStockStatusFieldToCollection</item>
2627
</argument>
2728
<argument name="addFilterStrategies" xsi:type="array">
2829
<item name="qty" xsi:type="object">Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection</item>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Checkout\Controller\Cart;
89

910
use Magento\Checkout\Model\Cart as CustomerCart;
11+
use Magento\Framework\App\Action\HttpPostActionInterface;
1012
use Magento\Framework\Escaper;
1113
use Magento\Framework\App\ObjectManager;
1214
use Magento\Sales\Model\Order\Item;
1315

1416
/**
17+
* Add grouped items controller.
18+
*
1519
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1620
*/
17-
class Addgroup extends \Magento\Checkout\Controller\Cart
21+
class Addgroup extends \Magento\Checkout\Controller\Cart implements HttpPostActionInterface
1822
{
1923
/**
2024
* @var Escaper
@@ -44,6 +48,8 @@ public function __construct(
4448
}
4549

4650
/**
51+
* Add items in group.
52+
*
4753
* @return \Magento\Framework\Controller\Result\Redirect
4854
*/
4955
public function execute()
@@ -74,6 +80,8 @@ public function execute()
7480
}
7581
}
7682
$this->cart->save();
83+
} else {
84+
$this->messageManager->addErrorMessage(__('Please select at least one product to add to cart'));
7785
}
7886
return $this->_goBack();
7987
}

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
method="post"
1515
id="form-validate"
1616
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart":
17-
{"validationURL" : "/checkout/cart/updateItemQty"}
17+
{"validationURL" : "/checkout/cart/updateItemQty",
18+
"updateCartActionContainer": "#update_cart_action_container"}
1819
}'
1920
class="form form-cart">
2021
<?= $block->getBlockHtml('formkey') ?>

0 commit comments

Comments
 (0)