PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 All 166 releases
← All changes | includes/Services/Tax_Id_Detector.php +5 -8 1.10.1 → 1.10.21 View file →
@@ -231,9 +231,8 @@
231 231 'limit' => $limit,
232 232 'orderby' => 'date',
233 233 'order' => 'DESC',
234 234 'status' => 'any',
235 - 'return' => 'ids',
236 235 )
237 236 );
238 237 if ( ! \is_array( $orders ) || empty( $orders ) ) {
239 238 return array();
@@ -240,18 +239,16 @@
240 239 }
241 240
242 241 // Tally populated rows per candidate.
243 242 $counts = array_fill_keys( array_keys( $candidates ), 0 );
244 - foreach ( $orders as $order_id ) {
245 - if ( \is_object( $order_id ) && \method_exists( $order_id, 'get_id' ) ) {
246 - $order_id = $order_id->get_id();
247 - }
248 - $meta = \get_post_meta( (int) $order_id );
249 - if ( ! \is_array( $meta ) || empty( $meta ) ) {
243 + foreach ( $orders as $order ) {
244 + // Read meta through the order object: with HPOS on (and sync off) it lives
245 + // in wc_orders_meta, where get_post_meta() finds nothing.
246 + if ( ! \is_object( $order ) || ! \method_exists( $order, 'get_meta' ) ) {
250 247 continue;
251 248 }
252 249 foreach ( $candidates as $meta_key => $_type ) {
253 - $value = isset( $meta[ $meta_key ][0] ) ? $meta[ $meta_key ][0] : null;
250 + $value = $order->get_meta( $meta_key );
254 251 if ( '' === $value || array() === $value || null === $value ) {
255 252 continue;
256 253 }
257 254 ++$counts[ $meta_key ];