Plugin Directory

Changeset 2428367


Ignore:
Timestamp:
11/30/2020 06:19:47 AM (5 years ago)
Author:
doshii
Message:

Submitting changes for release 2.3.2

Location:
doshii
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • doshii/trunk/README.txt

    r2427008 r2428367  
    55Requires at least: 4.7
    66Tested up to: 5.5.1
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    6060== Changelog ==
    6161
    62 = 2.3.1 =
     62= 2.3.2 =
    6363
    6464Improved remote troubleshooting capabilities
  • doshii/trunk/doshii_function.php

    r2427008 r2428367  
    77Author URI:
    88Contributors:
    9 Version: 2.3.1
     9Version: 2.3.2
    1010*/
    1111
     
    3030
    3131register_activation_hook( __FILE__, 'doshii_on_activation' );
    32 wp_enqueue_style( 'doshiistyle', DOSHII_BASE_URL . 'include/assets/css/doshii-style.css',false,'2.3.1','all');
     32wp_enqueue_style( 'doshiistyle', DOSHII_BASE_URL . 'include/assets/css/doshii-style.css',false,'2.3.2','all');
    3333include(DOSHII_BASE_DIR . '/include/woo-doshii-dbtable.php');
    3434include(DOSHII_BASE_DIR . '/include/woo-checkout-fields.php');
  • doshii/trunk/include/woo-doshii-initialise.php

    r2427008 r2428367  
    4040       'x-doshii-location-id' => $locationId.'',
    4141       'content-Type' => 'application/json',
    42        'x-doshii-writeout' => 'WooCommerce 2.3.1',
     42       'x-doshii-writeout' => 'WooCommerce 2.3.2',
    4343    );
    4444
  • doshii/trunk/include/woo-doshii-product-sync.php

    r2427008 r2428367  
    4141            'x-doshii-location-id' => $locationId.'',
    4242            'content-Type' => 'application/json',
    43             'x-doshii-writeout' => 'WooCommerce 2.3.1',
     43            'x-doshii-writeout' => 'WooCommerce 2.3.2',
    4444        )
    4545    ));
  • doshii/trunk/include/woo-order-api.php

    r2427008 r2428367  
    2727    $transactionsData =[];
    2828    $surcounts = [];
     29    $taxes = [];
    2930    $doshiiOrderType = '';
    3031
     
    9798    }
    9899
    99     $shippingTotal = doshii_to_cents($order->get_shipping_total());
     100    $shippingTotal = doshii_to_cents($order->get_shipping_total() + $order->get_shipping_tax());
    100101    if ($shippingTotal && $shippingTotal > 0) {
    101102        $shippingFeePosId = $doshii_options['shipping_fee_id'];
     
    118119    }
    119120
     121    $taxTotal = doshii_to_cents($order->get_cart_tax());
     122    array_push($taxes, (object)[
     123        'name' => 'Tax',
     124        'amount' => $taxTotal,
     125        'type' => 'absolute',
     126        'taxType' => $order->get_prices_include_tax() ? 'inclusive' : 'exclusive',
     127        'value' => $taxTotal
     128    ]);
     129
    120130    foreach ( $order->get_items( 'coupon' ) as $coupon ) {
    121131        $couponCode = $coupon->get_code();
     
    150160    $externalOrderRef = $order_id;
    151161
     162    $woocommerceItems = [];
    152163    foreach ( $order->get_items() as $item_id => $item ) {
     164        array_push($woocommerceItems, $item->get_data());
    153165        $product_id = $item->get_product_id();
    154166        $variation_id = $item->get_variation_id();
     
    158170        $name = $item->get_name();
    159171        $quantity = $item->get_quantity();
    160         $subtotal = $item->get_subtotal();
     172        $subtotal = $order->get_line_total($item, $order->get_prices_include_tax(), true);
    161173
    162174        $productPrice = doshii_to_cents($product_price);
     
    435447       'items' => $itemData,
    436448       'surcounts' => $surcounts,
    437        'taxes' => []
     449       'taxes' => $taxes
    438450    ];
    439451
     
    465477        $doshiiOrder->notes = strlen($notes) > 255 ? substr($notes, 255) : $notes;
    466478    }
     479
     480    $woocommerceOrder = $order->get_data();
     481    $woocommerceOrder['order_items'] = $woocommerceItems;
    467482    $doshiiOrderPayload = (object) [
    468483        'order' => $doshiiOrder,
     
    474489        ],
    475490        'transactions' => $transactionsData,
    476         'woocommerce' => $order->get_data()
     491        'woocommerce' => $woocommerceOrder
    477492    ];
    478493
     
    487502                'accept' => 'application/json',
    488503                'Accept-encoding' => 'gzip',
    489                 'x-doshii-writeout' => 'WooCommerce 2.3.1',
     504                'x-doshii-writeout' => 'WooCommerce 2.3.2',
    490505            ),
    491506            'body' => json_encode($doshiiOrderPayload)
  • doshii/trunk/include/woo-order-status.php

    r2427008 r2428367  
    3939                'x-doshii-location-id' => $doshii_options['location_id'].'',
    4040                'content-Type' => 'application/json',
    41                 'x-doshii-writeout' => 'WooCommerce 2.3.1',
     41                'x-doshii-writeout' => 'WooCommerce 2.3.2',
    4242            )
    4343        ));
Note: See TracChangeset for help on using the changeset viewer.