Plugin Directory

Changeset 3196410


Ignore:
Timestamp:
11/25/2024 11:46:44 AM (16 months ago)
Author:
seuroficial
Message:

v2.2.18

Location:
seur/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • seur/trunk/classes/class-seur-global.php

    r3191344 r3196410  
    788788
    789789            $upload_dir = seur_upload_dir( 'labels' );
    790             $upload_url = seur_upload_url( 'labels' );
    791790
    792791            if (! $wp_filesystem->is_writable($upload_dir)) {
     
    800799            $seur_label = [];
    801800            $cont = 1;
    802             $content = '';
     801
    803802            // Generate file/s with then content of the labels
    804803            foreach ($responseLabel['data'] as $data) {
     
    820819                if ($merge_labels) {
    821820                    $existing_content = $wp_filesystem->get_contents($upload_path);
     821                    if ($cont == 1) {
     822                        $existing_content = '';
     823                    }
    822824                    $content = $existing_content . $content;
    823825                }
     
    838840            }
    839841
     842            $labelids_old = seur_get_labels_ids($order_id);
     843            // Delete old labels if they are not the same type that the configured one
     844            foreach ($labelids_old as $labelid_old) {
     845                if (get_post_meta($labelid_old, '_seur_label_type', true) != get_option('seur_tipo_etiqueta_field')) {
     846                    wp_delete_post($labelid_old, true);
     847                }
     848            }
    840849            // Generate a 'seur_labels' post for each physical file generated
    841850            foreach ($label_files as $label_file) {
    842                 /*
    843                 $labelids_old = seur_get_labels_ids($order_id);
    844                 // Delete old labels if they are not the same type
    845                 foreach ($labelids_old as $labelid_old) {
    846                     if (get_post_meta($labelid_old, '_seur_label_type', true) != get_option('seur_tipo_etiqueta_field')) {
    847                         wp_delete_post( $labelid_old, true );
    848                     }
    849                 }*/
    850 
    851851                //Create post
    852852                $labelid = wp_insert_post(
  • seur/trunk/core/labels-cpt/labels-cpt.php

    r3191344 r3196410  
    237237function seur_metabox_label_callback( $post )
    238238{
    239     $weight               = get_post_meta($post->ID,'_seur_shipping_weight', true );
    240     $order_id             = get_post_meta($post->ID,'_seur_shipping_order_id', true );
    241     $customer_name        = get_post_meta($post->ID,'_seur_label_customer_name', true );
     239    $order_id = get_post_meta($post->ID,'_seur_shipping_order_id', true );
     240    if (!$order_id) {
     241        return;
     242    }
    242243    $order = seur_get_order($order_id);
     244    $weight               = get_post_meta($post->ID,'_seur_shipping_weight', true );
     245    $customer_name        = get_post_meta($post->ID,'_seur_label_customer_name', true );
    243246    $order_data           = seur_get_order_data( $order_id );
    244247    $mobile_shipping      = $order->get_meta('_shipping_mobile_phone', true );
     
    371374 */
    372375function seur_bulk_actions_handler( $redirect_to, $doaction, $labels_ids ) {
    373     global $wp_filesystem;
    374376
    375377    if ( 'download_seur_label' !== $doaction && 'update_seur_tracking' !== $doaction && 'generate_seur_manifest' != $doaction ) {
     
    378380    if ( 'download_seur_label' === $doaction ) {
    379381
    380         $date = gmdate( 'd-m-Y-H-i-s' ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
     382        if ( ! function_exists( 'WP_Filesystem' ) ) {
     383            require_once ABSPATH . 'wp-admin/includes/file.php';
     384        }
     385        global $wp_filesystem;
     386        WP_Filesystem();
     387
     388        $date = gmdate( 'd-m-Y-H-i-s' ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
    381389        $type = seur_get_file_type(seur()->get_option( 'seur_tipo_etiqueta_field' ));
    382390        $bulk_label_name = 'label_bulk_' . $date . seur_get_file_type_extension($type);
     
    394402
    395403            if ( $label_type != $type || !file_exists($label_path) || empty($label_file_name)) {
    396                 // #TODO: revisar creación de etiqueta si no existe el fichero o ha cambiado el tipo de impresora
    397                 /*$order_id    = get_post_meta( $label_id, '_seur_shipping_order_id', true );
     404                // creación de etiqueta si no existe el fichero o ha cambiado el tipo de impresora
     405                $order_id    = get_post_meta( $label_id, '_seur_shipping_order_id', true );
     406                if ($order_id == "") { // al procesar una etiqueta, si estaba asociada a un pedido del que ya se ha regenerado una etiqueta, y por tanto borrado las anteriores, se continua
     407                    continue;
     408                }
    398409                $numpackages = get_post_meta( $label_id, '_seur_shipping_packages', true );
    399410                $weigth      = get_post_meta( $label_id, '_seur_shipping_weight', true );
     
    403414                }
    404415                $label_id = $result['result'][0]['labelID'];
     416                $label_type      = seur_get_file_type(get_post_meta( $label_id, '_seur_label_type', true ));
    405417                $label_file_name = get_post_meta( $label_id, '_seur_shipping_order_label_file_name', true );
    406418                $label_path      = get_post_meta( $label_id, '_seur_shipping_order_label_path_name', true );
    407                 */
    408419            }
    409420
  • seur/trunk/loader.php

    r3191344 r3196410  
    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.17
     6 * Version: 2.2.18
    77 * Author: SEUR Oficial
    88 * Author URI: http://www.seur.com/
     
    2020use Automattic\WooCommerce\Utilities\FeaturesUtil;
    2121
    22 define( 'SEUR_OFFICIAL_VERSION', '2.2.17' );
     22define( 'SEUR_OFFICIAL_VERSION', '2.2.18' );
    2323define( 'SEUR_DB_VERSION', '1.0.4' );
    2424define( 'SEUR_TABLE_VERSION', '1.0.5' );
  • seur/trunk/readme.txt

    r3191344 r3196410  
    44Requires at least: 4.0
    55Tested up to: 6.6.2
    6 Stable tag: 2.2.17
     6Stable tag: 2.2.18
    77WC requires at least: 3.0
    88WC tested up to: 9.1.4
     
    3939= Quick set-up =
    4040
    41 [Leave your details here](https://info.notificaciones.e-seur.com/Formulario-Web-Seur). Ask SEUR for your registration details, fill in the configuration form and set the transport rate for your buyers. Trust your shipments to the leading e-commerce logistics partner in just 3 steps.
    42 
     41[Leave your details here](https://info.notificaciones.e-seur.com/Formulario-Web-Seur?ecommerce=checked). Ask SEUR for your registration details, fill in the configuration form and set the transport rate for your buyers. Trust your shipments to the leading e-commerce logistics partner in just 3 steps.
    4342
    4443== Installation ==
     
    8483= What is the cargo manifest and how can I generate it? =
    8584
    86 The cargo manifest is a record of the packages given to our SEUR agent for delivery; this document can be downloaded in the "SEUR > Shipments" section via the SEUR menu. Remember to print two copies: one for you and one for the driver.
     85The cargo manifest is a record of the packages given to our SEUR agent for delivery; this document can be downloaded in the "Manifest" section via the SEUR menu. Remember to print two copies: one for you and one for the driver.
    8786
    8887= How can I track my Shipments? =
     
    9392
    9493== Changelog ==
     94
     95== 2.2.18 ==
     96
     97* ADDED: Regenerate labels if file not found or label type config changed
     98* FIXED: ZPL init filesystem
    9599
    96100== 2.2.17 ==
Note: See TracChangeset for help on using the changeset viewer.