Skip to content

Commit 2393dcb

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MAGETWO-94346
2 parents ac329e1 + 3091634 commit 2393dcb

File tree

73 files changed

+957
-883
lines changed

Some content is hidden

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

73 files changed

+957
-883
lines changed

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MAGETWO-63898"/>
1919
<group value="analytics"/>
20-
<skip>
21-
<issueId value="MAGETWO-96223"/>
22-
</skip>
2320
</annotations>
2421

2522
<actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/>

app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ $fraudDetails = $payment->getAdditionalInformation('fraud_details');
4444
<?php endif; ?>
4545

4646
<?php if(!empty($fraudDetails['fraud_filters'])): ?>
47-
<b><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48-
</b></br>
47+
<strong><?= $block->escapeHtml(__('Fraud Filters')) ?>:
48+
</strong></br>
4949
<?php foreach($fraudDetails['fraud_filters'] as $filter): ?>
5050
<?= $block->escapeHtml($filter['name']) ?>:
5151
<?= $block->escapeHtml($filter['action']) ?>

app/code/Magento/Catalog/Block/Product/AbstractProduct.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public function __construct(\Magento\Catalog\Block\Product\Context $context, arr
125125

126126
/**
127127
* Retrieve url for add product to cart
128+
*
128129
* Will return product view page URL if product has required options
129130
*
130131
* @param \Magento\Catalog\Model\Product $product
@@ -473,7 +474,9 @@ public function getProductDetailsHtml(\Magento\Catalog\Model\Product $product)
473474
}
474475

475476
/**
476-
* @param null $type
477+
* Get the renderer that will be used to render the details block
478+
*
479+
* @param string|null $type
477480
* @return bool|\Magento\Framework\View\Element\AbstractBlock
478481
*/
479482
public function getDetailsRenderer($type = null)
@@ -489,6 +492,8 @@ public function getDetailsRenderer($type = null)
489492
}
490493

491494
/**
495+
* Return the list of details
496+
*
492497
* @return \Magento\Framework\View\Element\RendererList
493498
*/
494499
protected function getDetailsRendererList()

app/code/Magento/Catalog/Helper/Product/Compare.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,15 @@ public function getListUrl()
166166
*/
167167
public function getPostDataParams($product)
168168
{
169-
return $this->postHelper->getPostData($this->getAddUrl(), ['product' => $product->getId()]);
169+
$params = ['product' => $product->getId()];
170+
$requestingPageUrl = $this->_getRequest()->getParam('requesting_page_url');
171+
172+
if (!empty($requestingPageUrl)) {
173+
$encodedUrl = $this->urlEncoder->encode($requestingPageUrl);
174+
$params[\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED] = $encodedUrl;
175+
}
176+
177+
return $this->postHelper->getPostData($this->getAddUrl(), $params);
170178
}
171179

172180
/**

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
2929
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
3030
<element name="ProductAddToCartByName" type="button" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocart')]" parameterized="true"/>
31-
<element name="ProductAddToCompareByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>
31+
<!--<element name="ProductAddToCompareByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>-->
32+
<element name="ProductAddToCompareByName" type="text" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>
3233
<element name="ProductImageByNameAndSrc" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[contains(@src, '{{src}}')]" parameterized="true"/>
3334
</section>
3435
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<description value="Admin should be able to add image to WYSIWYG Editor on Product Page"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-84375"/>
19-
<skip>
20-
<issueId value="MAGETWO-94438"/>
21-
</skip>
2219
</annotations>
2320
<before>
2421
<actionGroup ref="LoginActionGroup" stepKey="login"/>

app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define([
8282
return function (config, element) {
8383
config = config || {};
8484
jQuery(element).on('click', function () {
85-
categorySubmit(config.url, config.ajax);
85+
categorySubmit();
8686
});
8787
};
8888
});

app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-69455"/>
1919
<group value="persistent"/>
20-
<skip>
21-
<issueId value="MAGETWO-96656"/>
22-
</skip>
2320
</annotations>
2421
<before>
2522
<createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/>

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
use Magento\Framework\Pricing\PriceCurrencyInterface;
1212
use Magento\Framework\Serialize\Serializer\Json;
1313
use Magento\Widget\Block\BlockInterface;
14+
use Magento\Framework\Url\EncoderInterface;
1415

1516
/**
1617
* Catalog Products List widget block
1718
*
1819
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
1921
*/
2022
class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implements BlockInterface, IdentityInterface
2123
{
@@ -94,6 +96,11 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
9496
*/
9597
private $json;
9698

99+
/**
100+
* @var \Magento\Framework\Url\EncoderInterface|null
101+
*/
102+
private $urlEncoder;
103+
97104
/**
98105
* @param \Magento\Catalog\Block\Product\Context $context
99106
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
@@ -104,6 +111,7 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
104111
* @param \Magento\Widget\Helper\Conditions $conditionsHelper
105112
* @param array $data
106113
* @param Json|null $json
114+
* @param \Magento\Framework\Url\EncoderInterface|null $urlEncoder
107115
*/
108116
public function __construct(
109117
\Magento\Catalog\Block\Product\Context $context,
@@ -114,7 +122,8 @@ public function __construct(
114122
\Magento\CatalogWidget\Model\Rule $rule,
115123
\Magento\Widget\Helper\Conditions $conditionsHelper,
116124
array $data = [],
117-
Json $json = null
125+
Json $json = null,
126+
EncoderInterface $urlEncoder = null
118127
) {
119128
$this->productCollectionFactory = $productCollectionFactory;
120129
$this->catalogProductVisibility = $catalogProductVisibility;
@@ -123,6 +132,7 @@ public function __construct(
123132
$this->rule = $rule;
124133
$this->conditionsHelper = $conditionsHelper;
125134
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
135+
$this->urlEncoder = $urlEncoder ?: ObjectManager::getInstance()->get(EncoderInterface::class);
126136
parent::__construct(
127137
$context,
128138
$data
@@ -153,6 +163,7 @@ protected function _construct()
153163
* Get key pieces for caching block content
154164
*
155165
* @return array
166+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
156167
*/
157168
public function getCacheKeyInfo()
158169
{
@@ -230,6 +241,7 @@ protected function _beforeToHtml()
230241
* Prepare and return product collection
231242
*
232243
* @return \Magento\Catalog\Model\ResourceModel\Product\Collection
244+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
233245
*/
234246
public function createCollection()
235247
{
@@ -409,6 +421,22 @@ private function getPriceCurrency()
409421
return $this->priceCurrency;
410422
}
411423

424+
/**
425+
* @inheritdoc
426+
*/
427+
public function getAddToCartUrl($product, $additional = [])
428+
{
429+
$requestingPageUrl = $this->getRequest()->getParam('requesting_page_url');
430+
431+
if (!empty($requestingPageUrl)) {
432+
$additional['useUencPlaceholder'] = true;
433+
$url = parent::getAddToCartUrl($product, $additional);
434+
return str_replace('%25uenc%25', $this->urlEncoder->encode($requestingPageUrl), $url);
435+
}
436+
437+
return parent::getAddToCartUrl($product, $additional);
438+
}
439+
412440
/**
413441
* Get widget block name
414442
*
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="ProductListWidgetSection">
12+
<element name="AddToCartByName" type="button" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{arg1}}')]]//button[contains(@class,'tocart')]" parameterized="true"/>
13+
<element name="AddToCompareByName" type="button" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{arg1}}')]]//button[contains(@class,'tocompare')]" parameterized="true"/>
14+
</section>
15+
</sections>

0 commit comments

Comments
 (0)