Plugin Directory

Changeset 1601154


Ignore:
Timestamp:
02/22/2017 08:54:29 AM (9 years ago)
Author:
channelengine
Message:

Fix VAT calculations and wuunder support

Location:
channelengine-woocommerce/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • channelengine-woocommerce/trunk/admin/class-channel-engine-api.php

    r1595768 r1601154  
    258258            $wc_order->set_address($shippingAddress, 'shipping');
    259259
    260             if($this->is_plugin_active('/woocommerce_wuunder/woocommerce-wuunder.php'))
    261             {
    262                 update_post_meta($wc_order->id, '_shipping_street_name', $sa->getStreetName());
    263                 update_post_meta($wc_order->id, '_shipping_house_number', $sa->getHouseNr());
    264                 update_post_meta($wc_order->id, '_shipping_house_number_suffix', $sa->getHouseNrAddition());
    265             }
    266            
    267260            //Woocommerce Payment method can only be set if payment method is active and matches string from ChannelEngine
    268261            //$wc_order->set_payment_method($order->getPaymentMethod());
     
    320313            update_post_meta($wc_order->id, '_customer_ip_address', '');
    321314            update_post_meta($wc_order->id, '_shipping_ce_track_and_trace', '');
     315
     316            if($this->is_plugin_active('woocommerce_wuunder/woocommerce-wuunder.php'))
     317            {
     318                update_post_meta($wc_order->id, '_shipping_street_name', $sa->getStreetName());
     319                update_post_meta($wc_order->id, '_shipping_house_number', $sa->getHouseNr());
     320                update_post_meta($wc_order->id, '_shipping_house_number_suffix', $sa->getHouseNrAddition());
     321            }
     322
     323
    322324            $wc_order->order_date = $order->getOrderDate();
    323325            $wc_order->payment_complete();
  • channelengine-woocommerce/trunk/admin/class-channel-engine-product-feed.php

    r1594963 r1601154  
    9191            $product['gtin'] = $this->getGtin($meta);
    9292            $product['price'] = $wcProduct->get_price_including_tax();
    93             $product['purchase_price'] = $wcProduct->get_price_excluding_tax(1, $wcProduct->get_regular_price());
     93            $product['price_ex_vat'] = $wcProduct->get_price_excluding_tax();
    9494            $product['list_price'] = $wcProduct->get_price_including_tax(1, $wcProduct->get_regular_price());
    95             $product['vat'] = $this->calcVat($product['price'], $product['purchase_price']);
     95            $product['vat'] = $this->calcVat($product['price'], $product['price_ex_vat']);
    9696            $product['brand'] = $this->get($meta, $pr.'_brand');
    9797            $product['custom_attributes'] = $this->get($meta, '_product_attributes');
     
    127127                $product['gtin'] = $this->getGtin($meta);
    128128                $product['price'] = $wcProductVar->get_price_including_tax();
    129                 $product['purchase_price'] = $wcProductVar->get_price_excluding_tax(1, $wcProductVar->get_regular_price());
     129                $product['price_ex_vat'] = $wcProductVar->get_price_excluding_tax(1, $wcProductVar->get_price());
    130130                $product['list_price'] = $wcProductVar->get_price_including_tax(1, $wcProductVar->get_regular_price());
    131                 $product['vat'] = $this->calcVat($product['price'], $product['purchase_price']);
     131                $product['vat'] = $this->calcVat($product['price'], $product['price_ex_vat']);
    132132
    133133                $this->createProductNode($xml, $product);
     
    160160        $pXml->addChildCData('Description', $product['description']);
    161161        $pXml->addChild('Price', $product['price']);
    162         $pXml->addChild('PurchasePrice', $product['purchase_price']);
     162        $pXml->addChild('PriceExVat', $product['price_ex_vat']);
    163163        $pXml->addChild('ListPrice', $product['list_price']);
    164164        $pXml->addChild('VAT', $product['vat']);
  • channelengine-woocommerce/trunk/woocommerce-channel-engine.php

    r1595768 r1601154  
    44Plugin URI: http://channelengine.net
    55Description: ChannelEngine plugin for WooCommerce
    6 Version: 1.5.7
     6Version: 1.5.8
    77Author: ChannelEngine
    88Author URI: http://channelengine.net
Note: See TracChangeset for help on using the changeset viewer.