File tree Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Expand file tree Collapse file tree 5 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 18
18
*/
19
19
class Product extends \Magento \Framework \Url \Helper \Data
20
20
{
21
- const XML_PATH_PRODUCT_URL_USE_CATEGORY = 'catalog/seo/product_use_categories ' ;
21
+ public const XML_PATH_PRODUCT_URL_USE_CATEGORY = 'catalog/seo/product_use_categories ' ;
22
22
23
- const XML_PATH_USE_PRODUCT_CANONICAL_TAG = 'catalog/seo/product_canonical_tag ' ;
23
+ public const XML_PATH_USE_PRODUCT_CANONICAL_TAG = 'catalog/seo/product_canonical_tag ' ;
24
24
25
- const XML_PATH_AUTO_GENERATE_MASK = 'catalog/fields_masks ' ;
25
+ public const XML_PATH_AUTO_GENERATE_MASK = 'catalog/fields_masks ' ;
26
+
27
+ public const XML_PATH_APPLY_TRANSLITERATION_TO_URL = 'catalog/seo/product_url_transliteration ' ;
26
28
27
29
/**
28
30
* Flag that shows if Magento has to check product to be saleable (enabled and/or inStock)
Original file line number Diff line number Diff line change @@ -114,7 +114,14 @@ public function getProductUrl($product, $useSid = null)
114
114
*/
115
115
public function formatUrlKey ($ str )
116
116
{
117
- return $ this ->filter ->translitUrl ($ str );
117
+ if ($ this ->scopeConfig ->getValue (
118
+ \Magento \Catalog \Helper \Product::XML_PATH_APPLY_TRANSLITERATION_TO_URL ,
119
+ \Magento \Store \Model \ScopeInterface::SCOPE_STORE
120
+ )) {
121
+ return $ this ->filter ->translitUrl ($ str );
122
+ }
123
+
124
+ return $ str ;
118
125
}
119
126
120
127
/**
Original file line number Diff line number Diff line change 127
127
<label >Use Canonical Link Meta Tag For Products</label >
128
128
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
129
129
</field >
130
+ <field id =" product_url_transliteration" translate =" label" type =" select" sortOrder =" 9" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" canRestore =" 1" >
131
+ <label >Apply transliteration for product URL</label >
132
+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
133
+ </field >
130
134
</group >
131
135
<group id =" price" translate =" label" type =" text" sortOrder =" 400" showInDefault =" 1" >
132
136
<label >Price</label >
Original file line number Diff line number Diff line change 48
48
<title_separator >-</title_separator >
49
49
<category_canonical_tag >0</category_canonical_tag >
50
50
<product_canonical_tag >0</product_canonical_tag >
51
+ <product_url_transliteration >1</product_url_transliteration >
51
52
</seo >
52
53
<custom_options >
53
54
<date_fields_order >m,d,y</date_fields_order >
Original file line number Diff line number Diff line change @@ -665,6 +665,7 @@ Comma-separated.,Comma-separated.
665
665
"Page Title Separator","Page Title Separator"
666
666
"Use Canonical Link Meta Tag For Categories","Use Canonical Link Meta Tag For Categories"
667
667
"Use Canonical Link Meta Tag For Products","Use Canonical Link Meta Tag For Products"
668
+ "Apply transliteration for product URL","Apply transliteration for product URL"
668
669
"Catalog Price Scope","Catalog Price Scope"
669
670
"This defines the base currency scope (""Currency Setup"" > ""Currency Options"" > ""Base Currency"").","This defines the base currency scope (""Currency Setup"" > ""Currency Options"" > ""Base Currency"")."
670
671
"Category Top Navigation","Category Top Navigation"
You can’t perform that action at this time.
0 commit comments