Skip to content

Commit 1d497d4

Browse files
committed
Fix orders CLI param and remove unused faker call
1 parent 4919af5 commit 1d497d4

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

includes/Generator/Coupon.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class Coupon extends Generator {
2222
* @return \WC_Customer Customer object with data populated.
2323
*/
2424
public static function generate( $save = true, $min = 5, $max = 100 ) {
25-
self::init_faker();
26-
2725
$amount = random_int( $min, $max );
2826
$coupon_id = "discount$amount";
2927
$coupon = new \WC_Coupon( $coupon_id );

includes/Generator/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function generate( $save = true, $assoc_args = array() ) {
6666

6767
$order->set_date_created( $date );
6868

69-
$include_coupon = ! empty( $assoc_args['status'] );
69+
$include_coupon = ! empty( $assoc_args['coupons'] );
7070
if ( $include_coupon ) {
7171
$coupon = Coupon::generate( true );
7272
$order->apply_coupon( $coupon );

0 commit comments

Comments
 (0)