Skip to content

Commit d653583

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop Minor Fixes
Accepted Public Pull Requests: - #21197: [Ui] Fixing the changing state of dropdown's icon (by @eduard13) - #21227: remove-duplicated-media (by @priti2jcommerce) - #20839: Checkout shipping tooltip 20838 (by @abrarpathan19) - #19566: Minimum Qty Allowed in Shopping Cart not working on related product (by @mageprince) - #20237: Backend: User Role Checkbox alignement. (by @suryakant-krish) - #19679: #19575 magentoDataFixture should allow to use Module Prefix - Integrations Test (by @larsroettig) - #19487: Fix DHL Quotes for Domestic Shipments when Content Type is set to Non-Document (by @gwharton) - #19191: Customer related values are NULL for guests converted to customers after checkout. #19166 (by @Nazar65) Fixed GitHub Issues: - #21196: [UI] The dropdown state doesn't change if the dropdown is expanded or not (reported by @eduard13) has been fixed in #21197 by @eduard13 in 2.3-develop branch Related commits: 1. 90f6ad5 - #20838: Luma theme shipping tool tip icon cut from leftside (reported by @abrarpathan19) has been fixed in #20839 by @abrarpathan19 in 2.3-develop branch Related commits: 1. b76711c - magento/community-features#113: magentoDataFixture should allow to use Module Prefix - Integrations Test (reported by @larsroettig) has been fixed in #19679 by @larsroettig in 2.3-develop branch Related commits: 1. 69ca6d7 2. a055fa1 3. 1bd5fff - #19485: DHL Shipping Quotes fail for Domestic Shipments when Content Mode is "Non Documents" (reported by @gwharton) has been fixed in #19487 by @gwharton in 2.3-develop branch Related commits: 1. 77a5cd1 2. ff9282d 3. d9ac0d6 - #19166: Customer related values are NULL for guests converted to customers after checkout. (reported by @qsolutions-pl) has been fixed in #19191 by @Nazar65 in 2.3-develop branch Related commits: 1. ccba420 2. f8a6d05 3. 7607c82 4. 560e1d7 5. 125de74 6. 5fb9c52 7. e20c7ef 8. 7d22ae8
2 parents 95dc3f5 + 59d725c commit d653583

File tree

18 files changed

+362
-119
lines changed

18 files changed

+362
-119
lines changed

app/code/Magento/Checkout/Model/Cart.php

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Shopping cart model
1717
*
1818
* @api
19+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1920
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2021
* @deprecated 100.1.0 Use \Magento\Quote\Model\Quote instead
2122
* @see \Magento\Quote\Api\Data\CartInterface
@@ -365,20 +366,10 @@ protected function _getProductRequest($requestInfo)
365366
public function addProduct($productInfo, $requestInfo = null)
366367
{
367368
$product = $this->_getProduct($productInfo);
368-
$request = $this->_getProductRequest($requestInfo);
369369
$productId = $product->getId();
370370

371371
if ($productId) {
372-
$stockItem = $this->stockRegistry->getStockItem($productId, $product->getStore()->getWebsiteId());
373-
$minimumQty = $stockItem->getMinSaleQty();
374-
//If product quantity is not specified in request and there is set minimal qty for it
375-
if ($minimumQty
376-
&& $minimumQty > 0
377-
&& !$request->getQty()
378-
) {
379-
$request->setQty($minimumQty);
380-
}
381-
372+
$request = $this->getQtyRequest($product, $requestInfo);
382373
try {
383374
$this->_eventManager->dispatch(
384375
'checkout_cart_product_add_before',
@@ -438,8 +429,9 @@ public function addProductsByIds($productIds)
438429
}
439430
$product = $this->_getProduct($productId);
440431
if ($product->getId() && $product->isVisibleInCatalog()) {
432+
$request = $this->getQtyRequest($product);
441433
try {
442-
$this->getQuote()->addProduct($product);
434+
$this->getQuote()->addProduct($product, $request);
443435
} catch (\Exception $e) {
444436
$allAdded = false;
445437
}
@@ -762,4 +754,27 @@ private function getRequestInfoFilter()
762754
}
763755
return $this->requestInfoFilter;
764756
}
757+
758+
/**
759+
* Get request quantity
760+
*
761+
* @param Product $product
762+
* @param \Magento\Framework\DataObject|int|array $request
763+
* @return int|DataObject
764+
*/
765+
private function getQtyRequest($product, $request = 0)
766+
{
767+
$request = $this->_getProductRequest($request);
768+
$stockItem = $this->stockRegistry->getStockItem($product->getId(), $product->getStore()->getWebsiteId());
769+
$minimumQty = $stockItem->getMinSaleQty();
770+
//If product quantity is not specified in request and there is set minimal qty for it
771+
if ($minimumQty
772+
&& $minimumQty > 0
773+
&& !$request->getQty()
774+
) {
775+
$request->setQty($minimumQty);
776+
}
777+
778+
return $request;
779+
}
765780
}

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/>
6464
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
6565
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeAdminOrderStatus"/>
66-
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="Guest" stepKey="seeAdminOrderGuest"/>
66+
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="{{CustomerEntityOne.fullname}}" stepKey="seeAdminOrderGuest"/>
6767
<see selector="{{AdminOrderDetailsInformationSection.accountInformation}}" userInput="{{CustomerEntityOne.email}}" stepKey="seeAdminOrderEmail"/>
6868
<see selector="{{AdminOrderDetailsInformationSection.billingAddress}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeAdminOrderBillingAddress"/>
6969
<see selector="{{AdminOrderDetailsInformationSection.shippingAddress}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="seeAdminOrderShippingAddress"/>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<data key="firstname">John</data>
2222
<data key="lastname">Doe</data>
2323
<data key="middlename">S</data>
24+
<data key="fullname">John Doe</data>
2425
<data key="password">pwdTest123!</data>
2526
<data key="prefix">Mr</data>
2627
<data key="suffix">Sr</data>

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,9 +1964,7 @@ protected function isDutiable($origCountryId, $destCountryId) : bool
19641964
{
19651965
$this->_checkDomesticStatus($origCountryId, $destCountryId);
19661966

1967-
return
1968-
self::DHL_CONTENT_TYPE_NON_DOC == $this->getConfigData('content_type')
1969-
|| !$this->_isDomestic;
1967+
return !$this->_isDomestic;
19701968
}
19711969

19721970
/**

0 commit comments

Comments
 (0)