Title: code looks wrong and doubles total
Last modified: July 14, 2026

---

# code looks wrong and doubles total

 *  [technicalx](https://wordpress.org/support/users/technicalx/)
 * (@technicalx)
 * [4 days, 12 hours ago](https://wordpress.org/support/topic/code-looks-wrong-and-doubles-total/)
 * This can’t be correct, running get_total() twice in a template increases the 
   total each time.
 * **pdf-invoices-for-gravity-forms/includes/class-pcafe-gfpi-helpers.php**
 *     ```wp-block-code
       public static function get_total(){        self::$total += self::get_subtotal();        self::$total += self::$shipping;                return self::$total;    }
       ```
   

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-looks-wrong-and-doubles-total%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/pdf-invoices-for-gravity-forms/assets/icon-256x256.png?rev
   =3568744)
 * [PDF Invoices for Gravity Forms](https://wordpress.org/plugins/pdf-invoices-for-gravity-forms/)
 * [Support Threads](https://wordpress.org/support/plugin/pdf-invoices-for-gravity-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/pdf-invoices-for-gravity-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pdf-invoices-for-gravity-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pdf-invoices-for-gravity-forms/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [technicalx](https://wordpress.org/support/users/technicalx/)
 * Last activity: [4 days, 12 hours ago](https://wordpress.org/support/topic/code-looks-wrong-and-doubles-total/)
 * Status: not resolved