Skip to content

Commit d99a39f

Browse files
committed
gw-create-coupon.php: Fixed WooCommerce coupon description not set issue.
1 parent e21b59b commit d99a39f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gravity-forms/gw-create-coupon.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Create coupons via Gravity Forms submissions. Map the coupon code to a field on the GF form and voila!
66
*
7-
* @version 1.2.2
7+
* @version 1.2.3
88
* @author David Smith <[email protected]>
99
* @license GPL-2.0+
1010
* @link WooCommerce: http://gravitywiz.com/creating-coupons-woocommerce-gravity-forms/
@@ -190,10 +190,10 @@ public function create_coupon_wc( $coupon_name, $coupon_code, $amount, $type, $e
190190
$start_date = $date->format( 'Y-m-d H:i:s' );
191191
}
192192

193-
// 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
193+
// 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
194194
$coupon = array(
195195
'post_title' => $coupon_code,
196-
'post_content' => $coupon_name,
196+
'post_excerpt' => $coupon_name,
197197
'post_status' => 'publish',
198198
'post_author' => 1,
199199
'post_type' => 'shop_coupon',

0 commit comments

Comments
 (0)