0

I would like to ask if it's possible to make magento ignore a string added to a product url. For example, I have a product url: http://mywebsite.lc/product-name

Is it possible that when entering: http://mywebsite.lc/product-name/some-string

magento can still understand and direct to: http://mywebsite.lc/product-name while keeping the string on the url?

I need the string part for some js functions, and also for a friendly URL.

Thanks you

  • Hi @Bao Doan welcome to Magento SE. Can you please explain more. Like what do you want to do? – Ramkishan Suthar Nov 7 '18 at 11:13
0

While your can write a controller and a module to ignore the last part of the item URL you'll also need to set a session variable and check that session variable in your desired js.

That's an Overkill.

A simpler approach would be to use

http://mywebsite.lc/product-name/?custom=some-string 

Then you can simply add js to check value of the custom url parameters

| improve this answer | |
  • thanks for answering, yeah it can work like that. But there gonna be a param on the URL, which is not exactly user friendly – Bảo Đoàn Nov 8 '18 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.