Based on your updates of the cart object to this it looks like you are doing this inside of the eCart files. If you use the full cart name reference I think this same code would work on any page in your site so long as there were the include files for the cart. If you had it just on a page then you could edit the cart and have it not overwrite the code. I'm glad it worked out for you though.