Update usage of get_used_coupon_codes to get_coupon_codes
This commit is contained in:
parent
efe3e4c5d6
commit
486321161c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue