My recommendation would be to simplify this model and permit the selection of charity on either one of the checkout pages (probably checkout shipping) or the account creation/my account pages.

There are lots of stores that allow you to add a charity donation or earmark a percentage of the profits to charity, but I have never seen one that makes you do it per product.