Changeset 3718397
- Timestamp:
- 09/29/2026 06:45:58 AM (4 weeks ago)
- Location:
- slovenska-posta-epodaci-harok
- Files:
-
- 32 added
- 5 edited
-
tags/2.0.1 (added)
-
tags/2.0.1/css (added)
-
tags/2.0.1/css/spirit-eph.css (added)
-
tags/2.0.1/export (added)
-
tags/2.0.1/includes (added)
-
tags/2.0.1/includes/Posta_ShippingClass.php (added)
-
tags/2.0.1/includes/admin.php (added)
-
tags/2.0.1/includes/balikobox.php (added)
-
tags/2.0.1/includes/bonus.php (added)
-
tags/2.0.1/includes/export.php (added)
-
tags/2.0.1/includes/functions.php (added)
-
tags/2.0.1/includes/pickup-widget.php (added)
-
tags/2.0.1/includes/podacie_cisla.php (added)
-
tags/2.0.1/includes/posta_api.php (added)
-
tags/2.0.1/includes/settings.php (added)
-
tags/2.0.1/includes/woo-metabox.php (added)
-
tags/2.0.1/includes/woo-order-email.php (added)
-
tags/2.0.1/includes/woo-table.php (added)
-
tags/2.0.1/js (added)
-
tags/2.0.1/js/spirit-eph-admin.js (added)
-
tags/2.0.1/js/tsseph-pickup-widget.js (added)
-
tags/2.0.1/languages (added)
-
tags/2.0.1/languages/spirit-eph.pot (added)
-
tags/2.0.1/readme.txt (added)
-
tags/2.0.1/slovenska-posta-epodaci-harok.php (added)
-
tags/2.0.1/src (added)
-
tags/2.0.1/src/ajax-loader.gif (added)
-
tags/2.0.1/src/bonus.json (added)
-
tags/2.0.1/src/ePodaci-harok.png (added)
-
tags/2.0.1/templates (added)
-
tags/2.0.1/templates/settings-page.php (added)
-
tags/2.0.1/uninstall.php (added)
-
trunk/includes/Posta_ShippingClass.php (modified) (2 diffs)
-
trunk/includes/pickup-widget.php (modified) (2 diffs)
-
trunk/js/tsseph-pickup-widget.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/slovenska-posta-epodaci-harok.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
slovenska-posta-epodaci-harok/trunk/includes/Posta_ShippingClass.php
r3640073 r3718397 77 77 'type' => 'number', 78 78 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ), 79 'description' => __( 'Doprava zdarma od sumy. ', 'spirit-eph' ),79 'description' => __( 'Doprava zdarma od sumy. Ak pole necháte prázdne, doprava zdarma je vypnutá.', 'spirit-eph' ), 80 80 'default' => 50 81 ), 82 'free_shipping_label' => array( 83 'title' => __( 'Text pri doprave zdarma', 'spirit-eph' ), 84 'type' => 'text', 85 'description' => __( 'Text zobrazený za názvom dopravy, ak je doprava zdarma (napr. "Slovenská pošta - doprava zadarmo"). Ak pole necháte prázdne, text sa nezobrazí.', 'spirit-eph' ), 86 'default' => __( 'doprava zadarmo', 'spirit-eph' ) 81 87 ) 82 88 … … 95 101 96 102 // We will add the cost, rate and logics in here 97 $cost = ( double) $this->get_option( 'standard_cost' );98 $free_shipping = (double)$this->get_option( 'free_shipping' );103 $cost = (float) $this->get_option( 'standard_cost' ); 104 $free_shipping = $this->get_option( 'free_shipping' ); 99 105 100 // If total higher than 20, activate free shipping101 if ( $free_shipping <= $package['cart_subtotal']) {106 // Empty threshold means free shipping is disabled 107 if ( $free_shipping !== '' && (float) $free_shipping <= $package['cart_subtotal'] ) { 102 108 $cost = 0.00; 109 } 110 111 $label = $this->title; 112 $free_shipping_label = trim( $this->get_option( 'free_shipping_label' ) ); 113 114 if ( $cost <= 0 && $free_shipping_label !== '' ) { 115 $label .= ' - ' . $free_shipping_label; 103 116 } 104 117 105 118 $rate = array( 106 119 'id' => $this->id, 107 'label' => $ this->title,120 'label' => $label, 108 121 'cost' => $cost 109 122 ); -
slovenska-posta-epodaci-harok/trunk/includes/pickup-widget.php
r3640073 r3718397 35 35 ), 36 36 ) ); 37 } 38 39 /* 40 * Resolve the pickup widget shipmentType ('b', 'ex', 'zb') from the default parcel 41 * type configured for the chosen Pošta shipping instance, so the widget only lists 42 * points that accept that parcel type. 43 */ 44 function tsseph_get_pickup_shipment_type() { 45 $shipment_types = array( 'b' => 'b', 'ek' => 'ex', 'zb' => 'zb' ); 46 47 if ( ! WC()->session || ! WC()->shipping() ) return 'b'; 48 49 $chosen = WC()->session->get( 'chosen_shipping_methods', array() ); 50 $packages = WC()->shipping()->get_packages(); 51 52 foreach ( $chosen as $package_key => $rate_id ) { 53 if ( strpos( $rate_id, 'tssph_sk_posta' ) !== 0 ) continue; 54 if ( empty( $packages[ $package_key ]['rates'][ $rate_id ] ) ) continue; 55 56 $instance_id = $packages[ $package_key ]['rates'][ $rate_id ]->get_instance_id(); 57 $eph_method = tsseph_resolve_eph_method( $instance_id, 'tssph_sk_posta', get_option( 'tsseph_options' ) ); 58 $druh = tsseph_posta_api_get_druh_zasielky( tsseph_get_druh_zasielky( $eph_method ) ); 59 60 return isset( $shipment_types[ $druh['code'] ] ) ? $shipment_types[ $druh['code'] ] : 'b'; 61 } 62 63 return 'b'; 37 64 } 38 65 … … 57 84 <th><?php esc_html_e( 'Odberné miesto', 'spirit-eph' ); ?></th> 58 85 <td> 59 <button type="button" id="tsseph-pickup-btn" class="button wp-element-button" >86 <button type="button" id="tsseph-pickup-btn" class="button wp-element-button" data-shipment-type="<?php echo esc_attr( tsseph_get_pickup_shipment_type() ); ?>"> 60 87 <?php echo esc_html( $btn_label ); ?> 61 88 </button> -
slovenska-posta-epodaci-harok/trunk/js/tsseph-pickup-widget.js
r3640073 r3718397 48 48 $( '#tsseph-pickup-label' ).html( address ); 49 49 $( '#tsseph-pickup-btn' ).text( tsseph_pickup.i18n.change_point ); 50 $( '.tsseph-pickup-address-row' ).show(); 50 // Keep the selection in session, but only show the address while Pošta is the chosen method 51 $( '.tsseph-pickup-address-row' ).toggle( isPostaSelected() ); 51 52 } else { 52 53 $( '#tsseph-pickup-label' ).html( '' ); … … 107 108 slposta.PickupWidget.open( { 108 109 branchKinds: [ 'office', 'bbox', 'point' ], 109 shipmentType: 'b',110 shipmentType: $( '#tsseph-pickup-btn' ).data( 'shipment-type' ) || 'b', 110 111 callback: function ( pickupPoint ) { 111 112 // Widget closed without selecting -
slovenska-posta-epodaci-harok/trunk/readme.txt
r3642268 r3718397 6 6 Tested up to: 7.0 7 7 Requires PHP: 5.2.4 8 Stable tag: 2.0. 08 Stable tag: 2.0.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 57 57 == Changelog == 58 59 = 2.0.1 = 60 * BalíkoBOX: adresa odberného miesta sa skryje pri zmene na iný spôsob dopravy 61 * Text "doprava zadarmo" za názvom dopravy Slovenská pošta (nastaviteľný v shipping zóne) 62 * Prázdne pole "Doprava zdarma" vypína dopravu zdarma 63 * Widget odberných miest zohľadňuje nastavený druh zásielky (Balík / Expres kuriér / Zmluvný balík) 58 64 59 65 = 2.0.0 = -
slovenska-posta-epodaci-harok/trunk/slovenska-posta-epodaci-harok.php
r3640073 r3718397 4 4 Plugin URI: https://www.matejpodstrelenec.sk 5 5 Description: Plugin pre generovanie podacieho hárku určeného na import do webovej aplikácie slovenskej pošty. 6 Version: 2.0. 06 Version: 2.0.1 7 7 Author: Matej Podstrelenec 8 8 Author URI: https://www.matejpodstrelenec.sk/en/ … … 32 32 33 33 define('SPIRIT_EPH_PLUGIN_PATH', plugin_dir_path( __FILE__)); 34 define('SPIRIT_EPH_VERSION', '2.0. 0' );34 define('SPIRIT_EPH_VERSION', '2.0.1' ); 35 35 36 36 include (SPIRIT_EPH_PLUGIN_PATH . "includes/functions.php");
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)