Hook triggered twice in a Woocommerce single product page

You need to limit yourself to the main loop and this can be done by checking if is_main_query returns true.

This might not be enough as that hook/filter was probably designed with the intention of augmenting the summery and therefor might be called more then once even during execution of the main loop itself. You have two option here

  1. Use a much better hook. The hook name doesn’t sound like something you should trigger any DB write on.

  2. call remove_filter to remove it after the first iteration was done.