Title: Undefined index: discount_code
Last modified: September 14, 2021

---

# Undefined index: discount_code

 *  [Brian Henry](https://wordpress.org/support/users/brianhenryie/)
 * (@brianhenryie)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/undefined-index-discount_code/)
 * `PHP Notice: Undefined index: discount_code in /path/to/wp-content/plugins/goaffpro/
   goaffpro.php on line 140`
 * Change to.
 * `$coupon_code = isset( $_COOKIE['discount_code'] ) ? sanitize_text_field( $_COOKIE['
   discount_code'] ) : '';`
 * Use PHPStan or other static analysis tool to highlight these errors.

The topic ‘Undefined index: discount_code’ is closed to new replies.

 * ![](https://ps.w.org/goaffpro/assets/icon.svg?rev=2437187)
 * [Goaffpro Affiliate Marketing](https://wordpress.org/plugins/goaffpro/)
 * [Support Threads](https://wordpress.org/support/plugin/goaffpro/)
 * [Active Topics](https://wordpress.org/support/plugin/goaffpro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/goaffpro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/goaffpro/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Brian Henry](https://wordpress.org/support/users/brianhenryie/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/undefined-index-discount_code/)
 * Status: not resolved