Skip to content

Commit eb1c074

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-70806
2 parents 37716e7 + 14e7a37 commit eb1c074

File tree

43 files changed

+678
-313
lines changed

Some content is hidden

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

43 files changed

+678
-313
lines changed

app/code/Magento/Analytics/etc/di.xml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -181,28 +181,28 @@
181181
<type name="Magento\Analytics\Model\Config\Source\Vertical">
182182
<arguments>
183183
<argument name="verticals" xsi:type="array">
184-
<item name="0" xsi:type="string">Apps and Games</item>
185-
<item name="1" xsi:type="string">Athletic/Sporting Goods</item>
186-
<item name="2" xsi:type="string">Art and Design</item>
187-
<item name="3" xsi:type="string">Auto Parts</item>
188-
<item name="4" xsi:type="string">Baby/Children’s Apparel, Gear and Toys</item>
189-
<item name="5" xsi:type="string">Beauty and Cosmetics</item>
190-
<item name="6" xsi:type="string">Books, Music and Magazines</item>
191-
<item name="7" xsi:type="string">Crafts and Stationery</item>
192-
<item name="8" xsi:type="string">Consumer Electronics</item>
193-
<item name="9" xsi:type="string">Deal Site</item>
194-
<item name="10" xsi:type="string">Fashion Apparel and Accessories</item>
195-
<item name="11" xsi:type="string">Food, Beverage and Grocery</item>
196-
<item name="12" xsi:type="string">Home Goods and Furniture</item>
197-
<item name="13" xsi:type="string">Home Improvement</item>
198-
<item name="14" xsi:type="string">Jewelry and Watches</item>
199-
<item name="15" xsi:type="string">Mass Merchant</item>
200-
<item name="16" xsi:type="string">Office Supplies</item>
201-
<item name="17" xsi:type="string">Outdoor and Camping Gear</item>
202-
<item name="18" xsi:type="string">Pet Goods</item>
203-
<item name="19" xsi:type="string">Pharma and Medical Devices</item>
204-
<item name="20" xsi:type="string">Technology B2B</item>
205-
<item name="21" xsi:type="string">Other</item>
184+
<item name="0" xsi:type="string" translatable="true">Apps and Games</item>
185+
<item name="1" xsi:type="string" translatable="true">Athletic/Sporting Goods</item>
186+
<item name="2" xsi:type="string" translatable="true">Art and Design</item>
187+
<item name="3" xsi:type="string" translatable="true">Auto Parts</item>
188+
<item name="4" xsi:type="string" translatable="true">Baby/Children’s Apparel, Gear and Toys</item>
189+
<item name="5" xsi:type="string" translatable="true">Beauty and Cosmetics</item>
190+
<item name="6" xsi:type="string" translatable="true">Books, Music and Magazines</item>
191+
<item name="7" xsi:type="string" translatable="true">Crafts and Stationery</item>
192+
<item name="8" xsi:type="string" translatable="true">Consumer Electronics</item>
193+
<item name="9" xsi:type="string" translatable="true">Deal Site</item>
194+
<item name="10" xsi:type="string" translatable="true">Fashion Apparel and Accessories</item>
195+
<item name="11" xsi:type="string" translatable="true">Food, Beverage and Grocery</item>
196+
<item name="12" xsi:type="string" translatable="true">Home Goods and Furniture</item>
197+
<item name="13" xsi:type="string" translatable="true">Home Improvement</item>
198+
<item name="14" xsi:type="string" translatable="true">Jewelry and Watches</item>
199+
<item name="15" xsi:type="string" translatable="true">Mass Merchant</item>
200+
<item name="16" xsi:type="string" translatable="true">Office Supplies</item>
201+
<item name="17" xsi:type="string" translatable="true">Outdoor and Camping Gear</item>
202+
<item name="18" xsi:type="string" translatable="true">Pet Goods</item>
203+
<item name="19" xsi:type="string" translatable="true">Pharma and Medical Devices</item>
204+
<item name="20" xsi:type="string" translatable="true">Technology B2B</item>
205+
<item name="21" xsi:type="string" translatable="true">Other</item>
206206
</argument>
207207
</arguments>
208208
</type>

app/code/Magento/Analytics/i18n/en_US.csv

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"These arguments can't be empty ""%1""","These arguments can't be empty ""%1"""
1717
"Cannot find predefined integration user!","Cannot find predefined integration user!"
1818
"File is not ready yet.","File is not ready yet."
19+
"Your Base URL has been changed and your reports are being updated. Advanced Reporting will be available once this change has been processed. Please try again later.","Your Base URL has been changed and your reports are being updated. Advanced Reporting will be available once this change has been processed. Please try again later."
1920
"Failed to synchronize data to the Magento Business Intelligence service. ","Failed to synchronize data to the Magento Business Intelligence service. "
2021
"<a href=""%1"">Retry Synchronization</a>","<a href=""%1"">Retry Synchronization</a>"
2122
TestMessage,TestMessage
@@ -49,6 +50,24 @@ Industry,Industry
4950
href=""https://dashboard.rjmetrics.com/v2/magento/signup/"">BI Essentials</a> tier.","Magento Business Intelligence provides you with a simple and clear path to
5051
becoming more data driven.</br> Learn more about <a target=""_blank""
5152
href=""https://dashboard.rjmetrics.com/v2/magento/signup/"">BI Essentials</a> tier."
53+
"Auto Parts","Auto Parts"
54+
"Baby/Children’s Apparel, Gear and Toys","Baby/Children’s Apparel, Gear and Toys"
55+
"Beauty and Cosmetics","Beauty and Cosmetics"
56+
"Books, Music and Magazines","Books, Music and Magazines"
57+
"Crafts and Stationery","Crafts and Stationery"
58+
"Consumer Electronics","Consumer Electronics"
59+
"Deal Site","Deal Site"
60+
"Fashion Apparel and Accessories","Fashion Apparel and Accessories"
61+
"Food, Beverage and Grocery","Food, Beverage and Grocery"
62+
"Home Goods and Furniture","Home Goods and Furniture"
63+
"Home Improvement","Home Improvement"
64+
"Jewelry and Watches","Jewelry and Watches"
65+
"Mass Merchant","Mass Merchant"
66+
"Office Supplies","Office Supplies"
67+
"Outdoor and Camping Gear","Outdoor and Camping Gear"
68+
"Pet Goods","Pet Goods"
69+
"Pharma and Medical Devices","Pharma and Medical Devices"
70+
"Technology B2B","Technology B2B"
5271
"Analytics Subscription","Analytics Subscription"
5372
"powered by Magento Business Intelligence","powered by Magento Business Intelligence"
5473
"<p>When you turn on Advanced

app/code/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getOptionText($value)
2424
if (sizeof($options) > 0) {
2525
foreach ($options as $option) {
2626
if (isset($option['value']) && $option['value'] == $value) {
27-
return $option['label'];
27+
return __($option['label']);
2828
}
2929
}
3030
}

app/code/Magento/Catalog/etc/adminhtml/di.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
<arguments>
2121
<argument name="imageTypes" xsi:type="array">
2222
<item name="small" xsi:type="array">
23-
<item name="title" xsi:type="string">Small</item>
23+
<item name="title" xsi:type="string" translatable="true">Small</item>
2424
<item name="attribute" xsi:type="string">small_image</item>
2525
</item>
2626
<item name="main" xsi:type="array">
27-
<item name="title" xsi:type="string">Main</item>
27+
<item name="title" xsi:type="string" translatable="true">Main</item>
2828
<item name="attribute" xsi:type="string">image</item>
2929
</item>
3030
<item name="cart" xsi:type="array">
31-
<item name="title" xsi:type="string">Thumbnail</item>
31+
<item name="title" xsi:type="string" translatable="true">Thumbnail</item>
3232
<item name="attribute" xsi:type="string">thumbnail</item>
3333
</item>
3434
<item name="custom" xsi:type="array">
35-
<item name="title" xsi:type="string">Custom image</item>
35+
<item name="title" xsi:type="string" translatable="true">Custom image</item>
3636
<item name="attribute" xsi:type="string">custom_image</item>
3737
</item>
3838
</argument>

app/code/Magento/Catalog/etc/di.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@
144144
<argument name="options" xsi:type="array">
145145
<item name="option1" xsi:type="array">
146146
<item name="value" xsi:type="string">container1</item>
147-
<item name="label" xsi:type="string">Product Info Column</item>
147+
<item name="label" xsi:type="string" translatable="true">Product Info Column</item>
148148
</item>
149149
<item name="option2" xsi:type="array">
150150
<item name="value" xsi:type="string">container2</item>
151-
<item name="label" xsi:type="string">Block after Info Column</item>
151+
<item name="label" xsi:type="string" translatable="true">Block after Info Column</item>
152152
</item>
153153
</argument>
154154
</arguments>

app/code/Magento/Catalog/i18n/en_US.csv

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Catalog,Catalog
210210
"An attribute with this code already exists.","An attribute with this code already exists."
211211
"An attribute with the same code (%1) already exists.","An attribute with the same code (%1) already exists."
212212
"The value of Admin must be unique.","The value of Admin must be unique."
213+
"The value of Admin scope can't be empty.","The value of Admin scope can't be empty."
213214
"You duplicated the product.","You duplicated the product."
214215
"This product doesn't exist.","This product doesn't exist."
215216
"Invalid product id. Should be numeric value greater than 0","Invalid product id. Should be numeric value greater than 0"
@@ -622,9 +623,13 @@ OK,OK
622623
"Image Detail","Image Detail"
623624
Adding...,Adding...
624625
Added,Added
626+
"does not implement Storage Interface","does not implement Storage Interface"
625627
"unselect all","unselect all"
626628
Inventory,Inventory
627629
"Catalog Section","Catalog Section"
630+
Small,Small
631+
Main,Main
632+
"Custom image","Custom image"
628633
"Product Fields Auto-Generation","Product Fields Auto-Generation"
629634
"Mask for SKU","Mask for SKU"
630635
"Use {{name}} as Product Name placeholder","Use {{name}} as Product Name placeholder"
@@ -633,6 +638,10 @@ Inventory,Inventory
633638
"Use {{name}} as Product Name or {{sku}} as Product SKU placeholders","Use {{name}} as Product Name or {{sku}} as Product SKU placeholders"
634639
"Mask for Meta Description","Mask for Meta Description"
635640
"Use {{name}} and {{description}} as Product Name and Product Description placeholders","Use {{name}} and {{description}} as Product Name and Product Description placeholders"
641+
"Recently Viewed/Compared Products","Recently Viewed/Compared Products"
642+
"Lifetime of products in Recently Viewed Widget","Lifetime of products in Recently Viewed Widget"
643+
"Lifetime of products in Recently Compared Widget","Lifetime of products in Recently Compared Widget"
644+
"Synchronize widget products with backend storage","Synchronize widget products with backend storage"
636645
Storefront,Storefront
637646
"List Mode","List Mode"
638647
"Products per Page on Grid Allowed Values","Products per Page on Grid Allowed Values"
@@ -666,6 +675,8 @@ Comma-separated.,Comma-separated.
666675
"Use Static URLs for Media Content in WYSIWYG for Catalog","Use Static URLs for Media Content in WYSIWYG for Catalog"
667676
"This applies only to catalog products and categories. Media content will be inserted into the editor as a static URL. Media content is not updated if the system configuration base URL changes.","This applies only to catalog products and categories. Media content will be inserted into the editor as a static URL. Media content is not updated if the system configuration base URL changes."
668677
"Top Level Category","Top Level Category"
678+
"Product Info Column","Product Info Column"
679+
"Block after Info Column","Block after Info Column"
669680
"Product Flat Data","Product Flat Data"
670681
"Reorganize EAV product structure to flat structure","Reorganize EAV product structure to flat structure"
671682
"Category Flat Data","Category Flat Data"
@@ -709,6 +720,22 @@ Template,Template
709720
"If empty, we'll use the category name here.","If empty, we'll use the category name here."
710721
"Category Link Block Template","Category Link Block Template"
711722
"Category Link Inline Template","Category Link Inline Template"
723+
"Recently Viewed Products","Recently Viewed Products"
724+
"List of Products Recently Viewed by Visitor","List of Products Recently Viewed by Visitor"
725+
"UI Component","UI Component"
726+
"Number of Products to display","Number of Products to display"
727+
"Product attributes to show","Product attributes to show"
728+
Image,Image
729+
"Learn More Link","Learn More Link"
730+
"Buttons to show","Buttons to show"
731+
"Add to Wishlist","Add to Wishlist"
732+
"Viewed Products Grid Template","Viewed Products Grid Template"
733+
"Viewed Products List Template","Viewed Products List Template"
734+
"Viewed Products Sidebar Template","Viewed Products Sidebar Template"
735+
"Recently Compared Products","Recently Compared Products"
736+
"List of Products Recently Compared by Visitor","List of Products Recently Compared by Visitor"
737+
"Compared Products Grid Template","Compared Products Grid Template"
738+
"Compared Products List Template","Compared Products List Template"
712739
Set,Set
713740
"Category Information","Category Information"
714741
"Enable Category","Enable Category"
@@ -763,3 +790,8 @@ Overview,Overview
763790
"Skip to the end of the images gallery","Skip to the end of the images gallery"
764791
"Skip to the beginning of the images gallery","Skip to the beginning of the images gallery"
765792
Details,Details
793+
"Recently Compared","Recently Compared"
794+
"Add To Cart","Add To Cart"
795+
"Add To Compare","Add To Compare"
796+
"Learn more","Learn more"
797+
"Recently Viewed","Recently Viewed"

app/code/Magento/CatalogUrlRewrite/Model/CategoryBasedProductRewriteGenerator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Catalog\Model\Category;
99
use Magento\Catalog\Model\Product;
10-
use Magento\Store\Model\Store;
1110
use Magento\Catalog\Model\Product\Visibility;
1211

1312
/**
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CatalogUrlRewrite\Model;
7+
8+
use Magento\Catalog\Model\Product;
9+
use Magento\Catalog\Model\Product\Visibility;
10+
11+
/**
12+
* Class ProductUrlRewriteGenerator
13+
* @package Magento\CatalogUrlRewrite\Model
14+
*/
15+
class CategoryProductUrlPathGenerator
16+
{
17+
/**
18+
* @var ProductScopeRewriteGenerator
19+
*/
20+
private $productScopeRewriteGenerator;
21+
22+
/**
23+
* @param ProductScopeRewriteGenerator $productScopeRewriteGenerator
24+
*/
25+
public function __construct(
26+
ProductScopeRewriteGenerator $productScopeRewriteGenerator
27+
) {
28+
$this->productScopeRewriteGenerator = $productScopeRewriteGenerator;
29+
}
30+
31+
/**
32+
* Generate product url rewrites based on all product categories
33+
*
34+
* @param \Magento\Catalog\Model\Product $product
35+
* @param int|null $rootCategoryId
36+
* @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[]
37+
*/
38+
public function generate(Product $product, $rootCategoryId = null)
39+
{
40+
if ($product->getVisibility() == Visibility::VISIBILITY_NOT_VISIBLE) {
41+
return [];
42+
}
43+
44+
$storeId = $product->getStoreId();
45+
46+
$productCategories = $product->getCategoryCollection()
47+
->addAttributeToSelect('url_key')
48+
->addAttributeToSelect('url_path');
49+
50+
$urls = $this->productScopeRewriteGenerator->isGlobalScope($storeId)
51+
? $this->productScopeRewriteGenerator->generateForGlobalScope(
52+
$productCategories,
53+
$product,
54+
$rootCategoryId
55+
)
56+
: $this->productScopeRewriteGenerator->generateForSpecificStoreView(
57+
$storeId,
58+
$productCategories,
59+
$product,
60+
$rootCategoryId
61+
);
62+
63+
return $urls;
64+
}
65+
}

app/code/Magento/CatalogUrlRewrite/Observer/UrlRewriteHandler.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UrlRewriteHandler
2525
/** @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory */
2626
protected $productCollectionFactory;
2727

28-
/** @var \Magento\CatalogUrlRewrite\Model\CategoryBasedProductRewriteGenerator */
28+
/** @var \Magento\CatalogUrlRewrite\Model\CategoryProductUrlPathGenerator */
2929
private $categoryBasedProductRewriteGenerator;
3030

3131
/** @var \Magento\UrlRewrite\Model\MergeDataProvider */
@@ -40,6 +40,7 @@ class UrlRewriteHandler
4040
* @param \Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator $productUrlRewriteGenerator
4141
* @param \Magento\UrlRewrite\Model\UrlPersistInterface $urlPersist
4242
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
43+
* @param \Magento\CatalogUrlRewrite\Model\CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator
4344
* @param \Magento\UrlRewrite\Model\MergeDataProviderFactory|null $mergeDataProviderFactory
4445
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
4546
*/
@@ -49,6 +50,7 @@ public function __construct(
4950
\Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator $productUrlRewriteGenerator,
5051
\Magento\UrlRewrite\Model\UrlPersistInterface $urlPersist,
5152
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
53+
\Magento\CatalogUrlRewrite\Model\CategoryProductUrlPathGenerator $categoryBasedProductRewriteGenerator,
5254
\Magento\UrlRewrite\Model\MergeDataProviderFactory $mergeDataProviderFactory = null,
5355
\Magento\Framework\Serialize\Serializer\Json $serializer = null
5456
) {
@@ -57,6 +59,7 @@ public function __construct(
5759
$this->productUrlRewriteGenerator = $productUrlRewriteGenerator;
5860
$this->urlPersist = $urlPersist;
5961
$this->productCollectionFactory = $productCollectionFactory;
62+
$this->categoryBasedProductRewriteGenerator = $categoryBasedProductRewriteGenerator;
6063

6164
if (!isset($mergeDataProviderFactory)) {
6265
$mergeDataProviderFactory = \Magento\Framework\App\ObjectManager::getInstance()->get(
@@ -130,7 +133,7 @@ public function generateProductUrlRewrites(\Magento\Catalog\Model\Category $cate
130133
* @param int|null $rootCategoryId
131134
* @return array
132135
*/
133-
public function getCategoryProductsUrlRewrites(
136+
private function getCategoryProductsUrlRewrites(
134137
\Magento\Catalog\Model\Category $category,
135138
$storeId,
136139
$saveRewriteHistory,
@@ -158,29 +161,13 @@ public function getCategoryProductsUrlRewrites(
158161
$product->setStoreId($storeId);
159162
$product->setData('save_rewrites_history', $saveRewriteHistory);
160163
$mergeDataProvider->merge(
161-
$this->getCategoryBasedProductRewriteGenerator()->generate($product, $category, $rootCategoryId)
164+
$this->categoryBasedProductRewriteGenerator->generate($product, $rootCategoryId)
162165
);
163166
}
164167

165168
return $mergeDataProvider->getData();
166169
}
167170

168-
/**
169-
* Retrieve generator, which use single category for different products
170-
*
171-
* @deprecated
172-
* @return \Magento\CatalogUrlRewrite\Model\CategoryBasedProductRewriteGenerator|mixed
173-
*/
174-
private function getCategoryBasedProductRewriteGenerator()
175-
{
176-
if (!$this->categoryBasedProductRewriteGenerator) {
177-
$this->categoryBasedProductRewriteGenerator = \Magento\Framework\App\ObjectManager::getInstance()
178-
->get(\Magento\CatalogUrlRewrite\Model\CategoryBasedProductRewriteGenerator::class);
179-
}
180-
181-
return $this->categoryBasedProductRewriteGenerator;
182-
}
183-
184171
/**
185172
* @param \Magento\Catalog\Model\Category $category
186173
* @return void

0 commit comments

Comments
 (0)