Plugin Directory

Changeset 3130893


Ignore:
Timestamp:
08/05/2024 08:43:06 AM (20 months ago)
Author:
seuroficial
Message:

v2.2.11

Location:
seur/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • seur/trunk/assets/js/seur-country-state.js

    r1836328 r3130893  
    11jQuery(document).ready(function($){
    2     var seur_country_state_process = 'admin.php?page=seur_country_state_process';
     2    var seur_country_state_process = 'admin-ajax.php?action=seur_country_state_process';
    33
    4      $("select.rate").change(function(){
     4    $("#emp-SaveForm").on( "change", 'select.rate', seur_rate_change );
     5    $("#emp-SaveForm").on( "change", 'select.country', seur_country_change );
     6    $("#emp-UpdateForm").on( "change", 'select.rate', seur_rate_change );
     7    $("#emp-UpdateForm").on( "change", 'select.country', seur_country_change );
     8
     9    function seur_rate_change() {
    510        var selectedRate = $(".rate option:selected").val();
    611        $.ajax({
     
    1116            $("#countryid").replaceWith( $("#countryid").html(data) );
    1217        });
    13     });
     18    }
    1419
    15     $("select.country").change(function(){
     20    function seur_country_change() {
    1621        var selectedCountry = $(".country option:selected").val();
    1722        $.ajax({
     
    2227            $("#states").replaceWith( $("#states").html(data) );
    2328        });
    24     });
     29    }
    2530});
  • seur/trunk/classes/class-seur-global.php

    r3119152 r3130893  
    571571                "currencyCode" => "EUR",
    572572                "amount" => $preparedData['valorReembolso'],
    573                 "codFee" => "D"
     573                "codFee" => "P"
    574574            ];
    575575        }
  • seur/trunk/classes/class-seur-seguimiento.php

    r3119152 r3130893  
    3939        $this->token               = seur()->get_token_b();
    4040        $this->reftype             = 'REFERENCE';
    41         $this->id_number           = seur()->get_option( 'seur_nif_field' );
    4241        $this->full_account_number = seur()->get_option( 'seur_accountnumber_field' );
    4342        $this->accoun_number       = substr( $this->full_account_number, 0, strpos( $this->full_account_number, '-' ) );
     
    5150                'ref'           => $ref,
    5251                'refType'       => $this->reftype,
    53                 'idNumber'      => $this->id_number,
    5452                'accountNumber' => $this->accoun_number,
    5553                'businessUnit'  => $this->business_unit,
  • seur/trunk/classes/tcpdf/include/tcpdf_fonts.php

    r3120329 r3130893  
    19961996     * @public static
    19971997     */
    1998     public static function UTF8StringToArray($str, $isunicode=true, &$currentfont) {
     1998    public static function UTF8StringToArray($str, $isunicode, &$currentfont) {
    19991999        if ($isunicode) {
    20002000            // requires PCRE unicode support turned on
     
    20222022     * @public static
    20232023     */
    2024     public static function UTF8ToLatin1($str, $isunicode=true, &$currentfont) {
     2024    public static function UTF8ToLatin1($str, $isunicode, &$currentfont) {
    20252025        $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values
    20262026        return self::UTF8ArrToLatin1($unicode);
     
    20382038     * @public static
    20392039     */
    2040     public static function UTF8ToUTF16BE($str, $setbom=false, $isunicode=true, &$currentfont) {
     2040    public static function UTF8ToUTF16BE($str, $setbom, $isunicode, &$currentfont) {
    20412041        if (!$isunicode) {
    20422042            return $str; // string is not in unicode
     
    20582058     * @public static
    20592059     */
    2060     public static function utf8StrRev($str, $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) {
     2060    public static function utf8StrRev($str, $setbom, $forcertl, $isunicode, &$currentfont) {
    20612061        return self::utf8StrArrRev(self::UTF8StringToArray($str, $isunicode, $currentfont), $str, $setbom, $forcertl, $isunicode, $currentfont);
    20622062    }
     
    20752075     * @public static
    20762076     */
    2077     public static function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false, $isunicode=true, &$currentfont) {
     2077    public static function utf8StrArrRev($arr, $str, $setbom, $forcertl, $isunicode, &$currentfont) {
    20782078        return self::arrUTF8ToUTF16BE(self::utf8Bidi($arr, $str, $forcertl, $isunicode, $currentfont), $setbom);
    20792079    }
     
    20912091     * @public static
    20922092     */
    2093     public static function utf8Bidi($ta, $str='', $forcertl=false, $isunicode=true, &$currentfont) {
     2093    public static function utf8Bidi($ta, $str, $forcertl, $isunicode, &$currentfont) {
    20942094        // paragraph embedding level
    20952095        $pel = 0;
  • seur/trunk/classes/tcpdf/include/tcpdf_static.php

    r3120329 r3130893  
    11371137     * @public static
    11381138     */
    1139     public static function fixHTMLCode($html, $default_css='', $tagvs='', $tidy_options='', &$tagvspaces) {
     1139    public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) {
    11401140        // configure parameters for HTML Tidy
    11411141        if ($tidy_options === '') {
     
    25082508     * @public static
    25092509     */
    2510     public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points=false, $k, $pagedim=array()) {
     2510    public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points, $k, $pagedim=array()) {
    25112511        if (!isset($pagedim[$page])) {
    25122512            // initialize array
  • seur/trunk/core/functions/functions.php

    r3121021 r3130893  
    12151215        $email            = $order->get_billing_email();
    12161216        $phone            = cleanPhone($order->get_billing_phone());
    1217         $order_total      = $order->get_meta('_order_total', true );
     1217        $order_total      = $order->get_total();
    12181218        $order_pay_method = $order->get_payment_method();
    12191219
     
    17131713    }
    17141714
    1715     $preparedData['claveReembolso'] = '';
    17161715    $preparedData['valorReembolso'] = '';
    17171716    if ( 'cod' === $preparedData['order_pay_method']) {
    1718         $preparedData['claveReembolso'] = 'f';
    17191717        $preparedData['valorReembolso'] = $preparedData['customer_order_total'];
    17201718    }
     
    19091907}
    19101908
     1909add_action('wp_ajax_seur_country_state_process', 'seur_country_state_process');
     1910add_action('wp_ajax_nopriv_seur_country_state_process', 'seur_country_state_process');
     1911
    19111912remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
    19121913add_action( 'shutdown', function() {
  • seur/trunk/core/labels-cpt/labels-cpt.php

    r3119152 r3130893  
    505505
    506506        set_transient( get_current_user_id() . '_seur_label_bulk_manifest', true );
    507         $redirect_to = add_query_arg( 'bulk_manifest_seur', count( $labels_ids ), $redirect_to );
    508         return $redirect_to;
    509507
    510508    }
     
    551549        $total_expedidiciones++;
    552550        $total_bultos = $total_bultos + $order['bultos'];
    553         $total_kgs = $total_kgs + $order['peso'];
     551        $total_kgs = $total_kgs + round((float) $order['peso'], 2);
    554552        $total_reembolso = $total_reembolso + $order['cashondelivery'];
    555553    }
  • seur/trunk/core/pages/rates/seur-country-state-process.php

    r3119152 r3130893  
    2626        }
    2727        echo '</select>';
    28         set_transient( get_current_user_id() . '_seur_rate', $rate );
     28        //set_transient( get_current_user_id() . '_seur_rate', $rate );
    2929    }
    3030    if ( isset( $_POST['country'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
     
    5959        unset( $country );
    6060    }
     61    die;
    6162}
  • seur/trunk/core/woocommerce/includes/seur-woo-functions.php

    r3119152 r3130893  
    2222}
    2323// Store cart weight in the database.
    24 add_action( 'woocommerce_checkout_update_order_meta', 'seur_add_cart_weight' );
    25 function seur_add_cart_weight( $order_id ) {
    26     global $woocommerce;
    27 
    28     $order = new WC_Order( $order_id );
    29 
    30     $ship_methods = maybe_unserialize( $order->get_shipping_methods() );
    31     foreach ( $ship_methods as $ship_method ) {
    32         $product_name = $ship_method['name'];
    33     }
     24/*********************************************
     25 * COMMENT THIS CODE WHILE WOOCOMMERCE RESOLVE THE BUG
     26 * woocommerce_checkout_update_order_meta not hiring with new WC Checkout Block
     27 ********************************************/
     28/* add_action( 'woocommerce_checkout_update_order_meta', 'seur_add_cart_weight' );
     29function seur_add_cart_weight( $order_id )
     30{
     31    $order = new WC_Order( $order_id );
     32
     33    $ship_methods = maybe_unserialize( $order->get_shipping_methods() );
     34    foreach ( $ship_methods as $ship_method ) {
     35        $product_name = $ship_method['name'];
     36    }
    3437
    3538    $products = seur()->get_products();
     
    4447    }
    4548
    46     $weight = WC()->cart->cart_contents_weight;
     49    $weight = WC()->cart->cart_contents_weight;
    4750    $order->update_meta_data('_seur_cart_weight', $weight );
     51    $order->save_meta_data();
     52} */
     53/*********************************************
     54 * ADDED THIS ACTION WHILE WOOCOMMERCE RESOLVE THE BUG
     55 * woocommerce_checkout_update_order_meta not hiring with new WC Checkout Block
     56 ********************************************/
     57add_action( 'woocommerce_thankyou', 'seur_add_cart_weight_bis' );
     58function seur_add_cart_weight_bis( $order_id )
     59{
     60    if (!is_numeric($order_id)) {
     61        return;
     62    }
     63
     64    $order = new WC_Order( $order_id );
     65    $ship_methods = maybe_unserialize( $order->get_shipping_methods() );
     66    foreach ( $ship_methods as $ship_method ) {
     67        $product_name = $ship_method['name'];
     68    }
     69
     70    $products = seur()->get_products();
     71    foreach ( $products as $code => $product ) {
     72        $custom_name = get_option($product['field'].'_custom_name_field')?get_option($product['field'].'_custom_name_field'):$code;
     73        if ($custom_name == $product_name) {
     74            $order->update_meta_data('_seur_shipping', 'seur' );
     75            $order->update_meta_data('_seur_shipping_method_service_real_name', $code );
     76            $order->update_meta_data('_seur_shipping_method_service', sanitize_title( $product_name ) );
     77            break;
     78        }
     79    }
     80
     81    $items = $order->get_items();
     82    $total_weight = 0;
     83    foreach ($items as $item) {
     84        $product_quantity = $item->get_quantity();
     85        $product_weight = $item->get_product()->get_weight(); // Obtiene el peso del producto
     86        $total_weight += $product_weight * $product_quantity;
     87    }
     88
     89    $order->update_meta_data('_seur_cart_weight', $total_weight );
    4890    $order->save_meta_data();
    4991}
  • seur/trunk/loader.php

    r3121021 r3130893  
    44 * Plugin URI: http://www.seur.com/
    55 * Description: Add SEUR shipping method to WooCommerce. The SEUR plugin for WooCommerce allows you to manage your order dispatches in a fast and easy way
    6  * Version: 2.2.10
     6 * Version: 2.2.11
    77 * Author: SEUR Oficial
    88 * Author URI: http://www.seur.com/
    9  * Tested up to: 6.5.5
     9 * Tested up to: 6.2
    1010 * WC requires at least: 3.0
    11  * WC tested up to: 9.1.0
     11 * WC tested up to: 7.4
    1212 * Text Domain: seur
    1313 * Domain Path: /languages/
     
    1818 **/
    1919
    20 define( 'SEUR_OFFICIAL_VERSION', '2.2.10.2' );
     20define( 'SEUR_OFFICIAL_VERSION', '2.2.11' );
    2121define( 'SEUR_DB_VERSION', '1.0.4' );
    2222define( 'SEUR_TABLE_VERSION', '1.0.4' );
  • seur/trunk/readme.txt

    r3121021 r3130893  
    33Tags: woocommerce, shipping, seur, logistica, enviar paquete, pedidos, entregas
    44Requires at least: 4.0
    5 Tested up to: 6.5.5
    6 Stable tag: 2.2.10.2
     5Tested up to: 6.2
     6Stable tag: 2.2.11
    77WC requires at least: 3.0
    8 WC tested up to: 9.1.0
     8WC tested up to: 7.4
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9393
    9494== Changelog ==
     95
     96== 2.2.11 ==
     97
     98* CHANGED: Rates ajax call
     99* CHANGED: Remove optional parameters to avoid deprecated notice in tcpdf library
     100* CHANGED: Remove id_number (nif) from request data
     101* FIXED: Fix COD value
     102* FIXED: Manifest remove redirect
     103* FIXED: Woocommerce bug with metadata in checkout block
     104* FIXED: Woocommerce bug undefined wc_get_page_screen_id
    95105
    96106== 2.2.10 ==
Note: See TracChangeset for help on using the changeset viewer.