Thank you for that further information.
I see what you mean about the duplicated code (albeit with one set without the workaround).
The first code is being pulled in by my functions.php file as part of the header and the top "View Cart" button, and it was in functions.php that I changed the code for the workaround. The fact that there is a second set of code being pulled in had passed me by, and I see that this has not got the workaround which means that it must be being pulled in for a second time, from a separate file somewhere... now I just need to find where!
I will need to look into this further, as a cursory scan around failed to find the source.
I suspect that it must be loading automatically with the footer, for the bottom "View Cart" button, but have not been able to find where so far.
Thank for your help, I am sure that once I can find the second source and remove it, it will be fine.