Changeset 2862914
- Timestamp:
- 02/09/2023 06:59:02 PM (3 years ago)
- Location:
- viaads
- Files:
-
- 16 added
- 4 edited
-
tags/1.1.1 (added)
-
tags/1.1.1/apikey.php (added)
-
tags/1.1.1/externalJS.php (added)
-
tags/1.1.1/handleEmailGuid.php (added)
-
tags/1.1.1/hooks (added)
-
tags/1.1.1/hooks/addCart.php (added)
-
tags/1.1.1/hooks/orderHooks.php (added)
-
tags/1.1.1/hooks/pageLook.php (added)
-
tags/1.1.1/hooks/removeCart.php (added)
-
tags/1.1.1/http.php (added)
-
tags/1.1.1/js (added)
-
tags/1.1.1/js/viaads_handleEmailGuid.js (added)
-
tags/1.1.1/readme.txt (added)
-
tags/1.1.1/sync.php (added)
-
tags/1.1.1/userAgent.php (added)
-
tags/1.1.1/viaads.php (added)
-
trunk/hooks/orderHooks.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/sync.php (modified) (3 diffs)
-
trunk/viaads.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
viaads/trunk/hooks/orderHooks.php
r2858930 r2862914 5 5 use DateTime; 6 6 use Exception; 7 use WC_Tax; 7 8 8 9 defined( 'ABSPATH' ) || exit; … … 33 34 // Currency 34 35 $order_object->Currency = $order->get_currency(); 36 37 // Vat Percentage 38 $vat_percentage = floatval('0.25'); 39 foreach($order->get_items('tax') as $item_id => $item ) { 40 $tax_rate_id = $item->get_rate_id(); // Tax rate ID 41 $tax_percent = WC_Tax::get_rate_percent( $tax_rate_id ); // Tax percentage 42 $vat_percentage = floatval("0." . str_replace('%', '', $tax_percent)); // Tax rate 43 } 44 45 $order_object->vat_percentage = $vat_percentage; 46 35 47 // Last Modified 36 48 $lastModifiedGmt = new DateTime($order->get_date_modified()); -
viaads/trunk/readme.txt
r2859216 r2862914 4 4 Requires at least: 5.4 5 5 Tested up to: 6.1 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 Requires PHP: 7.0 8 8 License: GPLv3 -
viaads/trunk/sync.php
r2858930 r2862914 8 8 use Exception; 9 9 use WC_Product_Factory; 10 use WC_Tax; 10 11 11 12 defined('ABSPATH') || exit; … … 36 37 print_r(ViaAds_PostToUrl("https://integration.viaads.dk/woocommerce/WebShopData", $webshop, true)); 37 38 } else { 38 ViaAds_PostToUrl("https://integration.viaads.dk/woocommerce/WebShopData", $webshop, true); 39 //Split array in chucks for max data size 40 $splitted = array_chunk($webshop->Products, 2500); 41 foreach ($splitted as $interval) { 42 $webshop->Products = $interval; 43 ViaAds_PostToUrl("https://integration.viaads.dk/woocommerce/WebShopData", $webshop, true); 44 $webshop->Categories = []; 45 } 39 46 } 40 47 } else if ($_GET['event'] == "orders") { … … 339 346 // Currency 340 347 $order_object->Currency = $order->get_currency(); 348 // Vat Percentage 349 $vat_percentage = floatval('0.25'); 350 foreach($order->get_items('tax') as $item_id => $item ) { 351 $tax_rate_id = $item->get_rate_id(); // Tax rate ID 352 $tax_percent = WC_Tax::get_rate_percent( $tax_rate_id ); // Tax percentage 353 $vat_percentage = floatval("0." . str_replace('%', '', $tax_percent)); // Tax rate 354 } 355 356 $order_object->vat_percentage = $vat_percentage; 357 341 358 342 359 // Last Modified -
viaads/trunk/viaads.php
r2859216 r2862914 3 3 * Plugin Name: ViaAds 4 4 * Description: Plugin der muliggør forbindelsen til ViaAds / Plug-in enabling the connection to ViaAds. 5 * Version: 1.1. 05 * Version: 1.1.1 6 6 * Author: ViaAds 7 7 * Author URI: https://www.viaads.dk/
Note: See TracChangeset
for help on using the changeset viewer.