We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89b4e2e commit 0ff6732Copy full SHA for 0ff6732
app/code/Magento/CatalogUrlRewrite/Model/Storage/DynamicStorage.php
@@ -170,7 +170,7 @@ private function findProductRewriteByRequestPath(array $data): ?array
170
}
171
$categorySuffix = $this->getCategoryUrlSuffix($data[UrlRewrite::STORE_ID]);
172
$productResource = $this->productFactory->create();
173
- $categoryPath = str_replace('/' . $productUrl, '', $requestPath);
+ $categoryPath = substr($requestPath, 0, -1 * strlen('/' . $productUrl));
174
if ($productFromDb[UrlRewrite::REDIRECT_TYPE]) {
175
$productUrl = $productFromDb[UrlRewrite::TARGET_PATH];
176
0 commit comments