However when I add in 2 or more variants, then the calculation breaks and the wrong figure is shown. This resolves itself when I delete the second variant. You can see that the Superbly Stainless option (which has two variants) has the incorrect saving calculation, while the other two products which only have 1 product variant have the right saving calculation:
This issue occurs on all pages where the product card shows, including on the product page iteself.
Can anyone suggest how to adapt this code so that it works to correctly display the saving on products with multiple variants?