Commit 6378d44d by lmf

恢复产品URL

parent 920e4987
......@@ -266,8 +266,7 @@ class AbstractProduct extends \Magento\Framework\View\Element\Template
if (!isset($additional['_escape'])) {
$additional['_escape'] = true;
}
return $product->getUrlKey();
//return $product->getUrlModel()->getUrl($product, $additional);
return $product->getUrlModel()->getUrl($product, $additional);
}
return '#';
......
......@@ -182,13 +182,12 @@ class Url extends \Magento\Framework\DataObject
if (!empty($requestPath)) {
$routeParams['_direct'] = $requestPath;
} else {
$routeParams['_direct'] = "products/".$product->getUrlKey();
// $routePath = 'catalog/product/view';
// $routeParams['id'] = $product->getId();
// $routeParams['s'] = $product->getUrlKey();
// if ($categoryId) {
// $routeParams['category'] = $categoryId;
// }
$routePath = 'catalog/product/view';
$routeParams['id'] = $product->getId();
$routeParams['s'] = $product->getUrlKey();
if ($categoryId) {
$routeParams['category'] = $categoryId;
}
}
// 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