Skip to content

Update 2.2 develop branch #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
cc1e013
Updated Magento_Rule rules.js file
Apr 1, 2018
ff4b005
Disabled autocomplete for datepicker (calendar) input field
Aug 11, 2018
172ecf6
18615 updates structure for last_trans_id to be varchar 255 which is …
iancassidyweb Oct 15, 2018
8718a60
Update newsletter module
arendarenko Oct 12, 2018
2a7e00f
Update newsletter module
arendarenko Oct 12, 2018
3590785
revert change to last_trans_id length in InstallSchema, move to Upgra…
iancassidyweb Oct 16, 2018
81aaf77
ENGCOM-3276: [Backport] Fix issue with unexpected changing of subscri…
magento-engcom-team Oct 25, 2018
3a88a38
fixed - can't import external http to https redirecting images by def…
Oct 28, 2018
38bfe66
Fix the issue with missing asterisk for admin required fields #18904
dmytro-ch Oct 28, 2018
bc485de
local themes should be added to git repo
torhoehn Oct 30, 2018
7d2dd65
Fix the functional tests failures #18904
dmytro-ch Nov 1, 2018
4f07c61
Merge branch '2.2-develop' into fix/2.2-issue-18904-missing-asterisk-…
dmytro-ch Nov 1, 2018
caa2fe8
magento/magento2#17833: Child theme does not inherit translations fr…
vpodorozh Nov 2, 2018
24330d6
magento/magento2#17833:  Child theme does not inherit translations fr…
vpodorozh Nov 2, 2018
10d9cc9
magento/magento2#17833:  Child theme does not inherit translations fr…
vpodorozh Nov 2, 2018
301d73d
Merge pull request #2 from magento/2.2-develop
speedy008 Nov 3, 2018
e3134ea
Fix issue - Image custom attribute type could not display on frontend.
Nazar65 Nov 5, 2018
81d7144
ENGCOM-3338: local themes should be added to git repo #18960
magento-engcom-team Nov 7, 2018
a3db8d3
magento/magento2#17833:  Child theme does not inherit translations fr…
vpodorozh Nov 8, 2018
6c87bb3
magento/magento2:#4136 - Widget condition with unexpected character n…
Nov 8, 2018
26ea51e
magento/magento2#17833:  Child theme does not inherit translations fr…
vpodorozh Nov 10, 2018
6d33140
Merge branch '2.2-develop' of github.com:magento/magento2 into 2.2-de…
iancassidyweb Nov 11, 2018
dd753a1
18615 - change structure for last trans id in sales_order_payment
iancassidyweb Nov 11, 2018
e6d4857
MAGETWO-91932: Zip code is not validated during checkout when "My bil…
nikita-shcherbatykh Nov 12, 2018
1d1d061
magento/magento2:#4136 - Widget condition with unexpected character n…
Nov 13, 2018
e8a07c9
magento/magento2#17833:  Child theme does not inherit translations fr…
vpodorozh Nov 13, 2018
d0c8cfc
ENGCOM-3357: Fix for Issue #4136, MAGETWO-53440 #14485
magento-engcom-team Nov 13, 2018
7c013a1
Merge pull request #3 from magento/2.2-develop
speedy008 Nov 14, 2018
4df596b
Fix Notice and Exception while adding image to product programmatically
progreg Nov 19, 2018
cb8b166
ENGCOM-3494: 18615 updates structure for last_trans_id to be varchar …
magento-engcom-team Nov 19, 2018
fedacf9
Remove void return declaration
progreg Nov 19, 2018
5e385b4
ENGCOM-3308: Fix the issue with missing asterisk for admin required f…
magento-engcom-team Nov 20, 2018
3861279
MAGETWO-91932: Zip code is not validated during checkout when "My bil…
yelahin-serhiy Nov 21, 2018
1219f0a
MAGETWO-96289: Cannot proceed to braintree paypal from iPhone
serhii-balko Nov 21, 2018
aa1b000
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-91932
yelahin-serhiy Nov 21, 2018
584242c
Merge pull request #5 from magento/2.2-develop
speedy008 Nov 21, 2018
ee0bae8
Fixed pagination alignment issue-ƒ19286
speedy008 Nov 21, 2018
fdcdbe3
ENGCOM-3507: Fix issue 19286 - Wrong pager style #19296
magento-engcom-team Nov 21, 2018
ec68989
ENGCOM-3308: MFTF tests fix.
p-bystritsky Nov 21, 2018
e2c86b9
Merge branch '2.2-develop' into ENGCOM-3357-magento-magento2-14485
p-bystritsky Nov 21, 2018
39cce0c
ENGCOM-3505: Using Media Image custom attribute type could not displa…
magento-engcom-team Nov 21, 2018
6051858
ENGCOM-3527: [2.2 develop] [backport #19018] [issue #17833] child the…
magento-engcom-team Nov 22, 2018
310ed2b
ENGCOM-3528: [Backport] fixed - can't import external http to https r…
magento-engcom-team Nov 22, 2018
f15ddaf
performance improvements
apasare Oct 23, 2018
762722d
ENGCOM-3338: local themes should be added to git repo #18960
Nov 22, 2018
0bc3a68
ENGCOM-3276: [Backport] Fix issue with unexpected changing of subscri…
Nov 22, 2018
cb7b67e
missing use statement in layout generator
adeptofvoltron Nov 2, 2018
0cc9a11
import class to the use statement
adeptofvoltron Nov 2, 2018
20922a0
19082-Fatal-error-Uncaught-Error-Cannot-call-abstract-method-Magento-…
Nov 10, 2018
27c265d
Fix the issue: Content overlaps the close button #19263
dmytro-ch Nov 18, 2018
3bae848
ENGCOM-3531: [Backport] 19082-Fatal-error-Uncaught-Error-Cannot-call-…
magento-engcom-team Nov 22, 2018
651606e
ENGCOM-3490: Magento 2.2 Fix Product::addImageToMediaGallery throws E…
magento-engcom-team Nov 22, 2018
0cc1ce2
ENGCOM-3532: [Backport] small performance improvement on product list…
magento-engcom-team Nov 22, 2018
4b70893
Merge branch '2.2-develop' into 2.2-develop-PR-port-19264
gelanivishal Nov 22, 2018
b7c70c3
ENGCOM-3534: [Backport] Fix the issue: Content overlaps the close but…
magento-engcom-team Nov 22, 2018
5218dd9
ENGCOM-3490: Magento 2.2 Fix Product::addImageToMediaGallery throws E…
Nov 22, 2018
33b0a51
MAGETWO-93424: Permanent Redirect for old URL missing via API or no d…
yelahin-serhiy Nov 22, 2018
3f6c67f
ENGCOM-3530: [Backport] missing use statement in layout generator #19338
magento-engcom-team Nov 22, 2018
13de5a7
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 22, 2018
5d05219
ENGCOM-3534: [Backport] Fix the issue: Content overlaps the close but…
Nov 22, 2018
c8f2893
ENGCOM-3532: [Backport] small performance improvement on product list…
Nov 22, 2018
30554a9
ENGCOM-3531: [Backport] 19082-Fatal-error-Uncaught-Error-Cannot-call-…
Nov 22, 2018
cf5ad8d
ENGCOM-3530: [Backport] missing use statement in layout generator #19338
Nov 22, 2018
a53f7fc
ENGCOM-3505: Using Media Image custom attribute type could not displa…
Nov 22, 2018
d332f71
Changed get product way in blocks with related products
Oct 19, 2018
fe93034
MAGETWO-93424: Permanent Redirect for old URL missing via API or no d…
yelahin-serhiy Nov 23, 2018
132a754
fixed-18887-notifications-counter
abrarpathan19 Nov 3, 2018
91fc40c
Update _notifications.less
VladimirZaets Nov 19, 2018
7559e3e
#13157 - Last Ordered Items block - bad js code
omiroshnichenko Nov 2, 2018
58550b9
#13157 - Last Ordered Items block - bad js code
omiroshnichenko Nov 6, 2018
f1bb98e
#13157 - Last Ordered Items block - bad js code
omiroshnichenko Nov 13, 2018
f4250a0
Fix the issue with repetitive "tbody" tag for order items table
dmytro-ch Nov 21, 2018
0d91b77
ENGCOM-3541: [Backport] Magento backend Notifications counter round i…
magento-engcom-team Nov 23, 2018
0ff0dab
ENGCOM-3542: [Backport] Changed get product way in blocks with relate…
magento-engcom-team Nov 23, 2018
c74477c
ENGCOM-3544: [Backport] Fix the issue with repetitive 'tbody' tag for…
magento-engcom-team Nov 23, 2018
fd14d87
ENGCOM-3540: [Backport] #13157 - Last Ordered Items block - bad js co…
magento-engcom-team Nov 23, 2018
043b52f
ENGCOM-3357: MTF tests fix.
p-bystritsky Nov 22, 2018
fc510d3
MAGETWO-93424: Permanent Redirect for old URL missing via API or no d…
yelahin-serhiy Nov 23, 2018
57d6b3b
Code style fixes
VladimirZaets Nov 23, 2018
97b98cc
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
VladimirZaets Nov 23, 2018
053291a
fix: remove old code in tabs, always set tabindex to 0 when tabs are …
Nov 22, 2018
152c240
ENGCOM-3548: [Backport] fix: remove old code in tabs, always set tabi…
magento-engcom-team Nov 23, 2018
90e9806
ENGCOM-3542: [Backport] Changed get product way in blocks with relate…
VladimirZaets Nov 23, 2018
0b97337
ENGCOM-3540: [Backport] #13157 - Last Ordered Items block - bad js co…
VladimirZaets Nov 23, 2018
d1c7535
ENGCOM-3507: Fix issue 19286 - Wrong pager style #19296
VladimirZaets Nov 23, 2018
645b78a
ENGCOM-3494: 18615 updates structure for last_trans_id to be varchar …
VladimirZaets Nov 23, 2018
01a7917
ENGCOM-3357: Fix for Issue #4136, MAGETWO-53440 #14485
VladimirZaets Nov 23, 2018
d41a57c
ENGCOM-3308: Fix the issue with missing asterisk for admin required f…
VladimirZaets Nov 23, 2018
3185123
Fixing a test for Magento Newsletter.
tiagosampaio Nov 23, 2018
306cc65
Removed obsolete _redirect method call
sivaschenko Nov 24, 2018
e1650f2
Merge branch '2.2-develop-prs' of github.com:magento-engcom/magento2c…
sivaschenko Nov 24, 2018
ce701af
back-port-pull-19024
Nov 24, 2018
c59e602
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 24, 2018
1763fe2
ENGCOM-3553: back-port-pull-19024 #19374
magento-engcom-team Nov 24, 2018
5ccde33
ENGCOM-3550: Fixing a test for Magento Newsletter. #19365
magento-engcom-team Nov 25, 2018
95a3136
MAGETWO-94112: Configurable "As low As" Product Price Not Updating Co…
rostyslav-hymon Nov 26, 2018
3eb849b
ENGCOM-3550: Fixing a test for Magento Newsletter. #19365
sivaschenko Nov 26, 2018
a427b30
ENGCOM-3544: [Backport] Fix the issue with repetitive "tbody" tag for…
sivaschenko Nov 26, 2018
38d14a0
ENGCOM-3527: [2.2 develop] [backport #19018] [issue #17833] child the…
sivaschenko Nov 26, 2018
ace297a
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 26, 2018
da57658
Merge branch 'MAGETWO-96289' into 2.2-develop-pr11
serhii-balko Nov 27, 2018
bc1cd5a
Merge branch 'MAGETWO-93424' into 2.2-develop-pr11
yelahin-serhiy Nov 27, 2018
e194edc
Merge branch 'MAGETWO-91932' into 2.2-develop-pr11
yelahin-serhiy Nov 27, 2018
2185923
Merge branch 'MAGETWO-94112' into 2.2-develop-pr11
rostyslav-hymon Nov 27, 2018
19c9aba
ENGCOM-3553: back-port-pull-19024 #19374
sivaschenko Nov 27, 2018
bc6358e
ENGCOM-3548: [Backport] fix: remove old code in tabs, always set tabi…
sivaschenko Nov 27, 2018
ae7563c
ENGCOM-3541: [Backport] Magento backend Notifications counter round i…
sivaschenko Nov 27, 2018
3c1b5d1
ENGCOM-3528: [Backport] fixed - can't import external http to https r…
sivaschenko Nov 27, 2018
89b5f5e
Properties sorted alphabetically
sivaschenko Nov 27, 2018
f38e340
Merge pull request #3484 from magento-tsg-csl3/2.2-develop-pr11
viktym Nov 27, 2018
d99739a
[EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 27, 2018
d7eafc2
MAGETWO-91070: Missing Swatch Images Break Catalog Pages
dhorytskyi Nov 27, 2018
653d533
:arrows_clockwise: [EngCom] Public Pull Requests - 2.2-develop
magento-engcom-team Nov 27, 2018
0bfccfc
Merge branch '2.2-develop' of https://github.com/magento/magento2ce i…
droed89 Nov 28, 2018
899e950
Merge pull request #3488 from magento-tango/MAGETWO-91070
dhorytskyi Nov 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ atlassian*
/.php_cs
/.php_cs.cache
/grunt-config.json
/dev/tools/grunt/configs/local-themes.js

/pub/media/*.*
!/pub/media/.htaccess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
define([
'jquery',
'underscore',
'mage/utils/wrapper',
'Magento_Checkout/js/view/payment/default',
'Magento_Braintree/js/view/payment/adapter',
'Magento_Checkout/js/model/quote',
Expand All @@ -19,7 +18,6 @@ define([
], function (
$,
_,
wrapper,
Component,
Braintree,
quote,
Expand Down Expand Up @@ -105,6 +103,12 @@ define([
}
});

quote.shippingAddress.subscribe(function () {
if (self.isActive()) {
self.reInitPayPal();
}
});

// for each component initialization need update property
this.isReviewRequired(false);
this.initClientConfig();
Expand Down Expand Up @@ -222,9 +226,8 @@ define([

/**
* Re-init PayPal Auth Flow
* @param {Function} callback - Optional callback
*/
reInitPayPal: function (callback) {
reInitPayPal: function () {
if (Braintree.checkout) {
Braintree.checkout.teardown(function () {
Braintree.checkout = null;
Expand All @@ -235,17 +238,6 @@ define([
this.clientConfig.paypal.amount = this.grandTotalAmount;
this.clientConfig.paypal.shippingAddressOverride = this.getShippingAddress();

if (callback) {
this.clientConfig.onReady = wrapper.wrap(
this.clientConfig.onReady,
function (original, checkout) {
this.clientConfig.onReady = original;
original(checkout);
callback();
}.bind(this)
);
}

Braintree.setConfig(this.clientConfig);
Braintree.setup();
},
Expand Down Expand Up @@ -429,19 +421,17 @@ define([
* Triggers when customer click "Continue to PayPal" button
*/
payWithPayPal: function () {
this.reInitPayPal(function () {
if (!additionalValidators.validate()) {
return;
}
if (!additionalValidators.validate()) {
return;
}

try {
Braintree.checkout.paypal.initAuthFlow();
} catch (e) {
this.messageContainer.addErrorMessage({
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
});
}
}.bind(this));
try {
Braintree.checkout.paypal.initAuthFlow();
} catch (e) {
this.messageContainer.addErrorMessage({
message: $t('Payment ' + this.getTitle() + ' can\'t be initialized.')
});
}
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */

$this->_itemCollection = $product->getCrossSellProductCollection()->addAttributeToSelect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */

$this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct(
*/
protected function _prepareData()
{
$product = $this->_coreRegistry->registry('product');
$product = $this->getProduct();
/* @var $product \Magento\Catalog\Model\Product */
$this->_itemCollection = $product->getUpSellProductCollection()->setPositionOrder()->addStoreFilter();
if ($this->moduleManager->isEnabled('Magento_Checkout')) {
Expand Down
8 changes: 8 additions & 0 deletions app/code/Magento/Catalog/Controller/Product/Compare.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,12 @@ public function setCustomerId($customerId)
$this->_customerId = $customerId;
return $this;
}

/**
* @inheritdoc
*/
public function execute()
{
return $this->resultRedirectFactory->create()->setPath('catalog/product_compare');
}
}
39 changes: 34 additions & 5 deletions app/code/Magento/Catalog/Model/Product/Gallery/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/
namespace Magento\Catalog\Model\Product\Gallery;

use Magento\Framework\Api\Data\ImageContentInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Filesystem\DriverInterface;
use Magento\Framework\App\ObjectManager;

/**
* Catalog product Media Gallery attribute processor.
Expand Down Expand Up @@ -55,28 +56,39 @@ class Processor
*/
protected $resourceModel;

/**
* @var \Magento\Framework\File\Mime
*/
private $mime;

/**
* @param \Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository
* @param \Magento\MediaStorage\Helper\File\Storage\Database $fileStorageDb
* @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Catalog\Model\ResourceModel\Product\Gallery $resourceModel
* @param \Magento\Framework\File\Mime|null $mime
* @throws \Magento\Framework\Exception\FileSystemException
*/
public function __construct(
\Magento\Catalog\Api\ProductAttributeRepositoryInterface $attributeRepository,
\Magento\MediaStorage\Helper\File\Storage\Database $fileStorageDb,
\Magento\Catalog\Model\Product\Media\Config $mediaConfig,
\Magento\Framework\Filesystem $filesystem,
\Magento\Catalog\Model\ResourceModel\Product\Gallery $resourceModel
\Magento\Catalog\Model\ResourceModel\Product\Gallery $resourceModel,
\Magento\Framework\File\Mime $mime = null
) {
$this->attributeRepository = $attributeRepository;
$this->fileStorageDb = $fileStorageDb;
$this->mediaConfig = $mediaConfig;
$this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$this->resourceModel = $resourceModel;
$this->mime = $mime ?: ObjectManager::getInstance()->get(\Magento\Framework\File\Mime::class);
}

/**
* Return media_gallery attribute
*
* @return \Magento\Catalog\Api\Data\ProductAttributeInterface
* @since 101.0.0
*/
Expand Down Expand Up @@ -178,6 +190,13 @@ public function addImage(
$attrCode = $this->getAttribute()->getAttributeCode();
$mediaGalleryData = $product->getData($attrCode);
$position = 0;

$absoluteFilePath = $this->mediaDirectory->getAbsolutePath($file);
$imageMimeType = $this->mime->getMimeType($absoluteFilePath);
$imageContent = $this->mediaDirectory->readFile($absoluteFilePath);
$imageBase64 = base64_encode($imageContent);
$imageName = $pathinfo['filename'];

if (!is_array($mediaGalleryData)) {
$mediaGalleryData = ['images' => []];
}
Expand All @@ -192,9 +211,17 @@ public function addImage(
$mediaGalleryData['images'][] = [
'file' => $fileName,
'position' => $position,
'media_type' => 'image',
'label' => '',
'disabled' => (int)$exclude,
'media_type' => 'image',
'types' => $mediaAttribute,
'content' => [
'data' => [
ImageContentInterface::NAME => $imageName,
ImageContentInterface::BASE64_ENCODED_DATA => $imageBase64,
ImageContentInterface::TYPE => $imageMimeType,
]
]
];

$product->setData($attrCode, $mediaGalleryData);
Expand Down Expand Up @@ -353,7 +380,8 @@ public function setMediaAttribute(\Magento\Catalog\Model\Product $product, $medi
}

/**
* get media attribute codes
* Get media attribute codes
*
* @return array
* @since 101.0.0
*/
Expand All @@ -363,6 +391,8 @@ public function getMediaAttributeCodes()
}

/**
* Trim .tmp ending from filename
*
* @param string $file
* @return string
* @since 101.0.0
Expand Down Expand Up @@ -484,7 +514,6 @@ public function getAffectedFields($object)
/**
* Attribute value is not to be saved in a conventional way, separate table is used to store the complex value
*
* {@inheritdoc}
* @since 101.0.0
*/
public function isScalar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
</section>
<section name="AdminModifyAttributesSection">
<!-- Parameter is the attribute name -->
<element name="dropDownAttributeByName" type="select" selector="//*[text()='{{attributeName}}']/../..//select" parameterized="true"/>
<element name="dropDownAttributeByName" type="select" selector="//*[text()='{{attributeName}}']/../../..//select" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
<element name="useDefaultOptionTitle" type="text" selector="[data-index='options'] tr.data-row [data-index='title'] [name^='options_use_default']"/>
<element name="useDefaultOptionValueTitleByIndex" type="text" selector="[data-index='options'] [data-index='values'] tr[data-repeat-index='{{var1}}'] [name^='options_use_default']" parameterized="true"/>
<element name="addOptionBtn" type="button" selector="button[data-index='button_add']"/>
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Title']/parent::span/parent::div//input[@class='admin__control-text']" parameterized="true"/>
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//label[text()='Option Type']/parent::span/parent::div//div[@data-role='selected-option']" parameterized="true"/>
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/ancestor::div[@class='fieldset-wrapper-title']/following-sibling::div[@data-role='collapsible-content']//div[@data-index='type']//div[contains(@class, 'action-menu')]//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>
<element name="fillOptionTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Title']/parent::label/parent::div/parent::div//input[@class='admin__control-text']" parameterized="true"/>
<element name="checkSelect" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//span[text()='Option Type']/parent::label/parent::div/parent::div//div[@data-role='selected-option']" parameterized="true"/>
<element name="checkDropDown" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//parent::label/parent::div/parent::div//li[@class='admin__action-multiselect-menu-inner-item']//label[text()='Drop-down']" parameterized="true"/>
<element name="clickAddValue" type="button" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tfoot//button" parameterized="true"/>
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//label[text()='Title']/parent::span/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
<element name="fillOptionValueTitle" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Title']/parent::label/parent::div/parent::div//div[@class='admin__field-control']/input" parameterized="true"/>
<element name="fillOptionValuePrice" type="input" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody/tr[@data-repeat-index='{{var2}}']//span[text()='Price']/parent::label/parent::div//div[@class='admin__control-addon']/input" parameterized="true"/>
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//label[text()='Price Type']/parent::span/parent::div//select" parameterized="true"/>
<element name="clickSelectPriceType" type="select" selector="//span[text()='{{var1}}']/parent::div/parent::div/parent::div//tbody//tr[@data-repeat-index='{{var2}}']//span[text()='Price Type']/parent::label/parent::div/parent::div//select" parameterized="true"/>
<!-- Elements that make it easier to select the most recently added element -->
<element name="lastOptionTitle" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, '_required')]//input" />
<element name="lastOptionTypeParent" type="block" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr[last()]//*[contains(@class, 'admin__action-multiselect-text')]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
<element name="productNameUseDefault" type="checkbox" selector="input[name='use_default[name]']"/>
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
<element name="enableProductAttributeLabel" type="text" selector="[data-index='status'] .admin__field-label label"/>
<element name="enableProductAttributeLabelWrapper" type="text" selector="[data-index='status'] .admin__field-label"/>
<element name="enableProductAttributeLabel" type="text" selector="//span[text()='Enable Product']/parent::label"/>
<element name="enableProductAttributeLabelWrapper" type="text" selector="//span[text()='Enable Product']/parent::label/parent::div"/>
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
<element name="productStatusUseDefault" type="checkbox" selector="input[name='use_default[status]']"/>
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
Expand All @@ -33,7 +33,7 @@
<element name="visibilityUseDefault" type="checkbox" selector="//input[@name='use_default[visibility]']"/>
<element name="divByDataIndex" type="input" selector="div[data-index='{{var}}']" parameterized="true"/>
<element name="attributeSetSearchCount" type="text" selector="div[data-index='attribute_set_id'] .admin__action-multiselect-search-count"/>
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//label[text()='{{attributeLabel}}']" parameterized="true"/>
<element name="attributeLabelByText" type="text" selector="//*[@class='admin__field']//span[text()='{{attributeLabel}}']" parameterized="true"/>
<element name="addAttributeBtn" type="button" selector="#addAttribute"/>
<element name="attributeSetFilterResultByName" type="text" selector="//label/span[text() = '{{var}}']" timeout="30" parameterized="true"/>
<element name="attributeSetDropDown" type="select" selector="div[data-index='attribute_set_id'] .action-select.admin__action-multiselect"/>
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Catalog/view/base/web/js/price-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ define([
pricesCode = [],
priceValue, origin, finalPrice;

this.cache.additionalPriceObject = this.cache.additionalPriceObject || {};
if (typeof newPrices !== 'undefined' && newPrices.hasOwnProperty('prices')) {
this.cache.additionalPriceObject = {};
} else {
this.cache.additionalPriceObject = this.cache.additionalPriceObject || {};
}

if (newPrices) {
$.extend(this.cache.additionalPriceObject, newPrices);
Expand Down
31 changes: 28 additions & 3 deletions app/code/Magento/CatalogImportExport/Model/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
*/
const COL_NAME = 'name';

/**
* Column new_from_date.
*/
const COL_NEW_FROM_DATE = 'new_from_date';

/**
* Column new_to_date.
*/
const COL_NEW_TO_DATE = 'new_to_date';

/**
* Column product website.
*/
Expand Down Expand Up @@ -292,7 +302,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
ValidatorInterface::ERROR_MEDIA_PATH_NOT_ACCESSIBLE => 'Imported resource (image) does not exist in the local media storage',
ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE => 'Imported resource (image) could not be downloaded from external resource due to timeout or access permissions',
ValidatorInterface::ERROR_INVALID_WEIGHT => 'Product weight is invalid',
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually'
ValidatorInterface::ERROR_DUPLICATE_URL_KEY => 'Url key: \'%s\' was already generated for an item with the SKU: \'%s\'. You need to specify the unique URL key manually',
ValidatorInterface::ERROR_NEW_TO_DATE => 'Make sure new_to_date is later than or the same as new_from_date',
];

/**
Expand All @@ -313,8 +324,8 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
Product::COL_TYPE => 'product_type',
Product::COL_PRODUCT_WEBSITES => 'product_websites',
'status' => 'product_online',
'news_from_date' => 'new_from_date',
'news_to_date' => 'new_to_date',
'news_from_date' => self::COL_NEW_FROM_DATE,
'news_to_date' => self::COL_NEW_TO_DATE,
'options_container' => 'display_product_options_in',
'minimal_price' => 'map_price',
'msrp' => 'msrp_price',
Expand Down Expand Up @@ -2477,6 +2488,20 @@ public function validateRow(array $rowData, $rowNum)
}
}
}

if (!empty($rowData[self::COL_NEW_FROM_DATE]) && !empty($rowData[self::COL_NEW_TO_DATE])
) {
$newFromTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_FROM_DATE], false));
$newToTimestamp = strtotime($this->dateTime->formatDate($rowData[self::COL_NEW_TO_DATE], false));
if ($newFromTimestamp > $newToTimestamp) {
$this->addRowError(
ValidatorInterface::ERROR_NEW_TO_DATE,
$rowNum,
$rowData[self::COL_NEW_TO_DATE]
);
}
}

return !$this->getErrorAggregator()->isRowInvalid($rowNum);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ interface RowValidatorInterface extends \Magento\Framework\Validator\ValidatorIn

const ERROR_DUPLICATE_URL_KEY = 'duplicatedUrlKey';

const ERROR_NEW_TO_DATE = 'invalidNewToDateValue';

/**
* Value that means all entities (e.g. websites, groups etc.)
*/
Expand Down
Loading