Get Product by ID?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anni tempo fa
Hi.

Using NC 3.90.

I want to create a separate page for searching products by Id. It is just a kinda tool for customers to get the Product URL knowing its ID. There will be an input text field and a button asking to put Product ID and then it will redirect to its product page.
For example...
Product ID is: 535
Product URL for 535 is: /nike-shoes-blue-color

So after customer types 535 in product ID field and clicks Submit it redirects to /nike-shoes-blue-color

Is there any way to do it without changing Core code, only using .CSHTML files?

PS: I understand how I do it for admin for myself. I will just use jQuery and get the ID from input and change the admin product link to: /Admin/Product/Edit/535

Please, offer solution.

Thanks in advance!
2 anni tempo fa
You could install the SevenSpikes API plugin (https://github.com/SevenSpikes/api-plugin-for-nopcommerce/tree/nopcommerce-3.90), then use jquery to post to the product controller 'GetProductById', then get the SeName from that response, and then redirect.
2 anni tempo fa
Is there any way to do it without the plugin?
2 anni tempo fa
zaf wrote:
Is there any way to do it without the plugin?


Not that I'm aware, as the core 'GetproductById' doesn't allow 'GET' so you can't call it via ajax.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.