I have a magento 2.2.9 based site and wondering if its possible to get a product via url by having the sku in the url?
so something like https://www.domain.com/shop/?sku=123
Wanted to know if there is a default way to do this that wouldn't require building any custom module.
Best Answer
Try below code:
If Url like this https://www.domain.com/shop/?sku=123, then
Using Construct Method:
Using Object Manager
Note: Magento did not recommend the Object Manager Method
I hope it will helps...!!!