Return a success code when syncing order products in the case of refunds.

On the initial sync, no products will be deleted by the sync method (which was indicating a false negative before this fix).
This commit is contained in:
Jeff Stieler 2019-02-06 19:16:30 -08:00
parent 56a1a30224
commit 28739b7cf7
1 changed files with 3 additions and 0 deletions

View File

@ -367,6 +367,9 @@ class WC_Admin_Reports_Products_Data_Store extends WC_Admin_Reports_Data_Store i
array( '%d' )
); // WPCS: cache ok, DB call ok.
// Deleting 0 items here isn't a problem, and we should force a successful return.
$result = ( 0 === $result ) ? 1 : $result;
/**
* Fires when product's reports are deleted.
*