Skip to content

Commit a6720f0

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.3-develop expedited
Accepted Community Pull Requests: - #22937: Mark Elasticsearch 6 support for synonyms (by @aapokiiso) - #23081: Fix missing whitespace in mobile navigation for non-English websites (by @alexeya-ven) - #22426: Fixed wrong url redirect when edit product review from Customer view page (by @ravi-chandra3197) - #22834: #16445 - getRegionHtmlSelect does not have configuration - resolved (by @nikunjskd20) - #14384: Don't throw shipping method exception when creating quote with only virtual products in API (by @Maikel-Koek) - #22521: Fixed 22511 (by @maheshWebkul721) - #22626: resolved typo error (by @nehaguptacedcoss) Fixed GitHub Issues: - #23080: Missing whitespace in mobile navigation for non-English websites (reported by @alexeya-ven) has been fixed in #23081 by @alexeya-ven in 2.3-develop branch Related commits: 1. 0155121 - #22425: wrong url redirect when edit product review from Customer view page (reported by @ketan-krish) has been fixed in #22426 by @ravi-chandra3197 in 2.3-develop branch Related commits: 1. 19e7380 - #22511: Special From Date set to today's date when Use Default Date checked in Store scope (reported by @squeegy06) has been fixed in #22521 by @maheshWebkul721 in 2.3-develop branch Related commits: 1. db71c65
2 parents df12845 + 6a3a3b3 commit a6720f0

File tree

10 files changed

+208
-14
lines changed

10 files changed

+208
-14
lines changed

app/code/Magento/Catalog/Observer/SetSpecialPriceStartDate.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
3838
{
3939
/** @var $product \Magento\Catalog\Model\Product */
4040
$product = $observer->getEvent()->getProduct();
41-
if ($product->getSpecialPrice() && ! $product->getSpecialFromDate()) {
41+
if ($product->getSpecialPrice() && $product->getSpecialFromDate() === null) {
4242
$product->setData('special_from_date', $this->localeDate->date()->setTime(0, 0));
4343
}
44-
4544
return $this;
4645
}
4746
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ public function saveAddressInformation(
191191

192192
$shippingAddress = $quote->getShippingAddress();
193193

194-
if (!$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod())) {
194+
if (!$quote->getIsVirtual()
195+
&& !$shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod())
196+
) {
195197
throw new NoSuchEntityException(
196198
__('Carrier with such method not found: %1, %2', $carrierCode, $methodCode)
197199
);

app/code/Magento/Directory/Block/Data.php

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Directory\Block;
79

810
/**
@@ -173,10 +175,33 @@ public function getRegionCollection()
173175
* Returns region html select
174176
*
175177
* @return string
178+
* @deprecated
179+
* @see getRegionSelect() method for more configurations
176180
*/
177181
public function getRegionHtmlSelect()
178182
{
183+
return $this->getRegionSelect();
184+
}
185+
186+
/**
187+
* Returns region html select
188+
*
189+
* @param null|int $value
190+
* @param string $name
191+
* @param string $id
192+
* @param string $title
193+
* @return string
194+
*/
195+
public function getRegionSelect(
196+
?int $value = null,
197+
string $name = 'region',
198+
string $id = 'state',
199+
string $title = 'State/Province'
200+
): string {
179201
\Magento\Framework\Profiler::start('TEST: ' . __METHOD__, ['group' => 'TEST', 'method' => __METHOD__]);
202+
if ($value === null) {
203+
$value = (int)$this->getRegionId();
204+
}
180205
$cacheKey = 'DIRECTORY_REGION_SELECT_STORE' . $this->_storeManager->getStore()->getId();
181206
$cache = $this->_configCacheType->load($cacheKey);
182207
if ($cache) {
@@ -188,15 +213,15 @@ public function getRegionHtmlSelect()
188213
$html = $this->getLayout()->createBlock(
189214
\Magento\Framework\View\Element\Html\Select::class
190215
)->setName(
191-
'region'
216+
$name
192217
)->setTitle(
193-
__('State/Province')
218+
__($title)
194219
)->setId(
195-
'state'
220+
$id
196221
)->setClass(
197222
'required-entry validate-state'
198223
)->setValue(
199-
(int)$this->getRegionId()
224+
$value
200225
)->setOptions(
201226
$options
202227
)->getHtml();

app/code/Magento/Elasticsearch/etc/search_engine.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99
<engine name="elasticsearch">
1010
<feature name="synonyms" support="true" />
1111
</engine>
12+
<engine name="elasticsearch5">
13+
<feature name="synonyms" support="true" />
14+
</engine>
1215
</engines>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<engines xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Search/etc/search_engine.xsd">
9+
<engine name="elasticsearch6">
10+
<feature name="synonyms" support="true" />
11+
</engine>
12+
</engines>

app/code/Magento/Review/Block/Adminhtml/Edit/Form.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,25 @@ protected function _prepareForm()
7575
$review = $this->_coreRegistry->registry('review_data');
7676
$product = $this->_productFactory->create()->load($review->getEntityPkValue());
7777

78+
$formActionParams = [
79+
'id' => $this->getRequest()->getParam('id'),
80+
'ret' => $this->_coreRegistry->registry('ret')
81+
];
82+
if ($this->getRequest()->getParam('productId')) {
83+
$formActionParams['productId'] = $this->getRequest()->getParam('productId');
84+
}
85+
if ($this->getRequest()->getParam('customerId')) {
86+
$formActionParams['customerId'] = $this->getRequest()->getParam('customerId');
87+
}
88+
7889
/** @var \Magento\Framework\Data\Form $form */
7990
$form = $this->_formFactory->create(
8091
[
8192
'data' => [
8293
'id' => 'edit_form',
8394
'action' => $this->getUrl(
8495
'review/*/save',
85-
[
86-
'id' => $this->getRequest()->getParam('id'),
87-
'ret' => $this->_coreRegistry->registry('ret'),
88-
'productId' => $this->getRequest()->getParam('productId')
89-
]
96+
$formActionParams
9097
),
9198
'method' => 'post',
9299
],

app/code/Magento/Review/Controller/Adminhtml/Product/Save.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public function execute()
7777
if ($productId) {
7878
$resultRedirect->setPath("catalog/product/edit/id/$productId");
7979
}
80+
$customerId = (int)$this->getRequest()->getParam('customerId');
81+
if ($customerId) {
82+
$resultRedirect->setPath("customer/index/edit/id/$customerId");
83+
}
8084
return $resultRedirect;
8185
}
8286
$resultRedirect->setPath('review/*/');
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Checkout\Model;
8+
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
use Magento\Checkout\Api\Data\ShippingInformationInterface;
11+
use Magento\Checkout\Api\PaymentInformationManagementInterface;
12+
use Magento\Checkout\Api\ShippingInformationManagementInterface;
13+
use Magento\Customer\Api\CustomerRepositoryInterface;
14+
use Magento\Quote\Api\CartItemRepositoryInterface;
15+
use Magento\Quote\Api\CartManagementInterface;
16+
use Magento\Quote\Api\Data\AddressInterfaceFactory;
17+
use Magento\Quote\Api\Data\CartItemInterface;
18+
use Magento\Quote\Api\Data\PaymentInterface;
19+
use Magento\Quote\Api\ShipmentEstimationInterface;
20+
use Magento\Sales\Api\InvoiceOrderInterface;
21+
22+
/**
23+
* Shipping information managment test.
24+
*/
25+
class ShippingInformationManagementTest extends \PHPUnit\Framework\TestCase
26+
{
27+
/** @var CartManagementInterface */
28+
private $cartManagement;
29+
30+
/** @var CartItemRepositoryInterface */
31+
private $cartItemRepository;
32+
33+
/** @var CartItemInterface */
34+
private $cartItem;
35+
36+
/** @var ShippingInformationManagementInterface */
37+
private $shippingInformationManagement;
38+
39+
/** @var ShippingInformationInterface */
40+
private $shippingInformation;
41+
42+
/** @var CustomerRepositoryInterface */
43+
private $customerRepository;
44+
45+
/** @var AddressInterfaceFactory */
46+
private $apiAddressFactory;
47+
48+
/** @var ShipmentEstimationInterface */
49+
private $shipmentEstimation;
50+
51+
/** @var PaymentInformationManagementInterface */
52+
private $paymentInformationManagement;
53+
54+
/** @var PaymentInterface */
55+
private $payment;
56+
57+
/** @var InvoiceOrderInterface */
58+
private $invoiceOrder;
59+
60+
public function setUp()
61+
{
62+
$objectManager = Bootstrap::getObjectManager();
63+
64+
$this->cartManagement = $objectManager->create(CartManagementInterface::class);
65+
$this->cartItemRepository = $objectManager->create(CartItemRepositoryInterface::class);
66+
$this->cartItem = $objectManager->create(CartItemInterface::class);
67+
$this->shippingInformationManagement = $objectManager->create(ShippingInformationManagementInterface::class);
68+
$this->shippingInformation = $objectManager->create(ShippingInformationInterface::class);
69+
$this->customerRepository = $objectManager->create(CustomerRepositoryInterface::class);
70+
$this->apiAddressFactory = $objectManager->create(AddressInterfaceFactory::class);
71+
$this->shipmentEstimation = $objectManager->create(ShipmentEstimationInterface::class);
72+
$this->paymentInformationManagement = $objectManager->create(PaymentInformationManagementInterface::class);
73+
$this->payment = $objectManager->create(PaymentInterface::class);
74+
$this->invoiceOrder = $objectManager->create(InvoiceOrderInterface::class);
75+
}
76+
77+
/**
78+
* @magentoDataFixture Magento/Customer/_files/customer.php
79+
* @magentoDataFixture Magento/Customer/_files/customer_address.php
80+
* @magentoDataFixture Magento/Catalog/_files/product_virtual_in_stock.php
81+
*/
82+
public function testQuoteApiWithOnlyVirtualProducts()
83+
{
84+
$customer = $this->customerRepository->getById(1);
85+
86+
// Create empty quote
87+
$quoteId = $this->cartManagement->createEmptyCartForCustomer($customer->getId());
88+
89+
$cartItem = $this->cartItem
90+
->setSku('virtual-product')
91+
->setQty(1)
92+
->setQuoteId($quoteId);
93+
94+
// Add item to cart
95+
$this->cartItemRepository->save($cartItem);
96+
97+
$billingAddress = $shippingAddress = null;
98+
foreach ($customer->getAddresses() as $address) {
99+
$billingAddress = $address;
100+
$shippingAddress = $address;
101+
break;
102+
}
103+
104+
/** @var \Magento\Quote\Model\Quote\Address $apiBillingAddress */
105+
$apiBillingAddress = $this->apiAddressFactory->create();
106+
$apiBillingAddress->setRegion($billingAddress->getRegion())
107+
->setRegionId($billingAddress->getRegionId())
108+
->setCountryId($billingAddress->getCountryId())
109+
->setStreet($billingAddress->getStreet())
110+
->setPostcode($billingAddress->getPostcode())
111+
->setCity($billingAddress->getCity())
112+
->setFirstname($billingAddress->getFirstname())
113+
->setLastname($billingAddress->getLastname())
114+
->setEmail($customer->getEmail())
115+
->setTelephone($billingAddress->getTelephone());
116+
117+
/** @var \Magento\Quote\Model\Quote\Address $apiShippingAddress */
118+
$apiShippingAddress = $this->apiAddressFactory->create();
119+
$apiShippingAddress->setRegion($shippingAddress->getRegion())
120+
->setRegionId($shippingAddress->getRegionId())
121+
->setCountryId($shippingAddress->getCountryId())
122+
->setStreet($shippingAddress->getStreet())
123+
->setPostcode($shippingAddress->getPostcode())
124+
->setCity($shippingAddress->getCity())
125+
->setFirstname($shippingAddress->getFirstname())
126+
->setLastname($shippingAddress->getLastname())
127+
->setEmail($customer->getEmail())
128+
->setTelephone($shippingAddress->getTelephone());
129+
130+
// Estimate shipping
131+
$this->shipmentEstimation->estimateByExtendedAddress($quoteId, $apiShippingAddress);
132+
133+
$addressInformation = $this->shippingInformation
134+
->setBillingAddress($apiBillingAddress)
135+
->setShippingAddress($apiShippingAddress)
136+
->setShippingCarrierCode('flatrate')
137+
->setShippingMethodCode('flatrate');
138+
139+
// Set address information on quote
140+
$this->shippingInformationManagement->saveAddressInformation($quoteId, $addressInformation);
141+
}
142+
}

lib/web/css/docs/source/_icons.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
// <td>@icon-sprite__grid</td>
257257
// <td class="vars_value">26px</td>
258258
// <td class="vars_value">'' | false | value</td>
259-
// <td>The size of the grid (in pixels) that the individal images are placed on</td>
259+
// <td>The size of the grid (in pixels) that the individual images are placed on</td>
260260
// </tr>
261261
// <tr>
262262
// <th>@_icon-sprite-position</th>

lib/web/mage/menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ define([
462462

463463
this.categoryLink = $('<a>')
464464
.attr('href', categoryUrl)
465-
.text($.mage.__('All ') + category);
465+
.text($.mage.__('All %1').replace('%1', category));
466466

467467
this.categoryParent = $('<li>')
468468
.addClass('ui-menu-item all-category')

0 commit comments

Comments
 (0)