Plugin Directory

Changeset 3780266


Ignore:
Timestamp:
11/02/2026 04:21:39 PM (11 hours ago)
Author:
voltraider
Message:

2.8.0: Ukrposhta checkout fields, shared delivery fields

Location:
elementarno-ukraine-for-woocommerce
Files:
8 added
26 edited
1 copied

Legend:

Unmodified
Added
Removed
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/assets/js/np-checkout.js

    r3754700 r3780266  
    33 *
    44 * The picker lives OUTSIDE the order-review fragment, so its DOM and values
    5  * survive WooCommerce's AJAX re-renders; only its visibility — and the
    6  * visibility of the billing address fields — depends on the chosen shipping
    7  * method, re-evaluated on every `updated_checkout`.
     5 * survive WooCommerce's AJAX re-renders. Its visibility, and that of the
     6 * billing address fields, is handled by delivery-fields.js, shared with the
     7 * other point-delivery carriers.
    88 *
    99 * Searchable dropdowns use the selectWoo build WooCommerce ships. Without it
    … …  
    2222        var config = window.elementarnoNpCheckout;
    2323        var hasSelectWoo = false; // decided at init time, not at parse time
    24 
    25         function isNpChosen() {
    26                 var chosen = $( 'input[name^="shipping_method"]:checked' );
    27 
    28                 if ( ! chosen.length ) {
    29                         // A zone with a single method renders a hidden input instead.
    30                         chosen = $( 'input[name^="shipping_method"][type="hidden"]' );
    31                 }
    32 
    33                 var found = false;
    34 
    35                 chosen.each( function () {
    36                         if ( String( $( this ).val() ).indexOf( config.methodId ) === 0 ) {
    37                                 found = true;
    38                         }
    39                 } );
    40 
    41                 return found;
    42         }
    43 
    44         function toggle() {
    45                 var active = isNpChosen();
    46 
    47                 $( '[data-elm-np]' ).toggle( active );
    48 
    49                 $.each( config.hiddenFields, function ( _, selector ) {
    50                         $( selector ).toggle( ! active );
    51                 } );
    52         }
    5324
    5425        function enhance( $select, options ) {
    … …  
    12899
    129100                if ( ! $root.length || $root.data( 'elmNpReady' ) ) {
    130                         toggle();
    131101                        return;
    132102                }
    … …  
    212182                        rememberSelection( $root );
    213183                } );
    214 
    215                 toggle();
    216184        }
    217185
    218186        $( document ).ready( init );
    219187        $( document.body ).on( 'updated_checkout', init );
    220         $( document.body ).on( 'change', 'input[name^="shipping_method"]', toggle );
    221188} )( window.jQuery );
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/elementarno-ukraine-for-woocommerce.php

    r3780183 r3780266  
    44 * Plugin URI:           https://elementarno.codes/elementarno-ukraine-for-woocommerce/
    55 * Description:          Connect the most popular Ukrainian services to WooCommerce: payments, shipping and integrations, each an independent module you can switch off.
    6  * Version:              2.7.3
     6 * Version:              2.8.0
    77 * Requires at least:    6.2
    88 * Requires PHP:         8.0
    … …  
    2424defined( 'ABSPATH' ) || exit;
    2525
    26 const ELEMENTARNO_UA_VERSION = '2.7.3';
     26const ELEMENTARNO_UA_VERSION = '2.8.0';
    2727
    2828define( 'ELEMENTARNO_UA_FILE', __FILE__ );
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Core/Orders/OrderFields.php

    r3754700 r3780266  
    3939                '_elementarno_np_city',
    4040                '_elementarno_np_warehouse',
     41                '_elementarno_up_region',
     42                '_elementarno_up_city',
     43                '_elementarno_up_postcode',
    4144                '_elementarno_checkbox_receipt_url',
    4245        );
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Integrations/Telegram/Integration.php

    r3760347 r3780266  
    9797                                'css'         => 'height: 160px;',
    9898                                'default'     => Settings::default_template(),
    99                                 'description' => __( 'Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out.', 'elementarno-ukraine-for-woocommerce' ),
     99                                'description' => __( 'Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {delivery_point} (Nova Poshta branch or Ukrposhta post office), {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out.', 'elementarno-ukraine-for-woocommerce' ),
    100100                        ),
    101101                        'template_default'       => array(
    … …  
    168168                                        <?php esc_html_e( 'Use the default template', 'elementarno-ukraine-for-woocommerce' ); ?>
    169169                                </button>
    170                                 <p class="description"><?php esc_html_e( 'Replaces the text above with the current default: customer, items, totals with delivery and fees, branch or address, your fields and the comment. Then save.', 'elementarno-ukraine-for-woocommerce' ); ?></p>
     170                                <p class="description"><?php esc_html_e( 'Replaces the text above with the current default: customer, items, totals with delivery and fees, delivery point or address, your fields and the comment. Then save.', 'elementarno-ukraine-for-woocommerce' ); ?></p>
    171171                        </td>
    172172                </tr>
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Integrations/Telegram/Notifier.php

    r3780183 r3780266  
    1616use Elementarno\ELMWoo\Core\Integrations\Async;
    1717use Elementarno\ELMWoo\Core\Logger;
     18use Elementarno\ELMWoo\Core\Checkout\DeliveryPoint;
    1819use Elementarno\ELMWoo\Core\Orders\OrderFields;
    1920use Elementarno\ELMWoo\Modules\Integrations\Telegram\Api\Client;
    … …  
    637638
    638639                foreach ( $order->get_order_item_totals() as $key => $row ) {
    639                         // The Nova Poshta branch has its own placeholder, {np_branch}.
    640                         if ( 'elementarno_np_warehouse' === $key ) {
     640                        // The branch or post office has its own placeholder, {delivery_point}.
     641                        if ( in_array( $key, array( 'elementarno_np_warehouse', 'elementarno_up_office' ), true ) ) {
    641642                                continue;
    642643                        }
    … …  
    665666                $np_warehouse = (string) $order->get_meta( '_elementarno_np_warehouse' );
    666667                $np_branch    = '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '';
     668                $point        = DeliveryPoint::describe( $order );
    667669
    668670                $replacements = array(
    … …  
    678680                        '{shipping_method}' => self::escape( $order->get_shipping_method() ),
    679681                        '{np_branch}'       => self::escape( $np_branch ),
     682                        '{delivery_point}'  => self::escape( $point ),
    680683                        '{note}'            => self::escape( trim( $order->get_customer_note() ) ),
    681684                        '{order_url}'       => self::escape( $order->get_edit_order_url() ),
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Integrations/Telegram/Settings.php

    r3760347 r3780266  
    8484        public static function default_template(): string {
    8585                return __(
    86                         "<b>{event}: order {order_number}</b>\n{date}\n\n<b>Customer:</b> {customer}\n<b>Phone:</b> {phone}\n<b>E-mail:</b> {email}\n\n{items}\n\n{totals}\n\n<b>Branch:</b> {np_branch}\n<b>Address:</b> {address}\n{fields}\n<b>Comment:</b> {note}",
     86                        "<b>{event}: order {order_number}</b>\n{date}\n\n<b>Customer:</b> {customer}\n<b>Phone:</b> {phone}\n<b>E-mail:</b> {email}\n\n{items}\n\n{totals}\n\n<b>Delivery point:</b> {delivery_point}\n<b>Address:</b> {address}\n{fields}\n<b>Comment:</b> {note}",
    8787                        'elementarno-ukraine-for-woocommerce'
    8888                );
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Integrations/TurboSMS/Integration.php

    r3739414 r3780266  
    7979                                'css'         => 'height: 90px;',
    8080                                'default'     => Settings::default_template(),
    81                                 'description' => __( 'Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit.', 'elementarno-ukraine-for-woocommerce' ),
     81                                'description' => __( 'Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {delivery_point}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit.', 'elementarno-ukraine-for-woocommerce' ),
    8282                        ),
    8383                        'test'         => array(
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Integrations/TurboSMS/Notifier.php

    r3754700 r3780266  
    116116                        Settings::template(),
    117117                        array(
    118                                 '{site}'         => wp_strip_all_tags( get_bloginfo( 'name' ) ),
    119                                 '{order_number}' => $order->get_order_number(),
    120                                 '{status}'       => wc_get_order_status_name( $status ),
    121                                 '{total}'        => html_entity_decode( wp_strip_all_tags( wc_price( (float) $order->get_total(), array( 'currency' => $order->get_currency() ) ) ) ),
    122                                 '{customer}'     => trim( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ),
    123                                 '{np_branch}'    => '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '',
     118                                '{site}'           => wp_strip_all_tags( get_bloginfo( 'name' ) ),
     119                                '{order_number}'   => $order->get_order_number(),
     120                                '{status}'         => wc_get_order_status_name( $status ),
     121                                '{total}'          => html_entity_decode( wp_strip_all_tags( wc_price( (float) $order->get_total(), array( 'currency' => $order->get_currency() ) ) ) ),
     122                                '{customer}'       => trim( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ),
     123                                '{np_branch}'      => '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '',
     124                                '{delivery_point}' => \Elementarno\ELMWoo\Core\Checkout\DeliveryPoint::describe( $order ),
    124125                        )
    125126                );
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Shipping/NovaPoshta/Checkout.php

    r3780183 r3780266  
    2727
    2828use Elementarno\ELMWoo\Modules\Shipping\NovaPoshta\Db\Directory;
     29use Elementarno\ELMWoo\Core\Checkout\DeliveryPoint;
    2930use WC_Order;
    3031
    … …  
    4748         * @var array<int, string>
    4849         */
    49         /** WooCommerce's address fields that a branch delivery does not need. */
    50         private const ADDRESS_FIELDS = array( 'company', 'country', 'address_1', 'address_2', 'city', 'state', 'postcode' );
    51 
    52         private const KEPT_BILLING_FIELDS = array(
    53                 'billing_first_name',
    54                 'billing_last_name',
    55                 'billing_phone',
    56                 'billing_email',
    57         );
    58 
    5950        public function register(): void {
     51                // The shared part (hiding the street address, the optional fields,
     52                // the one script that toggles sections) is done once in the core.
     53                DeliveryPoint::register( ShippingMethod::METHOD_ID, array( self::class, 'describe' ) );
     54
    6055                // The picker hooks into the billing form itself — form-billing.php
    6156                // fires this in the default template AND in checkout-builder themes
    … …  
    6964                add_shortcode( 'elementarno_np_picker', array( $this, 'picker_shortcode' ) );
    7065                add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    71                 add_filter( 'woocommerce_checkout_fields', array( $this, 'relax_hidden_fields' ), 100 );
    7266                add_action( 'woocommerce_checkout_process', array( $this, 'validate' ) );
    7367                add_action( 'woocommerce_checkout_create_order', array( $this, 'save_to_order' ) );
    … …  
    8074         */
    8175        public static function is_chosen(): bool {
    82                 if ( ! function_exists( 'WC' ) || null === WC()->session ) {
    83                         return false;
    84                 }
    85 
    86                 // While the checkout form is being submitted, the method the customer
    87                 // sees is the one in the POST; WooCommerce copies it to the session
    88                 // only after validation has run.
    89                 // phpcs:disable WordPress.Security.NonceVerification.Missing -- Read-only: decides which fields to validate; WooCommerce verifies the checkout nonce itself.
    90                 $posted = isset( $_POST['shipping_method'] ) ? wp_unslash( $_POST['shipping_method'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Compared by prefix below.
    91                 // phpcs:enable
    92 
    93                 $chosen = null !== $posted
    94                         ? array_map( 'sanitize_text_field', is_array( $posted ) ? $posted : array( (string) $posted ) )
    95                         : (array) WC()->session->get( 'chosen_shipping_methods', array() );
    96 
    97                 foreach ( $chosen as $rate_id ) {
    98                         if ( str_starts_with( (string) $rate_id, ShippingMethod::METHOD_ID ) ) {
    99                                 return true;
    100                         }
    101                 }
    102 
    103                 return false;
     76                return DeliveryPoint::is_chosen( ShippingMethod::METHOD_ID );
     77        }
     78
     79        /**
     80         * The branch of an order in one line, '' when it was not a Nova Poshta order.
     81         */
     82        public static function describe( WC_Order $order ): string {
     83                $city      = (string) $order->get_meta( self::META_CITY );
     84                $warehouse = (string) $order->get_meta( self::META_WAREHOUSE );
     85
     86                return '' !== $warehouse ? trim( $city . ', ' . $warehouse ) : '';
    10487        }
    10588
    … …  
    11497                // otherwise our script can execute first and silently fall back to
    11598                // plain selects.
    116                 $deps = array( 'jquery', 'wc-checkout' );
     99                $deps = array( 'jquery', 'wc-checkout', 'elementarno-delivery-fields' );
    117100
    118101                if ( wp_script_is( 'selectWoo', 'registered' ) ) {
    … …  
    136119                        'elementarnoNpCheckout',
    137120                        array(
    138                                 'ajaxUrl'      => admin_url( 'admin-ajax.php' ),
    139                                 'nonce'        => wp_create_nonce( Ajax::NONCE_CHECKOUT ),
    140                                 'methodId'     => ShippingMethod::METHOD_ID,
    141                                 'hiddenFields' => $this->hidden_field_selectors(),
    142                                 'i18n'         => array(
     121                                'ajaxUrl'  => admin_url( 'admin-ajax.php' ),
     122                                'nonce'    => wp_create_nonce( Ajax::NONCE_CHECKOUT ),
     123                                'methodId' => ShippingMethod::METHOD_ID,
     124                                'i18n'     => array(
    143125                                        'cityPlaceholder'      => __( 'Start typing your city…', 'elementarno-ukraine-for-woocommerce' ),
    144126                                        'warehousePlaceholder' => __( 'Branch number, street or parcel locker…', 'elementarno-ukraine-for-woocommerce' ),
    … …  
    199181
    200182                ?>
    201                 <div class="elm-np-section" data-elm-np <?php echo $visible ? '' : 'style="display:none"'; ?>>
     183                <div class="elm-np-section elm-delivery-section" data-elm-np data-elm-method="<?php echo esc_attr( ShippingMethod::METHOD_ID ); ?>" <?php echo $visible ? '' : 'style="display:none"'; ?>>
    202184                        <h2><?php esc_html_e( 'Nova Poshta branch', 'elementarno-ukraine-for-woocommerce' ); ?></h2>
    203185                        <p class="form-row form-row-wide elm-np-section__row">
    … …  
    222204
    223205        /**
    224          * While Nova Poshta is chosen the address fields are hidden client-side,
    225          * so they must stop being required server-side; only name, phone and
    226          * email keep validating.
    227          *
    228          * @param array<string, array<string, mixed>> $fields Checkout fields.
    229          *
    230          * @return array<string, array<string, mixed>>
    231          */
    232         public function relax_hidden_fields( array $fields ): array {
    233                 if ( ! self::is_chosen() ) {
    234                         return $fields;
    235                 }
    236 
    237                 // Only WooCommerce's own address fields are relaxed: the branch
    238                 // replaces the street address, not a consent box or a patronymic
    239                 // that another plugin or the theme made required.
    240                 foreach ( self::ADDRESS_FIELDS as $suffix ) {
    241                         if ( isset( $fields['billing'][ 'billing_' . $suffix ] ) && ! in_array( 'billing_' . $suffix, self::KEPT_BILLING_FIELDS, true ) ) {
    242                                 $fields['billing'][ 'billing_' . $suffix ]['required'] = false;
    243                         }
    244 
    245                         if ( isset( $fields['shipping'][ 'shipping_' . $suffix ] ) ) {
    246                                 $fields['shipping'][ 'shipping_' . $suffix ]['required'] = false;
    247                         }
    248                 }
    249 
    250                 return $fields;
    251         }
    252 
    253         /**
    254          * CSS selectors of the checkout rows JS hides while Nova Poshta is chosen.
    255          *
    256          * @return array<int, string>
    257          */
    258         private function hidden_field_selectors(): array {
    259                 $ids = array(
    260                         '#billing_company_field',
    261                         '#billing_country_field',
    262                         '#billing_address_1_field',
    263                         '#billing_address_2_field',
    264                         '#billing_city_field',
    265                         '#billing_state_field',
    266                         '#billing_postcode_field',
    267                         '.woocommerce-shipping-fields',
    268                 );
    269 
    270                 /**
    271                  * Filters the checkout selectors hidden while Nova Poshta delivery
    272                  * is selected — themes with custom checkout fields can extend it.
    273                  *
    274                  * @param array<int, string> $ids CSS selectors.
    275                  */
    276                 return (array) apply_filters( 'elementarno_np_hidden_checkout_fields', $ids );
    277         }
    278 
    279         /**
    280206         * Refuse checkout until a real warehouse of a real city is picked.
    281207         */
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Shipping/Ukrposhta/Module.php

    r3739414 r3780266  
    3636        public function boot(): void {
    3737                add_filter( 'woocommerce_shipping_methods', array( $this, 'register_method' ) );
     38
     39                ( new Checkout() )->register();
    3840        }
    3941
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/includes/Modules/Shipping/Ukrposhta/ShippingMethod.php

    r3739414 r3780266  
    3333                $this->instance_id        = absint( $instance_id );
    3434                $this->method_title       = __( 'Ukrposhta (ELEMENTARNO)', 'elementarno-ukraine-for-woocommerce' );
    35                 $this->method_description = __( 'Delivery by Ukrposhta to the post office serving the customer\'s city and postcode.', 'elementarno-ukraine-for-woocommerce' );
     35                $this->method_description = __( 'Delivery by Ukrposhta to the post office of the customer\'s postcode. At checkout the customer gives the region, the city and the postcode instead of a street address.', 'elementarno-ukraine-for-woocommerce' );
    3636                $this->supports           = array( 'shipping-zones', 'instance-settings', 'instance-settings-modal' );
    3737
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/languages/elementarno-ukraine-for-woocommerce.pot

    r3780183 r3780266  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ELEMENTARNO Ukraine for WooCommerce 2.7.3\n"
     5"Project-Id-Version: ELEMENTARNO Ukraine for WooCommerce 2.8.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elementarno-ukraine-for-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-11-02T15:28:58+00:00\n"
     12"POT-Creation-Date: 2026-11-02T16:08:44+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    140140#: includes/Core/ModuleManifest.php:174
    141141#: includes/Core/ModuleManifest.php:175
    142 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:398
     142#: includes/Modules/Shipping/NovaPoshta/Checkout.php:324
    143143#: includes/Modules/Shipping/NovaPoshta/Settings.php:66
    144144#: includes/Modules/Shipping/NovaPoshta/Settings.php:86
    … …  
    154154#: includes/Core/ModuleManifest.php:179
    155155#: includes/Core/ModuleManifest.php:180
     156#: includes/Modules/Shipping/Ukrposhta/Checkout.php:257
    156157#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:41
    157158#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:51
    … …  
    223224msgstr ""
    224225
    225 #: includes/Core/Orders/OrderFields.php:201
     226#: includes/Core/Orders/OrderFields.php:204
    226227msgid "yes"
    227228msgstr ""
    228229
    229 #: includes/Core/Orders/OrderFields.php:201
     230#: includes/Core/Orders/OrderFields.php:204
    230231msgid "no"
    231232msgstr ""
    … …  
    856857
    857858#: includes/Modules/Integrations/Telegram/Integration.php:99
    858 msgid "Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out."
     859msgid "Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {delivery_point} (Nova Poshta branch or Ukrposhta post office), {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out."
    859860msgstr ""
    860861
    … …  
    904905
    905906#: includes/Modules/Integrations/Telegram/Integration.php:170
    906 msgid "Replaces the text above with the current default: customer, items, totals with delivery and fees, branch or address, your fields and the comment. Then save."
     907msgid "Replaces the text above with the current default: customer, items, totals with delivery and fees, delivery point or address, your fields and the comment. Then save."
    907908msgstr ""
    908909
    … …  
    952953
    953954#. translators: %s: event name.
    954 #: includes/Modules/Integrations/Telegram/Notifier.php:341
     955#: includes/Modules/Integrations/Telegram/Notifier.php:342
    955956#, php-format
    956957msgid "Telegram message \"%s\" could not be sent: Telegram was unreachable for several attempts."
    957958msgstr ""
    958959
    959 #: includes/Modules/Integrations/Telegram/Notifier.php:452
     960#: includes/Modules/Integrations/Telegram/Notifier.php:453
    960961msgid "paid"
    961962msgstr ""
    962963
    963 #: includes/Modules/Integrations/Telegram/Notifier.php:460
     964#: includes/Modules/Integrations/Telegram/Notifier.php:461
    964965msgid "awaiting payment"
    965966msgstr ""
    966967
    967 #: includes/Modules/Integrations/Telegram/Notifier.php:464
     968#: includes/Modules/Integrations/Telegram/Notifier.php:465
    968969msgid "payment failed"
    969970msgstr ""
    970971
    971 #: includes/Modules/Integrations/Telegram/Notifier.php:468
     972#: includes/Modules/Integrations/Telegram/Notifier.php:469
    972973msgid "not paid"
    973974msgstr ""
    974975
    975 #: includes/Modules/Integrations/Telegram/Notifier.php:484
     976#: includes/Modules/Integrations/Telegram/Notifier.php:485
    976977msgid "New order"
    977978msgstr ""
    978979
    979 #: includes/Modules/Integrations/Telegram/Notifier.php:488
     980#: includes/Modules/Integrations/Telegram/Notifier.php:489
    980981msgid "Not paid"
    981982msgstr ""
    982983
    983 #: includes/Modules/Integrations/Telegram/Notifier.php:490
     984#: includes/Modules/Integrations/Telegram/Notifier.php:491
    984985msgid "payment not finished"
    985986msgstr ""
    986987
    987 #: includes/Modules/Integrations/Telegram/Notifier.php:495
     988#: includes/Modules/Integrations/Telegram/Notifier.php:496
    988989msgid "Order paid"
    989990msgstr ""
    990991
    991 #: includes/Modules/Integrations/Telegram/Notifier.php:498
     992#: includes/Modules/Integrations/Telegram/Notifier.php:499
    992993msgid "Status changed"
    993994msgstr ""
    994995
    995996#. translators: %s: order number.
    996 #: includes/Modules/Integrations/Telegram/Notifier.php:517
     997#: includes/Modules/Integrations/Telegram/Notifier.php:518
    997998#, php-format
    998999msgid "✅ <b>Order %s is paid</b>"
    … …  
    10001001
    10011002#. translators: %s: order number.
    1002 #: includes/Modules/Integrations/Telegram/Notifier.php:527
     1003#: includes/Modules/Integrations/Telegram/Notifier.php:528
    10031004#, php-format
    10041005msgid "⚠️ <b>Order %s is still not paid</b>"
    10051006msgstr ""
    10061007
    1007 #: includes/Modules/Integrations/Telegram/Notifier.php:531
     1008#: includes/Modules/Integrations/Telegram/Notifier.php:532
    10081009msgid "The payment failed."
    10091010msgstr ""
    10101011
    1011 #: includes/Modules/Integrations/Telegram/Notifier.php:532
     1012#: includes/Modules/Integrations/Telegram/Notifier.php:533
    10121013msgid "The payment was not finished."
    10131014msgstr ""
    10141015
    10151016#. translators: %s: customer name and phone.
    1016 #: includes/Modules/Integrations/Telegram/Notifier.php:540
     1017#: includes/Modules/Integrations/Telegram/Notifier.php:541
    10171018#, php-format
    10181019msgid "Customer: %s"
    10191020msgstr ""
    10201021
    1021 #: includes/Modules/Integrations/Telegram/Notifier.php:575
     1022#: includes/Modules/Integrations/Telegram/Notifier.php:576
    10221023msgid "Open order"
    10231024msgstr ""
    … …  
    10361037"{totals}\n"
    10371038"\n"
    1038 "<b>Branch:</b> {np_branch}\n"
     1039"<b>Delivery point:</b> {delivery_point}\n"
    10391040"<b>Address:</b> {address}\n"
    10401041"{fields}\n"
    … …  
    11191120
    11201121#: includes/Modules/Integrations/TurboSMS/Integration.php:81
    1121 msgid "Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit."
     1122msgid "Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {delivery_point}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit."
    11221123msgstr ""
    11231124
    … …  
    17811782msgstr ""
    17821783
    1783 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:143
     1784#: includes/Modules/Shipping/NovaPoshta/Checkout.php:125
    17841785msgid "Start typing your city…"
    17851786msgstr ""
    17861787
    1787 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:144
     1788#: includes/Modules/Shipping/NovaPoshta/Checkout.php:126
    17881789msgid "Branch number, street or parcel locker…"
    17891790msgstr ""
    17901791
    1791 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:145
     1792#: includes/Modules/Shipping/NovaPoshta/Checkout.php:127
    17921793msgid "Searching…"
    17931794msgstr ""
    17941795
    1795 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:146
     1796#: includes/Modules/Shipping/NovaPoshta/Checkout.php:128
    17961797msgid "Nothing found"
    17971798msgstr ""
    17981799
    1799 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:202
     1800#: includes/Modules/Shipping/NovaPoshta/Checkout.php:184
    18001801msgid "Nova Poshta branch"
    18011802msgstr ""
    18021803
    1803 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:204
     1804#: includes/Modules/Shipping/NovaPoshta/Checkout.php:186
    18041805msgid "City"
    18051806msgstr ""
    18061807
    1807 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:204
    1808 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:212
     1808#: includes/Modules/Shipping/NovaPoshta/Checkout.php:186
     1809#: includes/Modules/Shipping/NovaPoshta/Checkout.php:194
     1810#: includes/Modules/Shipping/Ukrposhta/Checkout.php:130
     1811#: includes/Modules/Shipping/Ukrposhta/Checkout.php:139
     1812#: includes/Modules/Shipping/Ukrposhta/Checkout.php:143
    18091813msgid "required"
    18101814msgstr ""
    18111815
    1812 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:212
     1816#: includes/Modules/Shipping/NovaPoshta/Checkout.php:194
    18131817msgid "Branch or parcel locker"
    18141818msgstr ""
    18151819
    1816 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:308
     1820#: includes/Modules/Shipping/NovaPoshta/Checkout.php:234
    18171821msgid "Please choose a Nova Poshta city and branch for delivery."
    18181822msgstr ""
    18191823
    1820 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:369
     1824#: includes/Modules/Shipping/NovaPoshta/Checkout.php:295
    18211825msgid "Nova Poshta branch:"
    18221826msgstr ""
    … …  
    19521956msgstr ""
    19531957
     1958#: includes/Modules/Shipping/Ukrposhta/Checkout.php:83
     1959msgid "Kyiv"
     1960msgstr ""
     1961
     1962#: includes/Modules/Shipping/Ukrposhta/Checkout.php:84
     1963msgid "Vinnytsia region"
     1964msgstr ""
     1965
     1966#: includes/Modules/Shipping/Ukrposhta/Checkout.php:85
     1967msgid "Volyn region"
     1968msgstr ""
     1969
     1970#: includes/Modules/Shipping/Ukrposhta/Checkout.php:86
     1971msgid "Dnipropetrovsk region"
     1972msgstr ""
     1973
     1974#: includes/Modules/Shipping/Ukrposhta/Checkout.php:87
     1975msgid "Donetsk region"
     1976msgstr ""
     1977
     1978#: includes/Modules/Shipping/Ukrposhta/Checkout.php:88
     1979msgid "Zhytomyr region"
     1980msgstr ""
     1981
     1982#: includes/Modules/Shipping/Ukrposhta/Checkout.php:89
     1983msgid "Zakarpattia region"
     1984msgstr ""
     1985
     1986#: includes/Modules/Shipping/Ukrposhta/Checkout.php:90
     1987msgid "Zaporizhzhia region"
     1988msgstr ""
     1989
     1990#: includes/Modules/Shipping/Ukrposhta/Checkout.php:91
     1991msgid "Ivano-Frankivsk region"
     1992msgstr ""
     1993
     1994#: includes/Modules/Shipping/Ukrposhta/Checkout.php:92
     1995msgid "Kyiv region"
     1996msgstr ""
     1997
     1998#: includes/Modules/Shipping/Ukrposhta/Checkout.php:93
     1999msgid "Kirovohrad region"
     2000msgstr ""
     2001
     2002#: includes/Modules/Shipping/Ukrposhta/Checkout.php:94
     2003msgid "Luhansk region"
     2004msgstr ""
     2005
     2006#: includes/Modules/Shipping/Ukrposhta/Checkout.php:95
     2007msgid "Lviv region"
     2008msgstr ""
     2009
     2010#: includes/Modules/Shipping/Ukrposhta/Checkout.php:96
     2011msgid "Mykolaiv region"
     2012msgstr ""
     2013
     2014#: includes/Modules/Shipping/Ukrposhta/Checkout.php:97
     2015msgid "Odesa region"
     2016msgstr ""
     2017
     2018#: includes/Modules/Shipping/Ukrposhta/Checkout.php:98
     2019msgid "Poltava region"
     2020msgstr ""
     2021
     2022#: includes/Modules/Shipping/Ukrposhta/Checkout.php:99
     2023msgid "Rivne region"
     2024msgstr ""
     2025
     2026#: includes/Modules/Shipping/Ukrposhta/Checkout.php:100
     2027msgid "Sumy region"
     2028msgstr ""
     2029
     2030#: includes/Modules/Shipping/Ukrposhta/Checkout.php:101
     2031msgid "Ternopil region"
     2032msgstr ""
     2033
     2034#: includes/Modules/Shipping/Ukrposhta/Checkout.php:102
     2035msgid "Kharkiv region"
     2036msgstr ""
     2037
     2038#: includes/Modules/Shipping/Ukrposhta/Checkout.php:103
     2039msgid "Kherson region"
     2040msgstr ""
     2041
     2042#: includes/Modules/Shipping/Ukrposhta/Checkout.php:104
     2043msgid "Khmelnytskyi region"
     2044msgstr ""
     2045
     2046#: includes/Modules/Shipping/Ukrposhta/Checkout.php:105
     2047msgid "Cherkasy region"
     2048msgstr ""
     2049
     2050#: includes/Modules/Shipping/Ukrposhta/Checkout.php:106
     2051msgid "Chernivtsi region"
     2052msgstr ""
     2053
     2054#: includes/Modules/Shipping/Ukrposhta/Checkout.php:107
     2055msgid "Chernihiv region"
     2056msgstr ""
     2057
     2058#: includes/Modules/Shipping/Ukrposhta/Checkout.php:108
     2059msgid "Autonomous Republic of Crimea"
     2060msgstr ""
     2061
     2062#: includes/Modules/Shipping/Ukrposhta/Checkout.php:128
     2063msgid "Ukrposhta delivery"
     2064msgstr ""
     2065
     2066#: includes/Modules/Shipping/Ukrposhta/Checkout.php:130
     2067msgid "Region"
     2068msgstr ""
     2069
     2070#: includes/Modules/Shipping/Ukrposhta/Checkout.php:132
     2071msgid "Choose a region…"
     2072msgstr ""
     2073
     2074#: includes/Modules/Shipping/Ukrposhta/Checkout.php:139
     2075msgid "City or village"
     2076msgstr ""
     2077
     2078#: includes/Modules/Shipping/Ukrposhta/Checkout.php:143
     2079msgid "Postcode"
     2080msgstr ""
     2081
     2082#. translators: %s: link to the Ukrposhta postcode directory.
     2083#: includes/Modules/Shipping/Ukrposhta/Checkout.php:151
     2084#, php-format
     2085msgid "The parcel goes to the post office of your postcode. Do not know it? %s"
     2086msgstr ""
     2087
     2088#: includes/Modules/Shipping/Ukrposhta/Checkout.php:152
     2089msgid "Look it up on the Ukrposhta site"
     2090msgstr ""
     2091
     2092#: includes/Modules/Shipping/Ukrposhta/Checkout.php:187
     2093msgid "Please choose the region for Ukrposhta delivery."
     2094msgstr ""
     2095
     2096#: includes/Modules/Shipping/Ukrposhta/Checkout.php:191
     2097msgid "Please enter the city or village for Ukrposhta delivery."
     2098msgstr ""
     2099
     2100#: includes/Modules/Shipping/Ukrposhta/Checkout.php:195
     2101msgid "Please enter the five-digit postcode of your post office for Ukrposhta delivery."
     2102msgstr ""
     2103
     2104#: includes/Modules/Shipping/Ukrposhta/Checkout.php:232
     2105msgid "Ukrposhta post office:"
     2106msgstr ""
     2107
    19542108#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:34
    19552109msgid "Ukrposhta (ELEMENTARNO)"
    … …  
    19572111
    19582112#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:35
    1959 msgid "Delivery by Ukrposhta to the post office serving the customer's city and postcode."
     2113msgid "Delivery by Ukrposhta to the post office of the customer's postcode. At checkout the customer gives the region, the city and the postcode instead of a street address."
    19602114msgstr ""
    19612115
  • elementarno-ukraine-for-woocommerce/tags/2.8.0/readme.txt

    r3780183 r3780266  
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 2.7.3
     7Stable tag: 2.8.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    2626
    2727* **Nova Poshta**: the customer picks a city and a branch or parcel locker with suggestions as they type. The directory is kept on your site, so checkout stays fast even when the Nova Poshta API is slow.
    28 * **Ukrposhta**: your own delivery price for every shipping zone.
     28* **Ukrposhta**: the customer gives the region, the city and the postcode of their post office instead of a street address; your own delivery price for every shipping zone.
    2929
    3030**Receipts and notifications**
    … …  
    141141
    142142== Changelog ==
     143
     144= 2.8.0 =
     145* Ukrposhta: the checkout now asks for what a Ukrposhta parcel needs, the region, the city and the five-digit postcode of the post office, with a link to the Ukrposhta postcode directory; the street-address fields are hidden, as with Nova Poshta. The post office is shown on the thank-you page, in e-mails, in the admin order and in Telegram and SMS messages ({delivery_point}).
     146* Nova Poshta and Ukrposhta share one mechanism for hiding the address fields, so the two methods no longer compete when a customer switches between them. The Nova Poshta filter `elementarno_np_hidden_checkout_fields` keeps working; the new name is `elementarno_delivery_hidden_checkout_fields`.
     147* Telegram, TurboSMS: new placeholder {delivery_point} (Nova Poshta branch or Ukrposhta post office); the default Telegram template uses it.
    143148
    144149= 2.7.3 =
  • elementarno-ukraine-for-woocommerce/trunk/assets/js/np-checkout.js

    r3754700 r3780266  
    33 *
    44 * The picker lives OUTSIDE the order-review fragment, so its DOM and values
    5  * survive WooCommerce's AJAX re-renders; only its visibility — and the
    6  * visibility of the billing address fields — depends on the chosen shipping
    7  * method, re-evaluated on every `updated_checkout`.
     5 * survive WooCommerce's AJAX re-renders. Its visibility, and that of the
     6 * billing address fields, is handled by delivery-fields.js, shared with the
     7 * other point-delivery carriers.
    88 *
    99 * Searchable dropdowns use the selectWoo build WooCommerce ships. Without it
    … …  
    2222        var config = window.elementarnoNpCheckout;
    2323        var hasSelectWoo = false; // decided at init time, not at parse time
    24 
    25         function isNpChosen() {
    26                 var chosen = $( 'input[name^="shipping_method"]:checked' );
    27 
    28                 if ( ! chosen.length ) {
    29                         // A zone with a single method renders a hidden input instead.
    30                         chosen = $( 'input[name^="shipping_method"][type="hidden"]' );
    31                 }
    32 
    33                 var found = false;
    34 
    35                 chosen.each( function () {
    36                         if ( String( $( this ).val() ).indexOf( config.methodId ) === 0 ) {
    37                                 found = true;
    38                         }
    39                 } );
    40 
    41                 return found;
    42         }
    43 
    44         function toggle() {
    45                 var active = isNpChosen();
    46 
    47                 $( '[data-elm-np]' ).toggle( active );
    48 
    49                 $.each( config.hiddenFields, function ( _, selector ) {
    50                         $( selector ).toggle( ! active );
    51                 } );
    52         }
    5324
    5425        function enhance( $select, options ) {
    … …  
    12899
    129100                if ( ! $root.length || $root.data( 'elmNpReady' ) ) {
    130                         toggle();
    131101                        return;
    132102                }
    … …  
    212182                        rememberSelection( $root );
    213183                } );
    214 
    215                 toggle();
    216184        }
    217185
    218186        $( document ).ready( init );
    219187        $( document.body ).on( 'updated_checkout', init );
    220         $( document.body ).on( 'change', 'input[name^="shipping_method"]', toggle );
    221188} )( window.jQuery );
  • elementarno-ukraine-for-woocommerce/trunk/elementarno-ukraine-for-woocommerce.php

    r3780183 r3780266  
    44 * Plugin URI:           https://elementarno.codes/elementarno-ukraine-for-woocommerce/
    55 * Description:          Connect the most popular Ukrainian services to WooCommerce: payments, shipping and integrations, each an independent module you can switch off.
    6  * Version:              2.7.3
     6 * Version:              2.8.0
    77 * Requires at least:    6.2
    88 * Requires PHP:         8.0
    … …  
    2424defined( 'ABSPATH' ) || exit;
    2525
    26 const ELEMENTARNO_UA_VERSION = '2.7.3';
     26const ELEMENTARNO_UA_VERSION = '2.8.0';
    2727
    2828define( 'ELEMENTARNO_UA_FILE', __FILE__ );
  • elementarno-ukraine-for-woocommerce/trunk/includes/Core/Orders/OrderFields.php

    r3754700 r3780266  
    3939                '_elementarno_np_city',
    4040                '_elementarno_np_warehouse',
     41                '_elementarno_up_region',
     42                '_elementarno_up_city',
     43                '_elementarno_up_postcode',
    4144                '_elementarno_checkbox_receipt_url',
    4245        );
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Integrations/Telegram/Integration.php

    r3760347 r3780266  
    9797                                'css'         => 'height: 160px;',
    9898                                'default'     => Settings::default_template(),
    99                                 'description' => __( 'Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out.', 'elementarno-ukraine-for-woocommerce' ),
     99                                'description' => __( 'Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {delivery_point} (Nova Poshta branch or Ukrposhta post office), {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out.', 'elementarno-ukraine-for-woocommerce' ),
    100100                        ),
    101101                        'template_default'       => array(
    … …  
    168168                                        <?php esc_html_e( 'Use the default template', 'elementarno-ukraine-for-woocommerce' ); ?>
    169169                                </button>
    170                                 <p class="description"><?php esc_html_e( 'Replaces the text above with the current default: customer, items, totals with delivery and fees, branch or address, your fields and the comment. Then save.', 'elementarno-ukraine-for-woocommerce' ); ?></p>
     170                                <p class="description"><?php esc_html_e( 'Replaces the text above with the current default: customer, items, totals with delivery and fees, delivery point or address, your fields and the comment. Then save.', 'elementarno-ukraine-for-woocommerce' ); ?></p>
    171171                        </td>
    172172                </tr>
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Integrations/Telegram/Notifier.php

    r3780183 r3780266  
    1616use Elementarno\ELMWoo\Core\Integrations\Async;
    1717use Elementarno\ELMWoo\Core\Logger;
     18use Elementarno\ELMWoo\Core\Checkout\DeliveryPoint;
    1819use Elementarno\ELMWoo\Core\Orders\OrderFields;
    1920use Elementarno\ELMWoo\Modules\Integrations\Telegram\Api\Client;
    … …  
    637638
    638639                foreach ( $order->get_order_item_totals() as $key => $row ) {
    639                         // The Nova Poshta branch has its own placeholder, {np_branch}.
    640                         if ( 'elementarno_np_warehouse' === $key ) {
     640                        // The branch or post office has its own placeholder, {delivery_point}.
     641                        if ( in_array( $key, array( 'elementarno_np_warehouse', 'elementarno_up_office' ), true ) ) {
    641642                                continue;
    642643                        }
    … …  
    665666                $np_warehouse = (string) $order->get_meta( '_elementarno_np_warehouse' );
    666667                $np_branch    = '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '';
     668                $point        = DeliveryPoint::describe( $order );
    667669
    668670                $replacements = array(
    … …  
    678680                        '{shipping_method}' => self::escape( $order->get_shipping_method() ),
    679681                        '{np_branch}'       => self::escape( $np_branch ),
     682                        '{delivery_point}'  => self::escape( $point ),
    680683                        '{note}'            => self::escape( trim( $order->get_customer_note() ) ),
    681684                        '{order_url}'       => self::escape( $order->get_edit_order_url() ),
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Integrations/Telegram/Settings.php

    r3760347 r3780266  
    8484        public static function default_template(): string {
    8585                return __(
    86                         "<b>{event}: order {order_number}</b>\n{date}\n\n<b>Customer:</b> {customer}\n<b>Phone:</b> {phone}\n<b>E-mail:</b> {email}\n\n{items}\n\n{totals}\n\n<b>Branch:</b> {np_branch}\n<b>Address:</b> {address}\n{fields}\n<b>Comment:</b> {note}",
     86                        "<b>{event}: order {order_number}</b>\n{date}\n\n<b>Customer:</b> {customer}\n<b>Phone:</b> {phone}\n<b>E-mail:</b> {email}\n\n{items}\n\n{totals}\n\n<b>Delivery point:</b> {delivery_point}\n<b>Address:</b> {address}\n{fields}\n<b>Comment:</b> {note}",
    8787                        'elementarno-ukraine-for-woocommerce'
    8888                );
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Integrations/TurboSMS/Integration.php

    r3739414 r3780266  
    7979                                'css'         => 'height: 90px;',
    8080                                'default'     => Settings::default_template(),
    81                                 'description' => __( 'Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit.', 'elementarno-ukraine-for-woocommerce' ),
     81                                'description' => __( 'Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {delivery_point}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit.', 'elementarno-ukraine-for-woocommerce' ),
    8282                        ),
    8383                        'test'         => array(
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Integrations/TurboSMS/Notifier.php

    r3754700 r3780266  
    116116                        Settings::template(),
    117117                        array(
    118                                 '{site}'         => wp_strip_all_tags( get_bloginfo( 'name' ) ),
    119                                 '{order_number}' => $order->get_order_number(),
    120                                 '{status}'       => wc_get_order_status_name( $status ),
    121                                 '{total}'        => html_entity_decode( wp_strip_all_tags( wc_price( (float) $order->get_total(), array( 'currency' => $order->get_currency() ) ) ) ),
    122                                 '{customer}'     => trim( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ),
    123                                 '{np_branch}'    => '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '',
     118                                '{site}'           => wp_strip_all_tags( get_bloginfo( 'name' ) ),
     119                                '{order_number}'   => $order->get_order_number(),
     120                                '{status}'         => wc_get_order_status_name( $status ),
     121                                '{total}'          => html_entity_decode( wp_strip_all_tags( wc_price( (float) $order->get_total(), array( 'currency' => $order->get_currency() ) ) ) ),
     122                                '{customer}'       => trim( $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ),
     123                                '{np_branch}'      => '' !== $np_warehouse ? trim( $np_city . ', ' . $np_warehouse ) : '',
     124                                '{delivery_point}' => \Elementarno\ELMWoo\Core\Checkout\DeliveryPoint::describe( $order ),
    124125                        )
    125126                );
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Shipping/NovaPoshta/Checkout.php

    r3780183 r3780266  
    2727
    2828use Elementarno\ELMWoo\Modules\Shipping\NovaPoshta\Db\Directory;
     29use Elementarno\ELMWoo\Core\Checkout\DeliveryPoint;
    2930use WC_Order;
    3031
    … …  
    4748         * @var array<int, string>
    4849         */
    49         /** WooCommerce's address fields that a branch delivery does not need. */
    50         private const ADDRESS_FIELDS = array( 'company', 'country', 'address_1', 'address_2', 'city', 'state', 'postcode' );
    51 
    52         private const KEPT_BILLING_FIELDS = array(
    53                 'billing_first_name',
    54                 'billing_last_name',
    55                 'billing_phone',
    56                 'billing_email',
    57         );
    58 
    5950        public function register(): void {
     51                // The shared part (hiding the street address, the optional fields,
     52                // the one script that toggles sections) is done once in the core.
     53                DeliveryPoint::register( ShippingMethod::METHOD_ID, array( self::class, 'describe' ) );
     54
    6055                // The picker hooks into the billing form itself — form-billing.php
    6156                // fires this in the default template AND in checkout-builder themes
    … …  
    6964                add_shortcode( 'elementarno_np_picker', array( $this, 'picker_shortcode' ) );
    7065                add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    71                 add_filter( 'woocommerce_checkout_fields', array( $this, 'relax_hidden_fields' ), 100 );
    7266                add_action( 'woocommerce_checkout_process', array( $this, 'validate' ) );
    7367                add_action( 'woocommerce_checkout_create_order', array( $this, 'save_to_order' ) );
    … …  
    8074         */
    8175        public static function is_chosen(): bool {
    82                 if ( ! function_exists( 'WC' ) || null === WC()->session ) {
    83                         return false;
    84                 }
    85 
    86                 // While the checkout form is being submitted, the method the customer
    87                 // sees is the one in the POST; WooCommerce copies it to the session
    88                 // only after validation has run.
    89                 // phpcs:disable WordPress.Security.NonceVerification.Missing -- Read-only: decides which fields to validate; WooCommerce verifies the checkout nonce itself.
    90                 $posted = isset( $_POST['shipping_method'] ) ? wp_unslash( $_POST['shipping_method'] ) : null; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Compared by prefix below.
    91                 // phpcs:enable
    92 
    93                 $chosen = null !== $posted
    94                         ? array_map( 'sanitize_text_field', is_array( $posted ) ? $posted : array( (string) $posted ) )
    95                         : (array) WC()->session->get( 'chosen_shipping_methods', array() );
    96 
    97                 foreach ( $chosen as $rate_id ) {
    98                         if ( str_starts_with( (string) $rate_id, ShippingMethod::METHOD_ID ) ) {
    99                                 return true;
    100                         }
    101                 }
    102 
    103                 return false;
     76                return DeliveryPoint::is_chosen( ShippingMethod::METHOD_ID );
     77        }
     78
     79        /**
     80         * The branch of an order in one line, '' when it was not a Nova Poshta order.
     81         */
     82        public static function describe( WC_Order $order ): string {
     83                $city      = (string) $order->get_meta( self::META_CITY );
     84                $warehouse = (string) $order->get_meta( self::META_WAREHOUSE );
     85
     86                return '' !== $warehouse ? trim( $city . ', ' . $warehouse ) : '';
    10487        }
    10588
    … …  
    11497                // otherwise our script can execute first and silently fall back to
    11598                // plain selects.
    116                 $deps = array( 'jquery', 'wc-checkout' );
     99                $deps = array( 'jquery', 'wc-checkout', 'elementarno-delivery-fields' );
    117100
    118101                if ( wp_script_is( 'selectWoo', 'registered' ) ) {
    … …  
    136119                        'elementarnoNpCheckout',
    137120                        array(
    138                                 'ajaxUrl'      => admin_url( 'admin-ajax.php' ),
    139                                 'nonce'        => wp_create_nonce( Ajax::NONCE_CHECKOUT ),
    140                                 'methodId'     => ShippingMethod::METHOD_ID,
    141                                 'hiddenFields' => $this->hidden_field_selectors(),
    142                                 'i18n'         => array(
     121                                'ajaxUrl'  => admin_url( 'admin-ajax.php' ),
     122                                'nonce'    => wp_create_nonce( Ajax::NONCE_CHECKOUT ),
     123                                'methodId' => ShippingMethod::METHOD_ID,
     124                                'i18n'     => array(
    143125                                        'cityPlaceholder'      => __( 'Start typing your city…', 'elementarno-ukraine-for-woocommerce' ),
    144126                                        'warehousePlaceholder' => __( 'Branch number, street or parcel locker…', 'elementarno-ukraine-for-woocommerce' ),
    … …  
    199181
    200182                ?>
    201                 <div class="elm-np-section" data-elm-np <?php echo $visible ? '' : 'style="display:none"'; ?>>
     183                <div class="elm-np-section elm-delivery-section" data-elm-np data-elm-method="<?php echo esc_attr( ShippingMethod::METHOD_ID ); ?>" <?php echo $visible ? '' : 'style="display:none"'; ?>>
    202184                        <h2><?php esc_html_e( 'Nova Poshta branch', 'elementarno-ukraine-for-woocommerce' ); ?></h2>
    203185                        <p class="form-row form-row-wide elm-np-section__row">
    … …  
    222204
    223205        /**
    224          * While Nova Poshta is chosen the address fields are hidden client-side,
    225          * so they must stop being required server-side; only name, phone and
    226          * email keep validating.
    227          *
    228          * @param array<string, array<string, mixed>> $fields Checkout fields.
    229          *
    230          * @return array<string, array<string, mixed>>
    231          */
    232         public function relax_hidden_fields( array $fields ): array {
    233                 if ( ! self::is_chosen() ) {
    234                         return $fields;
    235                 }
    236 
    237                 // Only WooCommerce's own address fields are relaxed: the branch
    238                 // replaces the street address, not a consent box or a patronymic
    239                 // that another plugin or the theme made required.
    240                 foreach ( self::ADDRESS_FIELDS as $suffix ) {
    241                         if ( isset( $fields['billing'][ 'billing_' . $suffix ] ) && ! in_array( 'billing_' . $suffix, self::KEPT_BILLING_FIELDS, true ) ) {
    242                                 $fields['billing'][ 'billing_' . $suffix ]['required'] = false;
    243                         }
    244 
    245                         if ( isset( $fields['shipping'][ 'shipping_' . $suffix ] ) ) {
    246                                 $fields['shipping'][ 'shipping_' . $suffix ]['required'] = false;
    247                         }
    248                 }
    249 
    250                 return $fields;
    251         }
    252 
    253         /**
    254          * CSS selectors of the checkout rows JS hides while Nova Poshta is chosen.
    255          *
    256          * @return array<int, string>
    257          */
    258         private function hidden_field_selectors(): array {
    259                 $ids = array(
    260                         '#billing_company_field',
    261                         '#billing_country_field',
    262                         '#billing_address_1_field',
    263                         '#billing_address_2_field',
    264                         '#billing_city_field',
    265                         '#billing_state_field',
    266                         '#billing_postcode_field',
    267                         '.woocommerce-shipping-fields',
    268                 );
    269 
    270                 /**
    271                  * Filters the checkout selectors hidden while Nova Poshta delivery
    272                  * is selected — themes with custom checkout fields can extend it.
    273                  *
    274                  * @param array<int, string> $ids CSS selectors.
    275                  */
    276                 return (array) apply_filters( 'elementarno_np_hidden_checkout_fields', $ids );
    277         }
    278 
    279         /**
    280206         * Refuse checkout until a real warehouse of a real city is picked.
    281207         */
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Shipping/Ukrposhta/Module.php

    r3739414 r3780266  
    3636        public function boot(): void {
    3737                add_filter( 'woocommerce_shipping_methods', array( $this, 'register_method' ) );
     38
     39                ( new Checkout() )->register();
    3840        }
    3941
  • elementarno-ukraine-for-woocommerce/trunk/includes/Modules/Shipping/Ukrposhta/ShippingMethod.php

    r3739414 r3780266  
    3333                $this->instance_id        = absint( $instance_id );
    3434                $this->method_title       = __( 'Ukrposhta (ELEMENTARNO)', 'elementarno-ukraine-for-woocommerce' );
    35                 $this->method_description = __( 'Delivery by Ukrposhta to the post office serving the customer\'s city and postcode.', 'elementarno-ukraine-for-woocommerce' );
     35                $this->method_description = __( 'Delivery by Ukrposhta to the post office of the customer\'s postcode. At checkout the customer gives the region, the city and the postcode instead of a street address.', 'elementarno-ukraine-for-woocommerce' );
    3636                $this->supports           = array( 'shipping-zones', 'instance-settings', 'instance-settings-modal' );
    3737
  • elementarno-ukraine-for-woocommerce/trunk/languages/elementarno-ukraine-for-woocommerce.pot

    r3780183 r3780266  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: ELEMENTARNO Ukraine for WooCommerce 2.7.3\n"
     5"Project-Id-Version: ELEMENTARNO Ukraine for WooCommerce 2.8.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/elementarno-ukraine-for-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-11-02T15:28:58+00:00\n"
     12"POT-Creation-Date: 2026-11-02T16:08:44+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    140140#: includes/Core/ModuleManifest.php:174
    141141#: includes/Core/ModuleManifest.php:175
    142 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:398
     142#: includes/Modules/Shipping/NovaPoshta/Checkout.php:324
    143143#: includes/Modules/Shipping/NovaPoshta/Settings.php:66
    144144#: includes/Modules/Shipping/NovaPoshta/Settings.php:86
    … …  
    154154#: includes/Core/ModuleManifest.php:179
    155155#: includes/Core/ModuleManifest.php:180
     156#: includes/Modules/Shipping/Ukrposhta/Checkout.php:257
    156157#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:41
    157158#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:51
    … …  
    223224msgstr ""
    224225
    225 #: includes/Core/Orders/OrderFields.php:201
     226#: includes/Core/Orders/OrderFields.php:204
    226227msgid "yes"
    227228msgstr ""
    228229
    229 #: includes/Core/Orders/OrderFields.php:201
     230#: includes/Core/Orders/OrderFields.php:204
    230231msgid "no"
    231232msgstr ""
    … …  
    856857
    857858#: includes/Modules/Integrations/Telegram/Integration.php:99
    858 msgid "Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out."
     859msgid "Telegram HTML plus placeholders. Order: {event}, {order_number}, {status}, {payment_status} (paid, awaiting payment, payment failed; empty for cash on delivery), {date}, {site}, {order_url} (link to the order in the admin). Customer: {customer}, {phone}, {email}, {note} (comment). Items and money: {items}, {totals} (subtotal, discount, delivery, fees, payment method and total, as in the WooCommerce e-mails), {fees}, {total}, {payment_method}. Delivery: {shipping_method}, {delivery_point} (Nova Poshta branch or Ukrposhta post office), {np_branch}, {address}. Your fields: {fields} (the extra fields below), {meta:key} (any single order field). A line whose placeholders all come out empty is left out."
    859860msgstr ""
    860861
    … …  
    904905
    905906#: includes/Modules/Integrations/Telegram/Integration.php:170
    906 msgid "Replaces the text above with the current default: customer, items, totals with delivery and fees, branch or address, your fields and the comment. Then save."
     907msgid "Replaces the text above with the current default: customer, items, totals with delivery and fees, delivery point or address, your fields and the comment. Then save."
    907908msgstr ""
    908909
    … …  
    952953
    953954#. translators: %s: event name.
    954 #: includes/Modules/Integrations/Telegram/Notifier.php:341
     955#: includes/Modules/Integrations/Telegram/Notifier.php:342
    955956#, php-format
    956957msgid "Telegram message \"%s\" could not be sent: Telegram was unreachable for several attempts."
    957958msgstr ""
    958959
    959 #: includes/Modules/Integrations/Telegram/Notifier.php:452
     960#: includes/Modules/Integrations/Telegram/Notifier.php:453
    960961msgid "paid"
    961962msgstr ""
    962963
    963 #: includes/Modules/Integrations/Telegram/Notifier.php:460
     964#: includes/Modules/Integrations/Telegram/Notifier.php:461
    964965msgid "awaiting payment"
    965966msgstr ""
    966967
    967 #: includes/Modules/Integrations/Telegram/Notifier.php:464
     968#: includes/Modules/Integrations/Telegram/Notifier.php:465
    968969msgid "payment failed"
    969970msgstr ""
    970971
    971 #: includes/Modules/Integrations/Telegram/Notifier.php:468
     972#: includes/Modules/Integrations/Telegram/Notifier.php:469
    972973msgid "not paid"
    973974msgstr ""
    974975
    975 #: includes/Modules/Integrations/Telegram/Notifier.php:484
     976#: includes/Modules/Integrations/Telegram/Notifier.php:485
    976977msgid "New order"
    977978msgstr ""
    978979
    979 #: includes/Modules/Integrations/Telegram/Notifier.php:488
     980#: includes/Modules/Integrations/Telegram/Notifier.php:489
    980981msgid "Not paid"
    981982msgstr ""
    982983
    983 #: includes/Modules/Integrations/Telegram/Notifier.php:490
     984#: includes/Modules/Integrations/Telegram/Notifier.php:491
    984985msgid "payment not finished"
    985986msgstr ""
    986987
    987 #: includes/Modules/Integrations/Telegram/Notifier.php:495
     988#: includes/Modules/Integrations/Telegram/Notifier.php:496
    988989msgid "Order paid"
    989990msgstr ""
    990991
    991 #: includes/Modules/Integrations/Telegram/Notifier.php:498
     992#: includes/Modules/Integrations/Telegram/Notifier.php:499
    992993msgid "Status changed"
    993994msgstr ""
    994995
    995996#. translators: %s: order number.
    996 #: includes/Modules/Integrations/Telegram/Notifier.php:517
     997#: includes/Modules/Integrations/Telegram/Notifier.php:518
    997998#, php-format
    998999msgid "✅ <b>Order %s is paid</b>"
    … …  
    10001001
    10011002#. translators: %s: order number.
    1002 #: includes/Modules/Integrations/Telegram/Notifier.php:527
     1003#: includes/Modules/Integrations/Telegram/Notifier.php:528
    10031004#, php-format
    10041005msgid "⚠️ <b>Order %s is still not paid</b>"
    10051006msgstr ""
    10061007
    1007 #: includes/Modules/Integrations/Telegram/Notifier.php:531
     1008#: includes/Modules/Integrations/Telegram/Notifier.php:532
    10081009msgid "The payment failed."
    10091010msgstr ""
    10101011
    1011 #: includes/Modules/Integrations/Telegram/Notifier.php:532
     1012#: includes/Modules/Integrations/Telegram/Notifier.php:533
    10121013msgid "The payment was not finished."
    10131014msgstr ""
    10141015
    10151016#. translators: %s: customer name and phone.
    1016 #: includes/Modules/Integrations/Telegram/Notifier.php:540
     1017#: includes/Modules/Integrations/Telegram/Notifier.php:541
    10171018#, php-format
    10181019msgid "Customer: %s"
    10191020msgstr ""
    10201021
    1021 #: includes/Modules/Integrations/Telegram/Notifier.php:575
     1022#: includes/Modules/Integrations/Telegram/Notifier.php:576
    10221023msgid "Open order"
    10231024msgstr ""
    … …  
    10361037"{totals}\n"
    10371038"\n"
    1038 "<b>Branch:</b> {np_branch}\n"
     1039"<b>Delivery point:</b> {delivery_point}\n"
    10391040"<b>Address:</b> {address}\n"
    10401041"{fields}\n"
    … …  
    11191120
    11201121#: includes/Modules/Integrations/TurboSMS/Integration.php:81
    1121 msgid "Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit."
     1122msgid "Plain text. Placeholders: {site}, {order_number}, {status}, {total}, {customer}, {delivery_point}, {np_branch}. Keep SMS under 160 Latin / 70 Cyrillic characters per credit."
    11221123msgstr ""
    11231124
    … …  
    17811782msgstr ""
    17821783
    1783 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:143
     1784#: includes/Modules/Shipping/NovaPoshta/Checkout.php:125
    17841785msgid "Start typing your city…"
    17851786msgstr ""
    17861787
    1787 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:144
     1788#: includes/Modules/Shipping/NovaPoshta/Checkout.php:126
    17881789msgid "Branch number, street or parcel locker…"
    17891790msgstr ""
    17901791
    1791 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:145
     1792#: includes/Modules/Shipping/NovaPoshta/Checkout.php:127
    17921793msgid "Searching…"
    17931794msgstr ""
    17941795
    1795 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:146
     1796#: includes/Modules/Shipping/NovaPoshta/Checkout.php:128
    17961797msgid "Nothing found"
    17971798msgstr ""
    17981799
    1799 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:202
     1800#: includes/Modules/Shipping/NovaPoshta/Checkout.php:184
    18001801msgid "Nova Poshta branch"
    18011802msgstr ""
    18021803
    1803 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:204
     1804#: includes/Modules/Shipping/NovaPoshta/Checkout.php:186
    18041805msgid "City"
    18051806msgstr ""
    18061807
    1807 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:204
    1808 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:212
     1808#: includes/Modules/Shipping/NovaPoshta/Checkout.php:186
     1809#: includes/Modules/Shipping/NovaPoshta/Checkout.php:194
     1810#: includes/Modules/Shipping/Ukrposhta/Checkout.php:130
     1811#: includes/Modules/Shipping/Ukrposhta/Checkout.php:139
     1812#: includes/Modules/Shipping/Ukrposhta/Checkout.php:143
    18091813msgid "required"
    18101814msgstr ""
    18111815
    1812 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:212
     1816#: includes/Modules/Shipping/NovaPoshta/Checkout.php:194
    18131817msgid "Branch or parcel locker"
    18141818msgstr ""
    18151819
    1816 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:308
     1820#: includes/Modules/Shipping/NovaPoshta/Checkout.php:234
    18171821msgid "Please choose a Nova Poshta city and branch for delivery."
    18181822msgstr ""
    18191823
    1820 #: includes/Modules/Shipping/NovaPoshta/Checkout.php:369
     1824#: includes/Modules/Shipping/NovaPoshta/Checkout.php:295
    18211825msgid "Nova Poshta branch:"
    18221826msgstr ""
    … …  
    19521956msgstr ""
    19531957
     1958#: includes/Modules/Shipping/Ukrposhta/Checkout.php:83
     1959msgid "Kyiv"
     1960msgstr ""
     1961
     1962#: includes/Modules/Shipping/Ukrposhta/Checkout.php:84
     1963msgid "Vinnytsia region"
     1964msgstr ""
     1965
     1966#: includes/Modules/Shipping/Ukrposhta/Checkout.php:85
     1967msgid "Volyn region"
     1968msgstr ""
     1969
     1970#: includes/Modules/Shipping/Ukrposhta/Checkout.php:86
     1971msgid "Dnipropetrovsk region"
     1972msgstr ""
     1973
     1974#: includes/Modules/Shipping/Ukrposhta/Checkout.php:87
     1975msgid "Donetsk region"
     1976msgstr ""
     1977
     1978#: includes/Modules/Shipping/Ukrposhta/Checkout.php:88
     1979msgid "Zhytomyr region"
     1980msgstr ""
     1981
     1982#: includes/Modules/Shipping/Ukrposhta/Checkout.php:89
     1983msgid "Zakarpattia region"
     1984msgstr ""
     1985
     1986#: includes/Modules/Shipping/Ukrposhta/Checkout.php:90
     1987msgid "Zaporizhzhia region"
     1988msgstr ""
     1989
     1990#: includes/Modules/Shipping/Ukrposhta/Checkout.php:91
     1991msgid "Ivano-Frankivsk region"
     1992msgstr ""
     1993
     1994#: includes/Modules/Shipping/Ukrposhta/Checkout.php:92
     1995msgid "Kyiv region"
     1996msgstr ""
     1997
     1998#: includes/Modules/Shipping/Ukrposhta/Checkout.php:93
     1999msgid "Kirovohrad region"
     2000msgstr ""
     2001
     2002#: includes/Modules/Shipping/Ukrposhta/Checkout.php:94
     2003msgid "Luhansk region"
     2004msgstr ""
     2005
     2006#: includes/Modules/Shipping/Ukrposhta/Checkout.php:95
     2007msgid "Lviv region"
     2008msgstr ""
     2009
     2010#: includes/Modules/Shipping/Ukrposhta/Checkout.php:96
     2011msgid "Mykolaiv region"
     2012msgstr ""
     2013
     2014#: includes/Modules/Shipping/Ukrposhta/Checkout.php:97
     2015msgid "Odesa region"
     2016msgstr ""
     2017
     2018#: includes/Modules/Shipping/Ukrposhta/Checkout.php:98
     2019msgid "Poltava region"
     2020msgstr ""
     2021
     2022#: includes/Modules/Shipping/Ukrposhta/Checkout.php:99
     2023msgid "Rivne region"
     2024msgstr ""
     2025
     2026#: includes/Modules/Shipping/Ukrposhta/Checkout.php:100
     2027msgid "Sumy region"
     2028msgstr ""
     2029
     2030#: includes/Modules/Shipping/Ukrposhta/Checkout.php:101
     2031msgid "Ternopil region"
     2032msgstr ""
     2033
     2034#: includes/Modules/Shipping/Ukrposhta/Checkout.php:102
     2035msgid "Kharkiv region"
     2036msgstr ""
     2037
     2038#: includes/Modules/Shipping/Ukrposhta/Checkout.php:103
     2039msgid "Kherson region"
     2040msgstr ""
     2041
     2042#: includes/Modules/Shipping/Ukrposhta/Checkout.php:104
     2043msgid "Khmelnytskyi region"
     2044msgstr ""
     2045
     2046#: includes/Modules/Shipping/Ukrposhta/Checkout.php:105
     2047msgid "Cherkasy region"
     2048msgstr ""
     2049
     2050#: includes/Modules/Shipping/Ukrposhta/Checkout.php:106
     2051msgid "Chernivtsi region"
     2052msgstr ""
     2053
     2054#: includes/Modules/Shipping/Ukrposhta/Checkout.php:107
     2055msgid "Chernihiv region"
     2056msgstr ""
     2057
     2058#: includes/Modules/Shipping/Ukrposhta/Checkout.php:108
     2059msgid "Autonomous Republic of Crimea"
     2060msgstr ""
     2061
     2062#: includes/Modules/Shipping/Ukrposhta/Checkout.php:128
     2063msgid "Ukrposhta delivery"
     2064msgstr ""
     2065
     2066#: includes/Modules/Shipping/Ukrposhta/Checkout.php:130
     2067msgid "Region"
     2068msgstr ""
     2069
     2070#: includes/Modules/Shipping/Ukrposhta/Checkout.php:132
     2071msgid "Choose a region…"
     2072msgstr ""
     2073
     2074#: includes/Modules/Shipping/Ukrposhta/Checkout.php:139
     2075msgid "City or village"
     2076msgstr ""
     2077
     2078#: includes/Modules/Shipping/Ukrposhta/Checkout.php:143
     2079msgid "Postcode"
     2080msgstr ""
     2081
     2082#. translators: %s: link to the Ukrposhta postcode directory.
     2083#: includes/Modules/Shipping/Ukrposhta/Checkout.php:151
     2084#, php-format
     2085msgid "The parcel goes to the post office of your postcode. Do not know it? %s"
     2086msgstr ""
     2087
     2088#: includes/Modules/Shipping/Ukrposhta/Checkout.php:152
     2089msgid "Look it up on the Ukrposhta site"
     2090msgstr ""
     2091
     2092#: includes/Modules/Shipping/Ukrposhta/Checkout.php:187
     2093msgid "Please choose the region for Ukrposhta delivery."
     2094msgstr ""
     2095
     2096#: includes/Modules/Shipping/Ukrposhta/Checkout.php:191
     2097msgid "Please enter the city or village for Ukrposhta delivery."
     2098msgstr ""
     2099
     2100#: includes/Modules/Shipping/Ukrposhta/Checkout.php:195
     2101msgid "Please enter the five-digit postcode of your post office for Ukrposhta delivery."
     2102msgstr ""
     2103
     2104#: includes/Modules/Shipping/Ukrposhta/Checkout.php:232
     2105msgid "Ukrposhta post office:"
     2106msgstr ""
     2107
    19542108#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:34
    19552109msgid "Ukrposhta (ELEMENTARNO)"
    … …  
    19572111
    19582112#: includes/Modules/Shipping/Ukrposhta/ShippingMethod.php:35
    1959 msgid "Delivery by Ukrposhta to the post office serving the customer's city and postcode."
     2113msgid "Delivery by Ukrposhta to the post office of the customer's postcode. At checkout the customer gives the region, the city and the postcode instead of a street address."
    19602114msgstr ""
    19612115
  • elementarno-ukraine-for-woocommerce/trunk/readme.txt

    r3780183 r3780266  
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 2.7.3
     7Stable tag: 2.8.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    … …  
    2626
    2727* **Nova Poshta**: the customer picks a city and a branch or parcel locker with suggestions as they type. The directory is kept on your site, so checkout stays fast even when the Nova Poshta API is slow.
    28 * **Ukrposhta**: your own delivery price for every shipping zone.
     28* **Ukrposhta**: the customer gives the region, the city and the postcode of their post office instead of a street address; your own delivery price for every shipping zone.
    2929
    3030**Receipts and notifications**
    … …  
    141141
    142142== Changelog ==
     143
     144= 2.8.0 =
     145* Ukrposhta: the checkout now asks for what a Ukrposhta parcel needs, the region, the city and the five-digit postcode of the post office, with a link to the Ukrposhta postcode directory; the street-address fields are hidden, as with Nova Poshta. The post office is shown on the thank-you page, in e-mails, in the admin order and in Telegram and SMS messages ({delivery_point}).
     146* Nova Poshta and Ukrposhta share one mechanism for hiding the address fields, so the two methods no longer compete when a customer switches between them. The Nova Poshta filter `elementarno_np_hidden_checkout_fields` keeps working; the new name is `elementarno_delivery_hidden_checkout_fields`.
     147* Telegram, TurboSMS: new placeholder {delivery_point} (Nova Poshta branch or Ukrposhta post office); the default Telegram template uses it.
    143148
    144149= 2.7.3 =
Note: See TracChangeset for help on using the changeset viewer.