Plugin Directory

Changeset 3235330


Ignore:
Timestamp:
02/05/2025 10:58:08 AM (14 months ago)
Author:
hfdepost
Message:

Performance Improvement

Location:
hfd-epost-integration/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • hfd-epost-integration/trunk/class/App.php

    r3230450 r3235330  
    6565        //flush reqrite rules
    6666        add_filter( 'admin_init', array( $this, 'flushRewriteUrls' ) );
    67        
    68         //render wc_get_orders query
    69         add_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( $this, 'hfd_handle_order_custom_query_vars' ), 10, 2 );
    70        
     67               
    7168        //add wordpress ron for auto sync
    7269        add_filter( 'cron_schedules', array( $this, 'hfdAutoSyncOrderCron' ) );
     
    110107        }
    111108    }
    112    
    113     public function hfd_handle_order_custom_query_vars( $query, $query_vars ){
    114         if( isset( $query_vars['hfd_cron'] ) && ! empty( $query_vars['hfd_cron'] ) ){
    115             $query['meta_query'][] = array(
    116                 'key'     => 'hfd_ship_number',
    117                 'compare' => 'NOT EXISTS',
    118             );
    119             $query['meta_query'][] = array(
    120                 'key'     => 'hfd_sync_flag',
    121                 'compare' => 'NOT EXISTS',
    122             );
    123         }
    124        
    125         return $query;
    126     }
    127    
     109       
    128110    public function is_block_checkout(){
    129111        $checkout_page_id = get_option( 'woocommerce_checkout_page_id' );
     
    210192            'status' => array( $hfd_auto_sync_status ),
    211193            'return' => 'ids',
    212             'hfd_cron' => 'yes',
     194            'meta_key'  => 'hfd_sync_flag',
     195            'meta_compare' => 'NOT EXISTS',
    213196            'date_query' => array(
    214                 'after' => wp_date( 'Y-m-d H:i:s', strtotime( '-'.( $hfd_auto_sync_time + 10 ).' minutes' ) ),
    215                 'before' => wp_date( 'Y-m-d H:i:s', strtotime( '-'.$hfd_auto_sync_time.' minutes' ) )
     197                'after' => date( 'Y-m-d H:i:s', strtotime( '-'.( $hfd_auto_sync_time + 10 ).' minutes' ) ),
     198                'before' => date( 'Y-m-d H:i:s', strtotime( '-'.$hfd_auto_sync_time.' minutes' ) )
    216199            ),
    217200        );
  • hfd-epost-integration/trunk/class/Helper/Hfd/Api.php

    r3206333 r3235330  
    2929        $orderNumber = $order->get_id();
    3030
    31         list($param3, $param7) = $this->_paramBaseOnShippingMethod($order);
     31        list($param3, $param7, $cargohazor) = $this->_paramBaseOnShippingMethod($order);
    3232        $userName = __('Guest', 'hfd-integration');
    3333
     
    9898        );
    9999       
     100        //add cargoHazor if govina
     101        /* if( $cargohazor ){
     102            //$pParam['CargoTypeHazor'] = $cargohazor;
     103            $pParam['govina'] = array(
     104                'code' => $this->_getParam30( $order ),
     105                'sum' => (int)$order->get_total(),
     106                'date' => date( 'Ymd', strtotime( $order->get_date_created() ) ),
     107            );
     108        } */
     109       
    100110        //send order items only if yes selected
    101111        if( $hfd_sync_order_items == "yes" ){
     
    246256        switch ($shippingMethod) {
    247257            case \Hfd\Woocommerce\Shipping\Epost::METHOD_ID:
    248                 $result = ['50', '11'];
     258                $result = ['50', '11', '0'];
    249259                break;
    250260            case \Hfd\Woocommerce\Shipping\Govina::METHOD_ID:
    251                 $result = ['37', '10'];
     261                $result = ['37', '10', '100'];
    252262                break;
    253263            case 'free_shipping':
    254264            default:
    255                 $result = ['35', '10'];
     265                $result = ['35', '10', '0'];
    256266                break;
    257267        }
     
    314324   
    315325    public function _getParam30($order){
    316         /* $shippingMethod = $this->_getShippingMethod($order);
     326        $shippingMethod = $this->_getShippingMethod($order);
    317327        if( $shippingMethod == \Hfd\Woocommerce\Shipping\Govina::METHOD_ID ){
    318328            $betanet_pmethod = get_post_meta( $order->get_id(), 'betanet_pmethod', true );
     
    322332                return 11;
    323333            }
    324         } */
     334        }
    325335        return '';
    326336    }
  • hfd-epost-integration/trunk/hfd-woocommerce-epost.php

    r3230450 r3235330  
    55Plugin URI:
    66Description: Add shipping method of ePost, allowing the user on the checkout, to select the pickup location point from a google map popup. Also allows to synch the order to HFD API after the order is created.
    7 Version: 2.15
     7Version: 2.16
    88Author: HFD
    99Author URI: https://www.hfd.co.il
  • hfd-epost-integration/trunk/readme.txt

    r3230450 r3235330  
    55Requires at least: 4.0
    66Tested up to: 6.7
    7 Stable tag: 2.15
     7Stable tag: 2.16
    88Requires PHP: 5.4
    99License: GPLv2 or later
     
    122122* Performance Improvement
    123123
     124= 2.16 =
     125* Performance Improvement
     126
    124127== Frequently Asked Questions ==
    125128= Why Google Maps isnt loading =
Note: See TracChangeset for help on using the changeset viewer.