Plugin Directory

Changeset 2630781


Ignore:
Timestamp:
11/16/2021 03:20:20 PM (4 years ago)
Author:
byteplant
Message:

fix: street address

Location:
woo-address-validator
Files:
3 edited
8 copied

Legend:

Unmodified
Added
Removed
  • woo-address-validator/tags/2.7/readme.txt

    r2585480 r2630781  
    33Tags: woocommerce, validation, address, address validation, billing, shipping, delivery, billing address, shipping address, checkout
    44Requires at least: 3.0.1
    5 Tested up to: 5.8
    6 Stable tag: 2.6
     5Tested up to: 5.8.2
     6Stable tag: 2.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • woo-address-validator/tags/2.7/src/API/Validator.php

    r2426438 r2630781  
    7575        $this->status = $json->status;
    7676
    77         $this->sanitized = new WCAV_Address(
    78             $json->street . ' ' . $json->streetnumber,
     77        // VALID, SUSPECT, INVALID
     78        if( isset( $json->addressline1 ) ) {
     79            $street = $json->addressline1;
     80        } else if( isset( $json->formattedaddress ) ) {
     81            $addresslines = explode(",", $json->formattedaddress);
     82            $street = trim($addresslines[0]);
     83        } else $street = $address->get_street_address();
     84        $this->sanitized = new WCAV_Address(         
     85            $street,
    7986            $address->get_additional_address_info(),
    80             $json->postalcode,
    81             $json->city,
     87            ( ! empty( $json->postalcode ) ) ? $json->postalcode : $address->get_postal_code(),
     88            ( ! empty( $json->city ) ) ? $json->city : $address->get_city(),
    8289            ( ! empty( $json->state ) ) ? $json->state : '',
    83             $json->country
     90            ( ! empty( $json->country ) ) ? $json->country : $address->get_country_code()
    8491        );
    85 
     92       
    8693        // Set admin notice, if the key is invalid.
    8794        if ( 'API_KEY_INVALID_OR_DEPLETED' === $json->status ) {
  • woo-address-validator/tags/2.7/woocommerce-address-validator.php

    r2585480 r2630781  
    44 * Plugin URI: https://www.address-validator.net/
    55 * Description: Validate billing and shipping addresses in WooCommerce.
    6  * Version: 2.6
     6 * Version: 2.7
    77 * Author: Byteplant
    88 * Author URI: https://www.address-validator.net/
  • woo-address-validator/trunk/readme.txt

    r2585480 r2630781  
    33Tags: woocommerce, validation, address, address validation, billing, shipping, delivery, billing address, shipping address, checkout
    44Requires at least: 3.0.1
    5 Tested up to: 5.8
    6 Stable tag: 2.6
     5Tested up to: 5.8.2
     6Stable tag: 2.7
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • woo-address-validator/trunk/src/API/Validator.php

    r2426438 r2630781  
    7575        $this->status = $json->status;
    7676
    77         $this->sanitized = new WCAV_Address(
    78             $json->street . ' ' . $json->streetnumber,
     77        // VALID, SUSPECT, INVALID
     78        if( isset( $json->addressline1 ) ) {
     79            $street = $json->addressline1;
     80        } else if( isset( $json->formattedaddress ) ) {
     81            $addresslines = explode(",", $json->formattedaddress);
     82            $street = trim($addresslines[0]);
     83        } else $street = $address->get_street_address();
     84        $this->sanitized = new WCAV_Address(         
     85            $street,
    7986            $address->get_additional_address_info(),
    80             $json->postalcode,
    81             $json->city,
     87            ( ! empty( $json->postalcode ) ) ? $json->postalcode : $address->get_postal_code(),
     88            ( ! empty( $json->city ) ) ? $json->city : $address->get_city(),
    8289            ( ! empty( $json->state ) ) ? $json->state : '',
    83             $json->country
     90            ( ! empty( $json->country ) ) ? $json->country : $address->get_country_code()
    8491        );
    85 
     92       
    8693        // Set admin notice, if the key is invalid.
    8794        if ( 'API_KEY_INVALID_OR_DEPLETED' === $json->status ) {
  • woo-address-validator/trunk/woocommerce-address-validator.php

    r2585480 r2630781  
    44 * Plugin URI: https://www.address-validator.net/
    55 * Description: Validate billing and shipping addresses in WooCommerce.
    6  * Version: 2.6
     6 * Version: 2.7
    77 * Author: Byteplant
    88 * Author URI: https://www.address-validator.net/
Note: See TracChangeset for help on using the changeset viewer.