Plugin Directory

Changeset 2413818


Ignore:
Timestamp:
11/06/2020 10:27:32 AM (5 years ago)
Author:
thegeektets
Message:

version 1.0.1.2

Delivery Address Validation

  • update delivery address validation
Location:
sendy-ecommmerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sendy-ecommmerce/trunk/public/js/sendy-api-public.js

    r2400686 r2413818  
    1212    $(() => {
    1313        initMap = function() {
    14             console.log('initializing maps');
     14            console.log('initializing public maps');
    1515            $('#api_to').val($.cookie('name'));
    1616        }
     
    3535                let to_long = place.geometry.location.lng();
    3636                sendRequest(to_name, to_lat, to_long);
    37                 $.cookie('name', to_name);
     37                // $.cookie('name', to_name);
    3838            });
    3939        } else {
  • sendy-ecommmerce/trunk/sendy-api.php

    r2400686 r2413818  
    55 * Plugin URI:        https://github.com/sendyit/woocommerce
    66 * Description:       This is the Sendy WooCommerce Plugin for Sendy Public API.
    7  * Version:           1.0.1.1
     7 * Version:           1.0.1.2
    88 * Author:            Sendy Engineering
    99 * License:           GPL-2.0+
     
    1818}
    1919
    20 define('SENDY_WOOCOMMERCE_SHIPPING_VERSION', '1.0.1.1');
     20define('SENDY_WOOCOMMERCE_SHIPPING_VERSION', '1.0.1.2');
    2121
    2222function activate_sendy_api()
     
    301301    function register_session()
    302302    {
    303         if (!session_id())
     303        if (!session_id()){
    304304            session_start();
     305       }
    305306    }
    306307
     
    520521    }
    521522
     523   
    522524    add_action('wp_ajax_nopriv_displayDelivery', 'displayDelivery');
    523525    add_action('wp_ajax_displayDelivery', 'displayDelivery');
     
    529531            $cost = WC()->session->get( 'sendyOrderCost');
    530532        } else {
    531             $cost = 250; // default
     533            $cost = 0; // default
    532534        }
    533535       
     
    542544
    543545    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    }
    544555
    545556    function completeOrder($order_id)
Note: See TracChangeset for help on using the changeset viewer.