@@ 240-242 (lines=3) @@ | ||
237 | ||
238 | try { |
|
239 | $coupon = $this->get_coupon_from_id_or_code( $args[0] ); |
|
240 | if ( ! $coupon ) { |
|
241 | throw new WC_CLI_Exception( 'woocommerce_cli_invalid_coupon', sprintf( __( 'Invalid coupon ID or code: %s', 'woocommerce' ), $args[0] ) ); |
|
242 | } |
|
243 | ||
244 | $coupon_post = get_post( $coupon->id ); |
|
245 | $coupon_data = array( |
|
@@ 430-432 (lines=3) @@ | ||
427 | public function update( $args, $assoc_args ) { |
|
428 | try { |
|
429 | $coupon = $this->get_coupon_from_id_or_code( $args[0] ); |
|
430 | if ( ! $coupon ) { |
|
431 | throw new WC_CLI_Exception( 'woocommerce_cli_invalid_coupon', sprintf( __( 'Invalid coupon ID or code: %s', 'woocommerce' ), $args[0] ) ); |
|
432 | } |
|
433 | ||
434 | $id = $coupon->id; |
|
435 | $coupon_code = $coupon->code; |