Since you (evidently) already have the Store URL set correctly to your domain name in admin system > settings > details (and this is the only directly related setting), the AbanteCart is supposed to pick it up for these links generation. Just look at how HTTP SERVER and HOST are being used in
~/public_html/core/init.php (there's also your 'localhost' mentioned in it) to render the links for the storefront in the php and passed to the tpls. Then at some point later the cache files come into play. You do have supported PHP version, do you?
The problem started when I switched from default template to html5.
I know if I clear the category cache then the problem goes away for a while.
Sounds like a software bug triggered by the switch ?
As the old default html template appears to be rarely used, the switch could be overlooked QA scenario..
Maybe someone from Abantecart team could help figure out this one.