Changeset 3196410
- Timestamp:
- 11/25/2024 11:46:44 AM (16 months ago)
- Location:
- seur/trunk
- Files:
-
- 4 edited
-
classes/class-seur-global.php (modified) (4 diffs)
-
core/labels-cpt/labels-cpt.php (modified) (5 diffs)
-
loader.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seur/trunk/classes/class-seur-global.php
r3191344 r3196410 788 788 789 789 $upload_dir = seur_upload_dir( 'labels' ); 790 $upload_url = seur_upload_url( 'labels' );791 790 792 791 if (! $wp_filesystem->is_writable($upload_dir)) { … … 800 799 $seur_label = []; 801 800 $cont = 1; 802 $content = ''; 801 803 802 // Generate file/s with then content of the labels 804 803 foreach ($responseLabel['data'] as $data) { … … 820 819 if ($merge_labels) { 821 820 $existing_content = $wp_filesystem->get_contents($upload_path); 821 if ($cont == 1) { 822 $existing_content = ''; 823 } 822 824 $content = $existing_content . $content; 823 825 } … … 838 840 } 839 841 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 } 840 849 // Generate a 'seur_labels' post for each physical file generated 841 850 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 type845 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 851 851 //Create post 852 852 $labelid = wp_insert_post( -
seur/trunk/core/labels-cpt/labels-cpt.php
r3191344 r3196410 237 237 function seur_metabox_label_callback( $post ) 238 238 { 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 } 242 243 $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 ); 243 246 $order_data = seur_get_order_data( $order_id ); 244 247 $mobile_shipping = $order->get_meta('_shipping_mobile_phone', true ); … … 371 374 */ 372 375 function seur_bulk_actions_handler( $redirect_to, $doaction, $labels_ids ) { 373 global $wp_filesystem;374 376 375 377 if ( 'download_seur_label' !== $doaction && 'update_seur_tracking' !== $doaction && 'generate_seur_manifest' != $doaction ) { … … 378 380 if ( 'download_seur_label' === $doaction ) { 379 381 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 381 389 $type = seur_get_file_type(seur()->get_option( 'seur_tipo_etiqueta_field' )); 382 390 $bulk_label_name = 'label_bulk_' . $date . seur_get_file_type_extension($type); … … 394 402 395 403 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 } 398 409 $numpackages = get_post_meta( $label_id, '_seur_shipping_packages', true ); 399 410 $weigth = get_post_meta( $label_id, '_seur_shipping_weight', true ); … … 403 414 } 404 415 $label_id = $result['result'][0]['labelID']; 416 $label_type = seur_get_file_type(get_post_meta( $label_id, '_seur_label_type', true )); 405 417 $label_file_name = get_post_meta( $label_id, '_seur_shipping_order_label_file_name', true ); 406 418 $label_path = get_post_meta( $label_id, '_seur_shipping_order_label_path_name', true ); 407 */408 419 } 409 420 -
seur/trunk/loader.php
r3191344 r3196410 4 4 * Plugin URI: http://www.seur.com/ 5 5 * 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.1 76 * Version: 2.2.18 7 7 * Author: SEUR Oficial 8 8 * Author URI: http://www.seur.com/ … … 20 20 use Automattic\WooCommerce\Utilities\FeaturesUtil; 21 21 22 define( 'SEUR_OFFICIAL_VERSION', '2.2.1 7' );22 define( 'SEUR_OFFICIAL_VERSION', '2.2.18' ); 23 23 define( 'SEUR_DB_VERSION', '1.0.4' ); 24 24 define( 'SEUR_TABLE_VERSION', '1.0.5' ); -
seur/trunk/readme.txt
r3191344 r3196410 4 4 Requires at least: 4.0 5 5 Tested up to: 6.6.2 6 Stable tag: 2.2.1 76 Stable tag: 2.2.18 7 7 WC requires at least: 3.0 8 8 WC tested up to: 9.1.4 … … 39 39 = Quick set-up = 40 40 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. 43 42 44 43 == Installation == … … 84 83 = What is the cargo manifest and how can I generate it? = 85 84 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.85 The 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. 87 86 88 87 = How can I track my Shipments? = … … 93 92 94 93 == 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 95 99 96 100 == 2.2.17 ==
Note: See TracChangeset
for help on using the changeset viewer.