Changeset 2413818
- Timestamp:
- 11/06/2020 10:27:32 AM (5 years ago)
- Location:
- sendy-ecommmerce/trunk
- Files:
-
- 2 edited
-
public/js/sendy-api-public.js (modified) (2 diffs)
-
sendy-api.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sendy-ecommmerce/trunk/public/js/sendy-api-public.js
r2400686 r2413818 12 12 $(() => { 13 13 initMap = function() { 14 console.log('initializing maps');14 console.log('initializing public maps'); 15 15 $('#api_to').val($.cookie('name')); 16 16 } … … 35 35 let to_long = place.geometry.location.lng(); 36 36 sendRequest(to_name, to_lat, to_long); 37 $.cookie('name', to_name);37 // $.cookie('name', to_name); 38 38 }); 39 39 } else { -
sendy-ecommmerce/trunk/sendy-api.php
r2400686 r2413818 5 5 * Plugin URI: https://github.com/sendyit/woocommerce 6 6 * Description: This is the Sendy WooCommerce Plugin for Sendy Public API. 7 * Version: 1.0.1. 17 * Version: 1.0.1.2 8 8 * Author: Sendy Engineering 9 9 * License: GPL-2.0+ … … 18 18 } 19 19 20 define('SENDY_WOOCOMMERCE_SHIPPING_VERSION', '1.0.1. 1');20 define('SENDY_WOOCOMMERCE_SHIPPING_VERSION', '1.0.1.2'); 21 21 22 22 function activate_sendy_api() … … 301 301 function register_session() 302 302 { 303 if (!session_id()) 303 if (!session_id()){ 304 304 session_start(); 305 } 305 306 } 306 307 … … 520 521 } 521 522 523 522 524 add_action('wp_ajax_nopriv_displayDelivery', 'displayDelivery'); 523 525 add_action('wp_ajax_displayDelivery', 'displayDelivery'); … … 529 531 $cost = WC()->session->get( 'sendyOrderCost'); 530 532 } else { 531 $cost = 250; // default533 $cost = 0; // default 532 534 } 533 535 … … 542 544 543 545 add_action('woocommerce_thankyou', 'completeOrder', 10, 1); 546 547 add_action('woocommerce_checkout_process', 'validateSendyQoute'); 548 549 function validateSendyQoute() { 550 $cost = WC()->session->get('sendyOrderCost'); 551 if(!isset($cost) ){ 552 wc_add_notice(__('Sendy delivery cost has not been calculated , please enter a delivery address'), 'error'); 553 } 554 } 544 555 545 556 function completeOrder($order_id)
Note: See TracChangeset
for help on using the changeset viewer.