Hello,
This function can be the roots of your issue because she was coded since the beginning of HikaShop (2013) and never change AND nobody have this kind of issue, plus we are okey that your localhost works with the same code, right?
Plus, the description you have made when you speak about url link remove, evokes me a plugin process.
From that, I can only tell you is this two points :
-To be sure of your server isn't leads this, you must test your site on another server.
- Are you sure to have switch off one by one plugins and each time process some test to see if it solve your issue ?
Sorry for this return.
Regards,