Skip to content

Commit

Permalink
gw-create-coupon.php: Fixed WooCommerce coupon description not set …
Browse files Browse the repository at this point in the history
…issue.
  • Loading branch information
malayladu authored Dec 20, 2024
1 parent e21b59b commit a6e4263
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gravity-forms/gw-create-coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Create coupons via Gravity Forms submissions. Map the coupon code to a field on the GF form and voila!
*
* @version 1.2.2
* @version 1.2.3
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link WooCommerce: http://gravitywiz.com/creating-coupons-woocommerce-gravity-forms/
Expand Down Expand Up @@ -190,10 +190,10 @@ public function create_coupon_wc( $coupon_name, $coupon_code, $amount, $type, $e
$start_date = $date->format( 'Y-m-d H:i:s' );
}

// WooCommerce coupon uses the Post Title as the coupon code hence $coupon_code is assigned to Post Title and $coupon_name is assigned to the Post Content
// WooCommerce coupon uses the Post Title as the coupon code hence $coupon_code is assigned to Post Title and $coupon_name is assigned to the Post Excerpt
$coupon = array(
'post_title' => $coupon_code,
'post_content' => $coupon_name,
'post_excerpt' => $coupon_name,
'post_status' => 'publish',
'post_author' => 1,
'post_type' => 'shop_coupon',
Expand Down

0 comments on commit a6e4263

Please sign in to comment.