Commit 6378d44d by lmf

恢复产品URL

parent 920e4987
...@@ -266,8 +266,7 @@ class AbstractProduct extends \Magento\Framework\View\Element\Template ...@@ -266,8 +266,7 @@ class AbstractProduct extends \Magento\Framework\View\Element\Template
if (!isset($additional['_escape'])) { if (!isset($additional['_escape'])) {
$additional['_escape'] = true; $additional['_escape'] = true;
} }
return $product->getUrlKey(); return $product->getUrlModel()->getUrl($product, $additional);
//return $product->getUrlModel()->getUrl($product, $additional);
} }
return '#'; return '#';
......
...@@ -182,13 +182,12 @@ class Url extends \Magento\Framework\DataObject ...@@ -182,13 +182,12 @@ class Url extends \Magento\Framework\DataObject
if (!empty($requestPath)) { if (!empty($requestPath)) {
$routeParams['_direct'] = $requestPath; $routeParams['_direct'] = $requestPath;
} else { } else {
$routeParams['_direct'] = "products/".$product->getUrlKey(); $routePath = 'catalog/product/view';
// $routePath = 'catalog/product/view'; $routeParams['id'] = $product->getId();
// $routeParams['id'] = $product->getId(); $routeParams['s'] = $product->getUrlKey();
// $routeParams['s'] = $product->getUrlKey(); if ($categoryId) {
// if ($categoryId) { $routeParams['category'] = $categoryId;
// $routeParams['category'] = $categoryId; }
// }
} }
// reset cached URL instance GET query params // reset cached URL instance GET query params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment