Plugin Directory

Changeset 3103007

Timestamp:
06/15/2024 09:08:23 AM (7 weeks ago)
Author:
bandido
Message:

Version 1.17.6

Location:
woo-ukrposhta
Files:
134 added
11 edited

Legend:

Unmodified
Added
Removed
  • woo-ukrposhta/trunk/admin/js/script.js

    r3005102 r3103007  
    1 window.onload = function() {
     1 function() {
    22
    33  // Checks input 'Вага, кг' on 'Нові відправлення' page on zero.
     
    193193
    194194
    195 }
     195}
    196196
    197197
  • woo-ukrposhta/trunk/admin/partials/invoice/view/invoice_params.php

    r3032561 r3103007  
    171171                                }
    172172                             ?>"  />
     173
     174
     175
     176
    173177                            <input type="submit" value="Створити" name="morkvaup_checkforminputs" class="morkvaup_checkforminputs button button-primary" id="submit"/>
    174178                        </td>
  • woo-ukrposhta/trunk/admin/partials/invoice/view/invoice_recipient.php

    r3005102 r3103007  
    3030                <td>
    3131                    <input type="text" name="rec_middle_name" id="rec_middle_name" class="input recipient_name"
    32                         value="<?php echo esc_html( $invoiceOrder->getShippingMiddleName() ); ?>" required />
     32                        value="<?php
     33                            if($invoiceOrder->getDeliveryType() == 'W2W')
     34                            {
     35                                echo esc_html( $invoiceOrder->getShippingMiddleName() );
     36                            }
     37                            else{
     38                                $order_data = $invoiceOrder->getOrderData();
     39
     40                               
     41                                $billing_up_address_surname = $order_data->get_meta('_billing_up_address_surname');
     42                                if(!$billing_up_address_surname)
     43                                {
     44                                    $billing_up_address_surname = $order_data->get_meta('_shipping_up_address_surname');
     45                                }
     46
     47                                echo $billing_up_address_surname;
     48                            }
     49                          ?>" required />
    3350                </td>
    3451            </tr>
  • woo-ukrposhta/trunk/admin/partials/morkvaup-plugin-form.php

    r3005102 r3103007  
    4343    // Create Addresses
    4444    $senderAddrId = ( null !== $sender->getAddress() ) ? $sender->getAddress(): null;
    45     $recipientAddrId = ( null !== $recipient->getAddress() ) ? $recipient->getAddress(): null;
     45    $recipientAddrId = ( null !== $recipient->getAddress(): null;
    4646
    4747    // Create Clients
  • woo-ukrposhta/trunk/assets/js/checkout-up.js

    r3059630 r3103007  
    8181    }
    8282
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
    8393    // Set billing_country field value if it is absent on Checkout page
    8494    // currentCountry = jQuery('#billing_country').length ? jQuery('#billing_country').val() : 'UA';
     
    101111    Cookies.set('shipping_city', jQuery('#billing_city').val() );
    102112    Cookies.set('up_shipping_postcode', jQuery('#ukrposhta_shippping_warehouse').val() );
     113
     114
     115
     116
    103117    var addr = jQuery('#up_custom_address').attr('checked') || 'unchecked';
    104118    //console.log(addr);
     
    115129  let initialize = function () {
    116130    jQuery('#ukrposhta_shippping_warehouse').on('change', function(){
     131
     132
     133
     134
    117135      serialixe();
    118136    });
     
    332350              jQuery('#ukrposhta_shippping_fields').removeClass('mrkvup-loading'); // Remove spinner
    333351              jQuery("#ukrposhta_shippping_postcode_select").change (function () {
    334                 let selectedWarehouse = jQuery('#select2-ukrposhta_shippping_postcode_select-container').text();
     352                let selectedWarehouse = jQuery('#select2-ukrposhta_shippping_postcode_select-container').);
    335353                let selectedPostcode = selectedWarehouse.substring(0,5);
    336354
     
    343361                let hiddenPostcodeVal = isNaN(selectedPostcode) ? '' : selectedPostcode;
    344362                jQuery('#ukrposhta_shippping_postcode_selected').val(hiddenPostcodeVal);
     363
     364
    345365              });
    346366            }
     
    361381
    362382    let curShippingMethod = getCurrentShippingMethod();
    363     if (curShippingMethod.indexOf('ukrposhta_shippping') >= 0) {
     383    if (curShippingMethod.indexOf('ukrposhta_shippping') >= 0) {
    364384        autoSelectCityPo();
    365385    }
     
    368388        var curShippingMethod_new = getCurrentShippingMethod();
    369389
    370         if (curShippingMethod_new.indexOf('ukrposhta_shippping') >= 0) {
     390        if (curShippingMethod_new.indexOf('ukrposhta_shippping') >= 0) {
    371391          if (document.body.classList.contains('mrkvnp-plugin-is-active')) {
    372392            // If PRO-НП is active on the site
     
    381401            autoSelectCityPo();
    382402        }
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
     417
    383418    });
    384419
  • woo-ukrposhta/trunk/classes/CheckoutValidator.php

    r3005102 r3103007  
    2121      add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true' );
    2222    }
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
    2355  }
    2456
  • woo-ukrposhta/trunk/classes/OrderCreator.php

    r3005102 r3103007  
    1919    {
    2020        if ( isset( $_POST['shipping_method'] ) ) {
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
    2136            if ( strpos( $_POST['shipping_method'][0], MORKVA_UKRPOSHTA_UP_SHIPPING_NAME ) === false) return;
    2237        }
  • woo-ukrposhta/trunk/classes/invoice/Recipient.php

    r3005102 r3103007  
    77class Recipient extends Sender
    88{
    9     public $addressId = '';
     9    public $addressId = '';
    1010
    1111    public $addressMsg = '';
    1212
    13     public function getAddress()
     13    public function getAddress()
    1414    {
    1515        if ( isset( $_POST['index2'] ) ) {
    16             $address = $this->ukrposhtaApi->modelAdressPost( array(
    17                 "postcode" => $_POST['index2'],
    18                 "country" => $_POST['country_rec'],
    19             ) );
     16            if($order_data)
     17            {
     18                $shipping_methods = $order_data->get_shipping_methods();
     19                $shipping_method = @array_shift( $shipping_methods );
     20                $shipping_method_id = $shipping_method->get_method_id();
     21
     22                if( 'ukrposhta_shippping' == $shipping_method_id )
     23                {
     24                    $address = $this->ukrposhtaApi->modelAdressPost( array(
     25                        "postcode" => $_POST['index2'],
     26                        "country" => $_POST['country_rec'],
     27                    ) );
     28                }
     29                else
     30                {
     31                    $address = $this->ukrposhtaApi->modelAdressPost( array(
     32                        "postcode" => $_POST['index2'],
     33                        "country" => $_POST['country_rec'],
     34                        "region" => $_POST['region_data'],
     35                        "city" => $_POST['city_data'],
     36                        "street" => $_POST['street_data'],
     37                        "apartmentNumber" => $_POST['apartmentNumber_data']
     38                    ) );
     39                }
     40            }
     41            else
     42            {
     43                $address = $this->ukrposhtaApi->modelAdressPost( array(
     44                    "postcode" => $_POST['index2'],
     45                    "country" => $_POST['country_rec'],
     46                ) );   
     47            }
     48           
    2049            if ( isset( $address['id'] ) ) {
    2150                return $this->addressId = $address['id'];
  • woo-ukrposhta/trunk/includes/class-morkvaup-plugin-loader.php

    r3013204 r3103007  
    12021202            }
    12031203            //echo $methodid;
    1204             if ((strpos($methodid, 'u_poshta_shipping_method') !== false) || (strpos($methodid, 'ukrposhta_shippping') !== false))
     1204            if ((strpos($methodid, 'u_poshta_shipping_method') !== false) || (strpos($methodid, 'ukrposhta_shippping') !== false))
    12051205            {
    12061206                echo '<style>#mvup_other_fields{display:block;}</style>';
  • woo-ukrposhta/trunk/morkvaup-plugin.php

    r3089321 r3103007  
    44 * Plugin URI: https://morkva.co.ua/shop/woo-ukrposhta-pro-lifetime
    55 * Description:  Генеруйте накладні просто зі сторінки замовлення і зекономте тонну часу на відділенні при відправці.
    6  * Version: 1.17.5
     6 * Version: 1.17.
    77 * Author: Morkva
    88 * Text Domain: woo-ukrposhta-pro
  • woo-ukrposhta/trunk/readme.txt

    r3089321 r3103007  
    55Tested up to: 6.5
    66Requires PHP: 7.0
    7 Stable tag: 1.17.5
     7Stable tag: 1.17.
    88WC tested up to: 8.8
    99License: GPLv2
     
    8686== Що нового? ==
    8787
     88
     89
     90
    8891= 1.17.5 =
    8992* WooCommerce 8.8 - сумісний
Note: See TracChangeset for help on using the changeset viewer.