The following Javascript code Works great on Opencart 2.3.0.2
But found one issue products with option redirects to https://www.mywebsite.com/undefined i.e.404 error