PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
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 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / includes / updates / update-0.4.6.php

update-0.4.6.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.17, at includes/updates/update-0.4.6.php

40 lines 958 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Update to 0.4.6
4 * - fix reports bug.
5 *
6 * @version 0.4.6
7 * @package WCPOS\WooCommercePOS
8 */
9
10 if ( ! \defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 // fix pos orders.
15 $woocommerce_pos_args = array(
16 'post_type' => array( 'shop_order' ),
17 'post_status' => array( 'any' ),
18 'posts_per_page' => - 1,
19 'fields' => 'ids',
20 'meta_query' => array(
21 array(
22 'key' => '_pos',
23 'value' => 1,
24 'compare' => '=',
25 ),
26 ),
27 );
28
29 $woocommerce_pos_query = new WP_Query( $woocommerce_pos_args );
30
31 foreach ( $woocommerce_pos_query->posts as $woocommerce_pos_order_id ) {
32 // check _order_tax and _order_shipping_tax for reports.
33 if ( ! get_post_meta( $woocommerce_pos_order_id, '_order_tax', true ) ) {
34 update_post_meta( $woocommerce_pos_order_id, '_order_tax', 0 );
35 }
36 if ( ! get_post_meta( $woocommerce_pos_order_id, '_order_shipping_tax', true ) ) {
37 update_post_meta( $woocommerce_pos_order_id, '_order_shipping_tax', 0 );
38 }
39 }
40