suppose if their is any product url with
https://www.testing.com/product-one.html
If their is any product attribute eg:- let the attribute is product SKU so the
product SKU value is = 125482
so the requirement is if is it possible to open that product along with SKU as well like
Hi @ersandeepgu,
Greetings!
For adding SKU in product URL
->You need to create a custom module
->override /vendor/magento/module-catalog-url-rewrite/Model/ProductUrlPathGenerator.php
Where in prepareProductUrlKey()
return $product->formatUrlKey($urlKey === '' || $urlKey === null ? $product->getName() : $urlKey);
you need to replace this file with
return $product->formatUrlKey($urlKey === '' || $urlKey === null ? $product->getName() . "-" . $product->getSku() : $urlKey);
Hope this will help you solve the issue.
If not, please feel free to reach out to us.
Solved? Click KUDOS and accept it as a solution.
Thank you
Hi namitapare2a78,
Thanks for your reply and efforts,
but as per your reply, this is not our requirement, I want "/" instead of "-" along with product URL key along with sku.
Thanks.
Hi @ersandeepgu,
Greetings!
Then please use "/" where I have used "-".
Check and let me know if it works for you or not.
Solved? Click KUDOS and accept it as a solution.
Thank you
Hi @namitapare2a78 ,
Greetings!