Skip to content

Commit 5b3afb5

Browse files
author
olysenko
committed
Merge remote-tracking branch 'origin/2.3-develop' into chaika_february
2 parents 6178c98 + f211371 commit 5b3afb5

File tree

59 files changed

+1549
-128
lines changed

Some content is hidden

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

59 files changed

+1549
-128
lines changed

app/code/Magento/Backend/Controller/Adminhtml/System/Design/Save.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

9-
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design
9+
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
11+
/**
12+
* Save design action.
13+
*/
14+
class Save extends \Magento\Backend\Controller\Adminhtml\System\Design implements HttpPostActionInterface
1015
{
1116
/**
1217
* Filtering posted data. Converting localized data if needed
@@ -26,6 +31,8 @@ protected function _filterPostData($data)
2631
}
2732

2833
/**
34+
* Save design action.
35+
*
2936
* @return \Magento\Backend\Model\View\Result\Redirect
3037
*/
3138
public function execute()
@@ -54,10 +61,10 @@ public function execute()
5461
} catch (\Exception $e) {
5562
$this->messageManager->addErrorMessage($e->getMessage());
5663
$this->_objectManager->get(\Magento\Backend\Model\Session::class)->setDesignData($data);
57-
return $resultRedirect->setPath('adminhtml/*/', ['id' => $design->getId()]);
64+
return $resultRedirect->setPath('*/*/edit', ['id' => $design->getId()]);
5865
}
5966
}
6067

61-
return $resultRedirect->setPath('adminhtml/*/');
68+
return $resultRedirect->setPath('*/*/');
6269
}
6370
}

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Config\Source\Product\Options\Price as ProductOptionsPrice;
1212
use Magento\Framework\UrlInterface;
1313
use Magento\Framework\Stdlib\ArrayManager;
14+
use Magento\Ui\Component\Form\Element\Hidden;
1415
use Magento\Ui\Component\Modal;
1516
use Magento\Ui\Component\Container;
1617
use Magento\Ui\Component\DynamicRows;
@@ -867,10 +868,9 @@ protected function getPositionFieldConfig($sortOrder)
867868
'data' => [
868869
'config' => [
869870
'componentType' => Field::NAME,
870-
'formElement' => Input::NAME,
871+
'formElement' => Hidden::NAME,
871872
'dataScope' => static::FIELD_SORT_ORDER_NAME,
872873
'dataType' => Number::NAME,
873-
'visible' => false,
874874
'sortOrder' => $sortOrder,
875875
],
876876
],

app/code/Magento/Catalog/view/adminhtml/ui_component/product_listing.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@
190190
<label translate="true">Websites</label>
191191
</settings>
192192
</column>
193+
<column name="cost" class="Magento\Catalog\Ui\Component\Listing\Columns\Price" sortOrder="120">
194+
<settings>
195+
<addField>true</addField>
196+
<filter>textRange</filter>
197+
<label translate="true">Cost</label>
198+
</settings>
199+
</column>
193200
<actionsColumn name="actions" class="Magento\Catalog\Ui\Component\Listing\Columns\ProductActions" sortOrder="200">
194201
<settings>
195202
<indexField>entity_id</indexField>

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/composite/fieldset/configurable.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<legend class="legend admin__legend">
1818
<span><?= /* @escapeNotVerified */ __('Associated Products') ?></span>
1919
</legend>
20-
<div class="product-options">
21-
<div class="field admin__field _required required">
22-
<?php foreach ($_attributes as $_attribute): ?>
20+
<div class="product-options fieldset admin__fieldset">
21+
<?php foreach ($_attributes as $_attribute): ?>
22+
<div class="field admin__field _required required">
2323
<label class="label admin__field-label"><?php
2424
/* @escapeNotVerified */ echo $_attribute->getProductAttribute()
2525
->getStoreLabel($_product->getStoreId());
@@ -34,8 +34,8 @@
3434
<option><?= /* @escapeNotVerified */ __('Choose an Option...') ?></option>
3535
</select>
3636
</div>
37-
<?php endforeach; ?>
38-
</div>
37+
</div>
38+
<?php endforeach; ?>
3939
</div>
4040
</fieldset>
4141
<script>

app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1111
use Magento\Framework\GraphQl\Query\Resolver\Value;
12+
use Magento\Catalog\Model\Product;
1213
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1314
use Magento\Framework\GraphQl\Config\Element\Field;
1415
use Magento\Framework\GraphQl\Query\ResolverInterface;
@@ -45,12 +46,14 @@ public function resolve(
4546
$data = [];
4647
foreach ($value['options'] as $option) {
4748
$code = $option['attribute_code'];
48-
if (!isset($value['product']['model'][$code])) {
49+
/** @var Product|null $model */
50+
$model = $value['product']['model'] ?? null;
51+
if (!$model || !$model->getData($code)) {
4952
continue;
5053
}
5154

5255
foreach ($option['values'] as $optionValue) {
53-
if ($optionValue['value_index'] != $value['product']['model'][$code]) {
56+
if ($optionValue['value_index'] != $model->getData($code)) {
5457
continue;
5558
}
5659
$data[] = [

app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
3+
type Mutation {
4+
addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
5+
}
36

47
type ConfigurableProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") {
58
variants: [ConfigurableVariant] @doc(description: "An array of variants of products") @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableVariant")
@@ -35,3 +38,30 @@ type ConfigurableProductOptionsValues @doc(description: "ConfigurableProductOpti
3538
store_label: String @doc(description: "The label of the product on the current store")
3639
use_default_value: Boolean @doc(description: "Indicates whether to use the default_label")
3740
}
41+
42+
input AddConfigurableProductsToCartInput {
43+
cart_id: String!
44+
cartItems: [ConfigurableProductCartItemInput!]!
45+
}
46+
47+
type AddConfigurableProductsToCartOutput {
48+
cart: Cart!
49+
}
50+
51+
input ConfigurableProductCartItemInput {
52+
data: CartItemDetailsInput!
53+
variant_sku: String!
54+
customizable_options:[CustomizableOptionInput!]
55+
}
56+
57+
type ConfigurableCartItem implements CartItemInterface {
58+
customizable_options: [SelectedCustomizableOption]!
59+
configurable_options: [SelectedConfigurableOption!]!
60+
}
61+
62+
type SelectedConfigurableOption {
63+
id: Int!
64+
option_label: String!
65+
value_id: Int!
66+
value_label: String!
67+
}

app/code/Magento/Cookie/Helper/Cookie.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ class Cookie extends \Magento\Framework\App\Helper\AbstractHelper
4242
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4343
* @param array $data
4444
*
45-
* @throws \InvalidArgumentException
45+
* @throws \Magento\Framework\Exception\LocalizedException
46+
* @throws \Magento\Framework\Exception\NoSuchEntityException
4647
*/
4748
public function __construct(
4849
\Magento\Framework\App\Helper\Context $context,

app/code/Magento/Customer/Model/ResourceModel/Group.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class Group extends \Magento\Framework\Model\ResourceModel\Db\VersionControl\Abs
2929

3030
/**
3131
* @param \Magento\Framework\Model\ResourceModel\Db\Context $context
32-
* @param Snapshot $entitySnapshot,
33-
* @param RelationComposite $entityRelationComposite,
32+
* @param Snapshot $entitySnapshot
33+
* @param RelationComposite $entityRelationComposite
3434
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
3535
* @param Customer\CollectionFactory $customersFactory
3636
* @param string $connectionName
@@ -110,6 +110,8 @@ protected function _afterDelete(\Magento\Framework\Model\AbstractModel $group)
110110
}
111111

112112
/**
113+
* Create customers collection.
114+
*
113115
* @return \Magento\Customer\Model\ResourceModel\Customer\Collection
114116
*/
115117
protected function _createCustomersCollection()
@@ -131,7 +133,7 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $group)
131133
}
132134

133135
/**
134-
* {@inheritdoc}
136+
* @inheritdoc
135137
*/
136138
protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
137139
{

app/code/Magento/Customer/Model/Vat.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,21 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode =
179179
return $gatewayResponse;
180180
}
181181

182+
$countryCodeForVatNumber = $this->getCountryCodeForVatNumber($countryCode);
183+
$requesterCountryCodeForVatNumber = $this->getCountryCodeForVatNumber($requesterCountryCode);
184+
182185
try {
183186
$soapClient = $this->createVatNumberValidationSoapClient();
184187

185188
$requestParams = [];
186-
$requestParams['countryCode'] = $countryCode;
189+
$requestParams['countryCode'] = $countryCodeForVatNumber;
187190
$vatNumberSanitized = $this->isCountryInEU($countryCode)
188-
? str_replace([' ', '-', $countryCode], ['', '', ''], $vatNumber)
191+
? str_replace([' ', '-', $countryCodeForVatNumber], ['', '', ''], $vatNumber)
189192
: str_replace([' ', '-'], ['', ''], $vatNumber);
190193
$requestParams['vatNumber'] = $vatNumberSanitized;
191-
$requestParams['requesterCountryCode'] = $requesterCountryCode;
194+
$requestParams['requesterCountryCode'] = $requesterCountryCodeForVatNumber;
192195
$reqVatNumSanitized = $this->isCountryInEU($requesterCountryCode)
193-
? str_replace([' ', '-', $requesterCountryCode], ['', '', ''], $requesterVatNumber)
196+
? str_replace([' ', '-', $requesterCountryCodeForVatNumber], ['', '', ''], $requesterVatNumber)
194197
: str_replace([' ', '-'], ['', ''], $requesterVatNumber);
195198
$requestParams['requesterVatNumber'] = $reqVatNumSanitized;
196199
// Send request to service
@@ -301,4 +304,22 @@ public function isCountryInEU($countryCode, $storeId = null)
301304
);
302305
return in_array($countryCode, $euCountries);
303306
}
307+
308+
/**
309+
* Returns the country code to use in the VAT number which is not always the same as the normal country code
310+
*
311+
* @param string $countryCode
312+
* @return string
313+
*/
314+
private function getCountryCodeForVatNumber(string $countryCode): string
315+
{
316+
// Greece uses a different code for VAT numbers then its country code
317+
// See: http://ec.europa.eu/taxation_customs/vies/faq.html#item_11
318+
// And https://en.wikipedia.org/wiki/VAT_identification_number:
319+
// "The full identifier starts with an ISO 3166-1 alpha-2 (2 letters) country code
320+
// (except for Greece, which uses the ISO 639-1 language code EL for the Greek language,
321+
// instead of its ISO 3166-1 alpha-2 country code GR)"
322+
323+
return $countryCode === 'GR' ? 'EL' : $countryCode;
324+
}
304325
}

app/code/Magento/Directory/Model/CurrencyConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(
5757
*/
5858
public function getConfigCurrencies(string $path)
5959
{
60-
$result = $this->appState->getAreaCode() === Area::AREA_ADMINHTML
60+
$result = in_array($this->appState->getAreaCode(), [Area::AREA_ADMINHTML, Area::AREA_CRONTAB])
6161
? $this->getConfigForAllStores($path)
6262
: $this->getConfigForCurrentStore($path);
6363
sort($result);

0 commit comments

Comments
 (0)