Changeset 2570369
- Timestamp:
- 07/22/2021 08:04:40 PM (5 years ago)
- Location:
- moovin-delivery
- Files:
-
- 88 added
- 7 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/LICENSE.txt (added)
-
tags/1.0.2/admin (added)
-
tags/1.0.2/admin/class-moovin-delivery-admin.php (added)
-
tags/1.0.2/admin/css (added)
-
tags/1.0.2/admin/css/app.css (added)
-
tags/1.0.2/admin/css/bootstrap.min.css (added)
-
tags/1.0.2/admin/css/buttons.bootstrap4.min.css (added)
-
tags/1.0.2/admin/css/dataTables.bootstrap4.min.css (added)
-
tags/1.0.2/admin/css/icons.css (added)
-
tags/1.0.2/admin/css/moovin-delivery-admin.css (added)
-
tags/1.0.2/admin/css/moovin-print-qr.css (added)
-
tags/1.0.2/admin/css/sweetalert2.min.css (added)
-
tags/1.0.2/admin/index.php (added)
-
tags/1.0.2/admin/js (added)
-
tags/1.0.2/admin/js/bootstrap.bundle.min.js (added)
-
tags/1.0.2/admin/js/dataTables.bootstrap4.min.js (added)
-
tags/1.0.2/admin/js/global.js (added)
-
tags/1.0.2/admin/js/jquery.blockUI.js (added)
-
tags/1.0.2/admin/js/jquery.dataTables.min.js (added)
-
tags/1.0.2/admin/js/locationpicker.jquery.js (added)
-
tags/1.0.2/admin/js/moovin-delivery-admin.js (added)
-
tags/1.0.2/admin/js/partial (added)
-
tags/1.0.2/admin/js/partial/config.js (added)
-
tags/1.0.2/admin/js/partial/order.js (added)
-
tags/1.0.2/admin/js/partial/tracking.js (added)
-
tags/1.0.2/admin/js/simplebar.min.js (added)
-
tags/1.0.2/admin/js/sweetalert2.min.js (added)
-
tags/1.0.2/admin/js/utility.js (added)
-
tags/1.0.2/admin/partials (added)
-
tags/1.0.2/admin/partials/moovin-delivery-admin-config.php (added)
-
tags/1.0.2/admin/partials/moovin-delivery-admin-dashboard.php (added)
-
tags/1.0.2/admin/partials/moovin-delivery-admin-display.php (added)
-
tags/1.0.2/admin/partials/moovin-delivery-admin-orders.php (added)
-
tags/1.0.2/assets (added)
-
tags/1.0.2/assets/css (added)
-
tags/1.0.2/assets/google_key.pdf (added)
-
tags/1.0.2/assets/here_developer.pdf (added)
-
tags/1.0.2/assets/images (added)
-
tags/1.0.2/assets/images/ic_green_alert.png (added)
-
tags/1.0.2/assets/images/ic_logo_moovin.png (added)
-
tags/1.0.2/assets/images/ic_red_alert.png (added)
-
tags/1.0.2/assets/js (added)
-
tags/1.0.2/assets/screenshot-1.png (added)
-
tags/1.0.2/assets/screenshot-2.png (added)
-
tags/1.0.2/assets/screenshot-3.png (added)
-
tags/1.0.2/assets/screenshot-4.png (added)
-
tags/1.0.2/assets/screenshot-5.png (added)
-
tags/1.0.2/includes (added)
-
tags/1.0.2/includes/class-moovin-delivery-activator.php (added)
-
tags/1.0.2/includes/class-moovin-delivery-deactivator.php (added)
-
tags/1.0.2/includes/class-moovin-delivery-i18n.php (added)
-
tags/1.0.2/includes/class-moovin-delivery-loader.php (added)
-
tags/1.0.2/includes/class-moovin-delivery.php (added)
-
tags/1.0.2/includes/index.php (added)
-
tags/1.0.2/index.php (added)
-
tags/1.0.2/languages (added)
-
tags/1.0.2/languages/moovin-delivery.pot (added)
-
tags/1.0.2/moovin-delivery.php (added)
-
tags/1.0.2/moovin-shipping-express.php (added)
-
tags/1.0.2/moovin-shipping.php (added)
-
tags/1.0.2/public (added)
-
tags/1.0.2/public/class-moovin-delivery-public.php (added)
-
tags/1.0.2/public/css (added)
-
tags/1.0.2/public/css/moovin-delivery-location-map-picker-public.css (added)
-
tags/1.0.2/public/css/moovin-delivery-location-map-picker-public.min.css (added)
-
tags/1.0.2/public/css/moovin-delivery-public.css (added)
-
tags/1.0.2/public/css/sweetalert2.min.css (added)
-
tags/1.0.2/public/img (added)
-
tags/1.0.2/public/img/icons (added)
-
tags/1.0.2/public/img/icons/close.png (added)
-
tags/1.0.2/public/img/icons/location-finder-grey.png (added)
-
tags/1.0.2/public/img/icons/tik.png (added)
-
tags/1.0.2/public/index.php (added)
-
tags/1.0.2/public/js (added)
-
tags/1.0.2/public/js/global.js (added)
-
tags/1.0.2/public/js/jquery.blockUI.js (added)
-
tags/1.0.2/public/js/moovin-delivery-location-googlemap-picker-public.js (added)
-
tags/1.0.2/public/js/moovin-delivery-location-heremap-picker-public.js (added)
-
tags/1.0.2/public/js/moovin-delivery-public.js (added)
-
tags/1.0.2/public/js/sweetalert2.min.js (added)
-
tags/1.0.2/public/js/utility.js (added)
-
tags/1.0.2/public/partials (added)
-
tags/1.0.2/public/partials/moovin-delivery-location-common-fields.php (added)
-
tags/1.0.2/public/partials/moovin-delivery-location-customised-fields.php (added)
-
tags/1.0.2/public/partials/moovin-delivery-location-map-picker-public-display.php (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/uninstall.php (added)
-
trunk/admin/class-moovin-delivery-admin.php (modified) (17 diffs)
-
trunk/admin/js/partial/order.js (modified) (2 diffs)
-
trunk/admin/partials/moovin-delivery-admin-orders.php (modified) (1 diff)
-
trunk/moovin-delivery.php (modified) (3 diffs)
-
trunk/public/class-moovin-delivery-public.php (modified) (12 diffs)
-
trunk/public/partials/moovin-delivery-location-map-picker-public-display.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
moovin-delivery/trunk/admin/class-moovin-delivery-admin.php
r2569445 r2570369 475 475 476 476 if($body->status == "SUCCESS"){ 477 $tc = $this->moovin_get_exchange_values(); 477 478 478 479 $usernameUpdate = $wpdb->update( 479 480 $this->table_activator->moovin_tbl_parameters(), 480 array("value" => sanitize_text_field($_POST["username"]), "edited_at" => date ("Y-m-d H:m:s")),481 array("value" => sanitize_text_field($_POST["username"]), "edited_at" => date_i18n("Y-m-d H:m:s")), 481 482 array("cod_parameter" => "MOOVIN_USERNAME_SANDBOX") 482 483 ); … … 484 485 $passwordUpdate = $wpdb->update( 485 486 $this->table_activator->moovin_tbl_parameters(), 486 array("value" => sanitize_text_field($_POST["password"]), "edited_at" => date ("Y-m-d H:m:s")),487 array("value" => sanitize_text_field($_POST["password"]), "edited_at" => date_i18n("Y-m-d H:m:s")), 487 488 array("cod_parameter" => "MOOVIN_PASSWORD_SANDBOX") 488 489 ); 489 490 490 491 $tokenUpdate = $wpdb->update( 491 492 $this->table_activator->moovin_tbl_parameters(), 492 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date("Y-m-d H:m:s")),493 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc , "edited_at" => date_i18n("Y-m-d H:m:s")), 493 494 array("cod_parameter" => "MOOVIN_TOKEN_SANDBOX") 494 495 ); … … 531 532 532 533 if($body->status == "SUCCESS"){ 534 $tc = $this->moovin_get_exchange_values(); 533 535 534 536 $usernameUpdate = $wpdb->update( 535 537 $this->table_activator->moovin_tbl_parameters(), 536 array("value" => sanitize_text_field($_POST["username"]), "edited_at" => date("Y-m-d H:m:s")),538 array("value" => sanitize_text_field($_POST["username"]), "edited_at" => date_i18n("Y-m-d H:m:s")), 537 539 array("cod_parameter" => "MOOVIN_USERNAME_PROD") 538 540 ); … … 540 542 $passwordUpdate = $wpdb->update( 541 543 $this->table_activator->moovin_tbl_parameters(), 542 array("value" => sanitize_text_field($_POST["password"]), "edited_at" => date("Y-m-d H:m:s")),544 array("value" => sanitize_text_field($_POST["password"]), "edited_at" => date_i18n("Y-m-d H:m:s")), 543 545 array("cod_parameter" => "MOOVIN_PASSWORD_PROD") 544 546 ); … … 546 548 $tokenUpdate = $wpdb->update( 547 549 $this->table_activator->moovin_tbl_parameters(), 548 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date("Y-m-d H:m:s")),550 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc , "edited_at" => date_i18n("Y-m-d H:m:s")), 549 551 array("cod_parameter" => "MOOVIN_TOKEN_PROD") 550 552 ); 553 551 554 552 555 if ($usernameUpdate > 0 && $passwordUpdate > 0 && $tokenUpdate >0){ … … 750 753 } 751 754 752 753 755 754 756 $express_schedule = $this->moovin_exist_db_parameter("MOOVIN_EXPRESS_SCHEDULE"); 755 757 … … 776 778 //Notification Email Orders 777 779 if (sanitize_text_field($_POST["emailnotification"]) == "1"){ 778 779 780 if ( ! wp_next_scheduled( 'isa_add_every_three_minutes' ) ) { 780 781 wp_schedule_event( time(), 'every_three_minutes', 'isa_add_every_three_minutes' ); 781 782 } 782 783 784 if ($wpdb->get_var("show tables like '" . $this->table_activator->moovin_tbl_notification_order() . "'") != $this->table_activator->moovin_tbl_notification_order()) {785 786 $sql_notification_order="CREATE TABLE `" . $this->table_activator->moovin_tbl_notification_order() . "` (787 `id_notification` INT(11) NOT NULL AUTO_INCREMENT ,788 `order_id` BIGINT NOT NULL ,789 `email` VARCHAR(250) ,790 `status` tinyint(1) NOT NULL DEFAULT '0' ,791 `created_at` timestamp ,792 `sent_at` timestamp ,793 PRIMARY KEY (`id_notification`))794 ENGINE = InnoDB;";795 796 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');797 798 dbDelta($sql_notification_order);799 }800 801 783 } 802 784 … … 1004 986 1005 987 $orders = $wpdb->get_results( 1006 "SELECT * from " . $this->table_activator->moovin_tbl_orders() ."ORDER BY date_created DESC" , ARRAY_A);988 "SELECT " . $this->table_activator->moovin_tbl_orders() .".* , ".$wpdb->prefix."postmeta.meta_value as currency from " . $this->table_activator->moovin_tbl_orders() ." LEFT JOIN ".$wpdb->prefix."postmeta ON " . $this->table_activator->moovin_tbl_orders() .".order_id = ".$wpdb->prefix."postmeta.post_id AND meta_key = '_order_currency' ORDER BY date_created DESC" , ARRAY_A); 1007 989 1008 1009 990 echo wp_json_encode(array("data"=>$orders)); 1010 991 … … 1457 1438 } 1458 1439 1459 1460 1440 function moovin_exist_db_parameter($cod_parameter){ 1461 1462 1441 global $wpdb; 1463 1464 1442 $parameter = $wpdb->get_results( 1465 1443 $wpdb->prepare( … … 1475 1453 } 1476 1454 1455 function moovin_get_exchange_values(){ 1456 $tc_url = "https://api.hacienda.go.cr/indicadores/tc"; 1457 $responseTC = wp_remote_post($tc_url, array( 1458 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), 1459 'method' => 'GET', 1460 'data_format' => 'body' 1461 )); 1462 1463 return $responseTC["body"]; 1464 } 1465 1477 1466 function moovin_get_refresh_token(){ 1478 1467 global $wpdb; … … 1492 1481 $password_sandbox = ""; 1493 1482 $current_env = ""; 1483 $tc = ""; 1494 1484 1495 1485 foreach($parameters as $row){ … … 1499 1489 $token_sandbox = $row["value"]; 1500 1490 $token_sandbox_date = $row["value1"]; 1491 $tc = $row["value2"]; 1501 1492 } 1502 1493 break; … … 1505 1496 $token_prod = $row["value"]; 1506 1497 $token_prod_date = $row["value1"]; 1498 $tc = $row["value2"]; 1507 1499 } 1508 1500 break; … … 1545 1537 $tokenDate = strtotime($token_sandbox_date); 1546 1538 1547 1548 1539 if ($tokenDate > $currentDate ){ 1549 return array("token"=> $token_sandbox , "url"=> $url_sandbox , "error" => false);1540 return array("token"=> $token_sandbox , "url"=> $url_sandbox ,"tc"=> json_decode( $tc , true), "error" => false); 1550 1541 }else{ 1551 1542 $post_url = $url_sandbox."/moovinApiWebServices-1/rest/api/moovinEnterprise/partners/login"; 1552 1553 1543 $response = wp_remote_post($post_url, array( 1554 1544 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), … … 1561 1551 1562 1552 if($body->status == "SUCCESS"){ 1563 1553 $tc = $this->moovin_get_exchange_values(); 1564 1554 $tokenUpdate = $wpdb->update( 1565 1555 $this->table_activator->moovin_tbl_parameters(), 1566 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date("Y-m-d H:m:s")),1556 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc , "edited_at" => date_i18n("Y-m-d H:m:s")), 1567 1557 array("cod_parameter" => "MOOVIN_TOKEN_SANDBOX") 1568 1558 ); 1569 1559 1570 return array("token"=> $body->token , "url"=> $url_sandbox , " error" => false);1560 return array("token"=> $body->token , "url"=> $url_sandbox , "tc"=> json_decode( $tc , true) , "error" => false); 1571 1561 }else{ 1572 1562 return array("token"=> $body->token , "url"=> $url_sandbox , "error" => true); … … 1581 1571 1582 1572 if ($tokenDate > $currentDate ){ 1583 return array("token"=>$token_prod, "url"=> $url_prod, " error" => false);1573 return array("token"=>$token_prod, "url"=> $url_prod, "tc"=> json_decode( $tc , true), "error" => false); 1584 1574 }else{ 1585 1575 $post_url = $url_prod."/moovinApiWebServices-1/rest/api/moovinEnterprise/partners/login"; 1586 1587 1576 $response = wp_remote_post($post_url, array( 1588 1577 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), … … 1595 1584 1596 1585 if($body->status == "SUCCESS"){ 1597 1586 $tc = $this->moovin_get_exchange_values(); 1598 1587 $tokenUpdate = $wpdb->update( 1599 1588 $this->table_activator->moovin_tbl_parameters(), 1600 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date("Y-m-d H:m:s")),1589 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc, "edited_at" => date_i18n("Y-m-d H:m:s")), 1601 1590 array("cod_parameter" => "MOOVIN_TOKEN_PROD") 1602 1591 ); 1603 1592 1604 return array("token"=> $body->token , "url"=> $url_prod , " error" => false);1593 return array("token"=> $body->token , "url"=> $url_prod , "tc"=> json_decode($tc , true) , "error" => false); 1605 1594 }else{ 1606 1595 return array("token"=> "", "url"=> $url_prod, "error" => true); -
moovin-delivery/trunk/admin/js/partial/order.js
r2569445 r2570369 110 110 visible: true, 111 111 render: function (data, type, row, meta) { 112 return "₡" + formatter.format(data);112 return row.currency + " " + formatter.format(data); 113 113 }, 114 114 }, … … 117 117 visible: true, 118 118 render: function (data, type, row, meta) { 119 return "₡" + formatter.format(data);119 return row.currency + " " + formatter.format(data); 120 120 }, 121 121 }, -
moovin-delivery/trunk/admin/partials/moovin-delivery-admin-orders.php
r2569445 r2570369 16 16 17 17 <div class="float-lg-right pb-2"> 18 19 18 </div> 19 20 <input type="hidden" value="<?php echo get_woocommerce_currency() ?>" id="currency" name="currency"> 21 <input type="hidden" value="<?php echo get_woocommerce_currency_symbol() ?>" id="currency_symbol" name="currency_symbol"> 22 20 23 <div class="table-responsive"> 21 24 <table id="datatable-orders" -
moovin-delivery/trunk/moovin-delivery.php
r2569445 r2570369 10 10 * 11 11 * @link https://www.moovin.me/ 12 * @since 1.0. 112 * @since 1.0.2 13 13 * @package Moovin_Delivery 14 14 * … … 17 17 * Plugin URI: https://www.moovin.me/ 18 18 * Description: Vos vendés nosotros entregamos tus paquetes, activa nuestro plugin y Moovin se encargara de entregar tus productos. 19 * Version: 1.0. 119 * Version: 1.0.2 20 20 * Author: Moovin Developer 21 21 * Author URI: https://www.moovin.me/contacto/ … … 42 42 } 43 43 44 /** 45 * Currently plugin version. 46 * Start at version 1.0.1 and use SemVer - https://semver.org 47 * Rename this for your plugin and update it as you release new versions. 48 */ 49 define( 'MOOVIN_DELIVERY_VERSION', '1.0.1' ); 44 define( 'MOOVIN_DELIVERY_VERSION', '1.0.2' ); 50 45 define( 'MOOVIN_PLUGIN_PATH', plugin_dir_path(__FILE__)); 51 46 define( 'MOOVIN_PLUGIN_URL', plugin_dir_url(__FILE__)); 52 53 47 54 48 /** -
moovin-delivery/trunk/public/class-moovin-delivery-public.php
r2569445 r2570369 197 197 $password_sandbox = ""; 198 198 $current_env = ""; 199 $tc = ""; 199 200 200 201 foreach($parameters as $row){ … … 204 205 $token_sandbox = $row["value"]; 205 206 $token_sandbox_date = $row["value1"]; 207 $tc = $row["value2"]; 206 208 } 207 209 break; … … 210 212 $token_prod = $row["value"]; 211 213 $token_prod_date = $row["value1"]; 214 $tc = $row["value2"]; 212 215 } 213 216 break; … … 251 254 252 255 if ($tokenDate > $currentDate ){ 253 return array("token"=> $token_sandbox , "url"=> $url_sandbox , "error" => false);256 return array("token"=> $token_sandbox , "url"=> $url_sandbox ,"tc"=> json_decode( $tc , true), "error" => false); 254 257 }else{ 255 258 $post_url = $url_sandbox."/moovinApiWebServices-1/rest/api/moovinEnterprise/partners/login"; 256 257 259 $response = wp_remote_post($post_url, array( 258 260 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), … … 265 267 266 268 if($body->status == "SUCCESS"){ 267 269 $tc = $this->moovin_get_exchange_values(); 268 270 $tokenUpdate = $wpdb->update( 269 271 $this->table_activator->moovin_tbl_parameters(), 270 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date_i18n("Y-m-d H:m:s")),272 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc , "edited_at" => date_i18n("Y-m-d H:m:s")), 271 273 array("cod_parameter" => "MOOVIN_TOKEN_SANDBOX") 272 274 ); 273 275 274 return array("token"=> $body->token , "url"=> $url_sandbox , " error" => false);276 return array("token"=> $body->token , "url"=> $url_sandbox , "tc"=> json_decode( $tc , true) , "error" => false); 275 277 }else{ 276 278 return array("token"=> $body->token , "url"=> $url_sandbox , "error" => true); … … 285 287 286 288 if ($tokenDate > $currentDate ){ 287 return array("token"=>$token_prod, "url"=> $url_prod, " error" => false);289 return array("token"=>$token_prod, "url"=> $url_prod, "tc"=> json_decode( $tc , true), "error" => false); 288 290 }else{ 289 291 $post_url = $url_prod."/moovinApiWebServices-1/rest/api/moovinEnterprise/partners/login"; 290 291 292 $response = wp_remote_post($post_url, array( 292 293 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), … … 299 300 300 301 if($body->status == "SUCCESS"){ 301 302 $tc = $this->moovin_get_exchange_values(); 302 303 $tokenUpdate = $wpdb->update( 303 304 $this->table_activator->moovin_tbl_parameters(), 304 array("value" => $body->token, "value1" => $body->expirationDate , " edited_at" => date_i18n("Y-m-d H:m:s")),305 array("value" => $body->token, "value1" => $body->expirationDate , "value2"=> $tc, "edited_at" => date_i18n("Y-m-d H:m:s")), 305 306 array("cod_parameter" => "MOOVIN_TOKEN_PROD") 306 307 ); 307 308 308 return array("token"=> $body->token , "url"=> $url_prod , " error" => false);309 return array("token"=> $body->token , "url"=> $url_prod , "tc"=> json_decode($tc , true) , "error" => false); 309 310 }else{ 310 311 return array("token"=> "", "url"=> $url_prod, "error" => true); … … 319 320 320 321 function moovin_zones_coverage_get(){ 321 322 322 $response = $this->moovin_get_refresh_token(); 323 323 … … 405 405 "emailContactCollect" => $contactCollect["value2"] ); 406 406 } 407 } 408 409 function moovin_get_exchange_values(){ 410 $tc_url = "https://api.hacienda.go.cr/indicadores/tc"; 411 $responseTC = wp_remote_post($tc_url, array( 412 'headers' => array('Content-Type' => 'application/json; charset=utf-8'), 413 'method' => 'GET', 414 'data_format' => 'body' 415 )); 416 417 return $responseTC["body"]; 407 418 } 408 419 … … 464 475 465 476 $body = array( 466 "vehicle"=>"car",467 477 "ensure"=>true, 468 478 "pointDelivery" => $pointDelivery, … … 496 506 $amountRoute = 0; 497 507 $amountExpress = 0; 498 foreach($estimation["optionService"] as $row){ 499 500 if ($row["type"] == "Ondemand"){ 501 if(isset($row["currency"])){ 502 if($row["currency"]["currency"] == "dollars"){ 503 $amountExpress = $row["amount"] * 620; 504 }else{ 505 $amountExpress = $row["amount"] ; 508 509 switch(get_woocommerce_currency()){ 510 case "USD": 511 //Woocommerce in USD Currency 512 foreach($estimation["optionService"] as $row){ 513 /* 514 * Check Service Type Moovin 515 */ 516 switch($row["type"]){ 517 case "Ondemand": 518 /* 519 * Service Express 520 */ 521 if(isset($row["currency"])){ 522 if($row["currency"]["currency"] == "dollars"){ 523 $amountExpress = $row["amount"] ; 524 }else{ 525 //Calculate COLON TO DOLAR 526 if(isset($response["tc"]["dolar"]["compra"]["valor"])){ 527 $amountExpress = $row["amount"] / $response["tc"]["dolar"]["compra"]["valor"] ; 528 }else{ 529 $amountExpress = $row["amount"] / 600 ; 530 } 531 } 532 }else{ 533 $amountExpress = $row["amount"] ; 534 } 535 break; 536 case "route": 537 /* 538 * Service Route 539 */ 540 if(isset($row["currency"])){ 541 if($row["currency"]["currency"] == "dollars"){ 542 $amountRoute = $row["amount"] ; 543 }else{ 544 //Calculate COLON TO DOLAR 545 if(isset($response["tc"]["dolar"]["compra"]["valor"])){ 546 $amountRoute = $row["amount"] / $response["tc"]["dolar"]["compra"]["valor"] ; 547 }else{ 548 $amountRoute = $row["amount"] / 600 ; 549 } 550 } 551 }else{ 552 $amountRoute = $row["amount"] ; 553 } 554 break; 555 default: 556 /* 557 * Nothing to do 558 */ 559 break; 506 560 } 507 }else{508 $amountExpress = $row["amount"] ;509 561 } 510 }else if ($row["type"] == "route"){ 511 if(isset($row["currency"])){ 512 if($row["currency"]["currency"] == "dollars"){ 513 $amountRoute = $row["amount"] * 620; 514 }else{ 515 $amountRoute = $row["amount"] ; 562 563 564 565 566 break; 567 case "CRC": 568 //Woocommerce in CRC colon Currency 569 570 foreach($estimation["optionService"] as $row){ 571 /* 572 * Check Service Type Moovin 573 */ 574 switch($row["type"]){ 575 case "Ondemand": 576 /* 577 * Service Express 578 */ 579 if(isset($row["currency"])){ 580 if($row["currency"]["currency"] == "dollars"){ 581 //Calculate DOLAR TO COLON 582 if(isset($response["tc"]["dolar"]["venta"]["valor"])){ 583 $amountExpress = $row["amount"] * $response["tc"]["dolar"]["venta"]["valor"] ; 584 }else{ 585 $amountExpress = $row["amount"] * 620 ; 586 } 587 }else{ 588 $amountExpress = $row["amount"] ; 589 } 590 }else{ 591 $amountExpress = $row["amount"] ; 592 } 593 break; 594 case "route": 595 /* 596 * Service Route 597 */ 598 if(isset($row["currency"])){ 599 if($row["currency"]["currency"] == "dollars"){ 600 //Calculate COLON TO DOLAR 601 if(isset($response["tc"]["dolar"]["venta"]["valor"])){ 602 $amountRoute = $row["amount"] * $response["tc"]["dolar"]["venta"]["valor"] ; 603 }else{ 604 $amountRoute = $row["amount"] * 620 ; 605 } 606 }else{ 607 $amountRoute = $row["amount"] ; 608 } 609 }else{ 610 $amountRoute = $row["amount"] ; 611 } 612 break; 613 default: 614 /* 615 * Nothing to do 616 */ 617 break; 516 618 } 517 }else{518 $amountRoute = $row["amount"] ;519 619 } 520 } 521 } 522 620 break; 621 default: 622 // TODO CASE EUR $response["tc"]["euro"] 623 wc_add_wp_error_notices(new WP_Error(1,'Error la moneda de la tienda no es compatible con el plugin moovin['.get_woocommerce_currency().']')); 624 break; 625 } 626 627 628 // assign amount to shipping 523 629 foreach($rates as $rate_key => $rate_values ) { 524 630 if( $rates[$rate_key]->method_id == "moovin_shipping_express" ){ … … 532 638 } 533 639 } 534 535 } 536 640 } 537 641 } 538 642 -
moovin-delivery/trunk/public/partials/moovin-delivery-location-map-picker-public-display.php
r2569445 r2570369 64 64 65 65 <?php 66 if ( $default_address_id === $address->id) {66 if ( isset($address->id) && $default_address_id === $address->id) { 67 67 ?> 68 68 <input type="radio" class="sg-del-add-select" name="<?php echo esc_attr('selected_' . $section . '_deliver_address'); ?>" data-type="<?php echo esc_attr($section); ?>" value="<?php echo esc_attr($address->id); ?>" id="<?php echo esc_attr('sg_delivery_address_' . $section . '_' . $address->id); ?>" checked="true"> … … 84 84 </div> 85 85 <div class="item"> 86 <h4 class="title"><?php esc_html_e(( $address->address_type !== '') ? $address->address_type : $default_address_type_text, 'woocommerce-delivery-location-map-picker'); ?></h4>87 <p class="text-capitalize address"><?php echo esc_html($address->formatted_address); ?></p>86 <h4 class="title"><?php esc_html_e(( isset($address->address_type) && $address->address_type !== '') ? $address->address_type : $default_address_type_text, 'woocommerce-delivery-location-map-picker'); ?></h4> 87 <p class="text-capitalize address"><?php echo isset($address->address_type) ? esc_html($address->formatted_address) : ""; ?></p> 88 88 </div> 89 89 <p class="action-container"> -
moovin-delivery/trunk/readme.txt
r2569445 r2570369 6 6 Tested up to: 5.8 7 7 Requires PHP: 5.6 8 Stable tag: 1.0. 18 Stable tag: 1.0.2 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 32 32 - Envio de notificaciones 33 33 - Configuración de horario para servicios express 34 - Multimoneda dolares americano USD - Colon Costarricense CRC 35 - Consulta de tipo de cambio a API BN Costa Rica 34 36 35 37 Optimiza tus procesos de envío y reduzca el tiempo de preparación de envíos al integrar en su negocio el servicio logístico de Moovin. … … 55 57 = ¿Que datos necesito para usar el plugin? = 56 58 57 Los datos de acceso los puedes adquirir fácilmente en nuestro [sitio web](https://www.moovin.me/contacto/) o contactamos por medio del correo electrónico a [ sitio web](mailto:[email protected]).59 Los datos de acceso los puedes adquirir fácilmente en nuestro [sitio web](https://www.moovin.me/contacto/) o contactamos por medio del correo electrónico a [[email protected]](mailto:[email protected]). 58 60 59 61 = ¿Como configuro mi plugin? = … … 79 81 * Version inicial del plugin. 80 82 83 = 1.0.1 = 84 * Notificaciones hacia los clientes con link de seguimiento(Tracking). 85 * Configuración de horario para servicios express. 86 * Actualización documento de ayuda para generar keys de Google Maps. 87 * Mejoras de rendimiento. 88 * Arreglos menores. 89 90 = 1.0.2 = 91 * Multi moneda USD CRC. 92 * Consulta de tipo de cambio en tiempo real contra Api BN . 93 * Correción calculo express. 94 * Mejoras de rendimiento. 95 81 96 == Upgrade Notice == 82 97 … … 87 102 * Mejoras de rendimiento. 88 103 * Arreglos menores. 104 105 = 1.0.2 = 106 * Multi moneda USD CRC. 107 * Consulta de tipo de cambio en tiempo real contra Api BN . 108 * Correción calculo express. 109 * Mejoras de rendimiento.
Note: See TracChangeset
for help on using the changeset viewer.