Update usage of get_used_coupon_codes to get_coupon_codes

This commit is contained in:
Gerhard 2019-05-14 11:21:27 +02:00
parent efe3e4c5d6
commit 486321161c
2 changed files with 5 additions and 5 deletions

View File

@ -854,8 +854,8 @@ function wc_update_coupon_usage_counts( $order_id ) {
return;
}
if ( count( $order->get_used_coupon_codes() ) > 0 ) {
foreach ( $order->get_used_coupon_codes() as $code ) {
if ( count( $order->get_coupon_codes() ) > 0 ) {
foreach ( $order->get_coupon_codes() as $code ) {
if ( ! $code ) {
continue;
}

View File

@ -452,9 +452,9 @@ class WC_Tests_CRUD_Orders extends WC_Unit_Test_Case {
}
/**
* Test: get_used_coupon_codes
* Test: get_coupon_codes
*/
public function test_get_used_coupon_codes() {
public function test_get_coupon_codes() {
$object = new WC_Order();
$item = new WC_Order_Item_Coupon();
$item->set_props(
@ -466,7 +466,7 @@ class WC_Tests_CRUD_Orders extends WC_Unit_Test_Case {
);
$object->add_item( $item );
$object->save();
$this->assertCount( 1, $object->get_used_coupon_codes() );
$this->assertCount( 1, $object->get_coupon_codes() );
}
/**