Plugin Directory

Changeset 2685593


Ignore:
Timestamp:
02/27/2022 02:02:57 PM (4 years ago)
Author:
aribhour
Message:

new hooks and log points better address handling

Location:
linet-erp-woocommerce-integration/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-autoloader.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-inventory.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    13911391    //$product->set_stock_quantity(null);
    13921392  }
    1393   $logger->write("updateStock product save: ".$product->save());
     1393  $logger->write("updateStock product save: $qty ".$product->save());
    13941394
    13951395
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-invoice.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    9191        //var_dump($this->to_array());exit;
    9292        $body=$this->to_array($doctype);
    93         if(is_array($body))
    94           return WC_LI_Settings::sendAPI('create/doc', $body);
     93        if(is_array($body)){
     94          $response = WC_LI_Settings::sendAPI('create/doc', $body);
     95
     96
     97          $obj = array(
     98            'doc' => $this->doc,
     99            'order' => $this->order,
     100            'response'=>$response,
     101          );
     102
     103          $obj = apply_filters( 'woocommerce_linet_do_request', $obj );
     104          return $response;
     105        }
     106
    95107        return false;
    96108    }
     
    182194
    183195
    184           $obj = [
     196          $obj = array(
    185197            'detail' => $detail,
    186198            'item' => $item,
    187199            'order' => $order
    188           ];
     200          );
    189201
    190202          $obj = apply_filters( 'woocommerce_linet_set_order_line',   $obj          );
     
    384396        $this->order = $order;
    385397
    386         $obj=[
     398        $obj = array(
    387399          'doc' => $this->doc,
    388400          'order' => $order
    389         ];
    390 
    391         $obj = apply_filters( 'woocommerce_linet_set_order',   $obj         );
     401        );
     402
     403        $obj = apply_filters( 'woocommerce_linet_set_order', $obj );
    392404
    393405
     
    477489
    478490        if (strlen($this->order->get_billing_company()) > 0) {
    479             $invoice_name = $this->order->get_billing_company();
     491            $acc_name = $this->order->get_billing_company();
    480492        } else {
    481             $invoice_name = $this->order->get_billing_first_name() . ' ' . $this->order->get_billing_last_name();
     493            $acc_name = $this->order->get_billing_first_name() . ' ' . $this->order->get_billing_last_name();
    482494        }
    483495
     
    493505
    494506
     507        $acc_name = html_entity_decode($acc_name);
     508        $acc_phone = $this->order->get_billing_phone();
     509        $acc_address = html_entity_decode(
     510          implode(' ', array_filter(array(
     511            $this->order->get_billing_address_1(),
     512            $this->order->get_billing_address_2()
     513          )
     514        )));
     515
     516        $acc_city = html_entity_decode($this->order->get_billing_city());
     517        $acc_email = $this->order->get_billing_email();
     518
     519
    495520
    496521        if ($accId == 0) {
    497522          $body = [
    498             'name' => html_entity_decode($invoice_name),
    499             "phone" => $this->order->get_billing_phone(),
    500             "address" => html_entity_decode($this->order->get_billing_address_1()),
    501             "city" => html_entity_decode($this->order->get_billing_city()),
     523            'name' => $acc_name,
     524            "phone" => $acc_phone,
     525            "address" => $acc_address,
     526            "city" => $acc_city,
    502527            "country_id" => $country_id,
    503528            "currency_id" => $currency_id,
    504             "email" => $this->order->get_billing_email(),
     529            "email" => $acc_email,
    505530          ];
    506531
    507           $obj=[
     532          $obj = array(
    508533            'acc' => $body,
    509534            'order' => $this->order
    510           ];
     535          );
    511536          $obj = apply_filters( 'woocommerce_linet_account_dets',   $obj);
    512537            $body = $obj['acc'];
    513538
    514539
    515           $accId = $this->getAcc($this->order->get_billing_email());
     540          $accId = $this->getAcc($acc_email);
    516541          if ($accId === false) {//create new acc
    517542            $accId = $this->createAcc($body);
     
    549574        //billing_country
    550575        $this->doc["refnum_ext"] = __('Online Order', 'wc-linet')." #" . $this->order->get_id();
    551         $this->doc["phone"] = $this->order->get_billing_phone();
    552         $this->doc["address"] = html_entity_decode($this->order->get_billing_address_1());
    553         $this->doc["city"] = html_entity_decode($this->order->get_billing_city());
    554         $this->doc["email"] = $this->order->get_billing_email();
    555         $this->doc["company"] = html_entity_decode($invoice_name);
     576        $this->doc["phone"] = $acc_phone;
     577        $this->doc["address"] = $acc_address;
     578        $this->doc["city"] = $acc_city;
     579        $this->doc["email"] = $acc_email;
     580        $this->doc["company"] = $acc_name;
    556581        $this->doc["currency_id"] = $currency_id;
    557582        $this->doc["country_id"] = $country_id;
     
    580605        $this->doc["sendmail"] = (get_option('wc_linet_autosend')=='off')?0:1;
    581606
    582         $this->doc=WC_LI_Settings_Map::metaMapOrder($this->doc,$this->order,"orderFields");
     607        $this->doc = WC_LI_Settings_Map::metaMapOrder($this->doc,$this->order,"orderFields");
     608
     609
     610
     611
     612        $obj = array(
     613          'doc' => $this->doc,
     614          'order' => $this->order
     615        );
     616
     617        $obj = apply_filters( 'woocommerce_linet_to_array', $obj );
     618
     619
     620        $this->doc = $obj['doc'];
    583621
    584622        //var_dump($this->doc);
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-line-item-manager.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-logger.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-order-actions.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment-manager.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-map.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-yith-map.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-sns.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/readme.txt

    r2682806 r2685593  
    4747== Changelog ==
    4848
     49= 2022.02.27 - version 2.8.9 =
     50
     51* new log points
     52* new hooks
     53
    4954= 2022.02.22 - version 2.8.8 =
    5055
  • linet-erp-woocommerce-integration/trunk/woo-includes/class-wc-dependencies.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woo-includes/woo-functions.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woocommerce-linet.php

    r2682806 r2685593  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 2.8.8
     8  Version: 2.8.9
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    4444 */
    4545class WC_Linet {
    46   const VERSION = '2.8.8';
     46  const VERSION = '2.8.9';
    4747  /**
    4848   * The constructor
Note: See TracChangeset for help on using the changeset viewer.