Plugin Directory

Changeset 2945914


Ignore:
Timestamp:
08/01/2023 09:15:14 AM (3 years ago)
Author:
sprinque
Message:

v.1.3.8

Location:
sprinque
Files:
9 edited
20 copied

Legend:

Unmodified
Added
Removed
  • sprinque/tags/1.3.8/assets/css/frontend.css

    r2907071 r2945914  
    836836#register-company-tab, #register-company-tab-2 {
    837837  padding: 0 5px;
     838  text-decoration: underline;
    838839}
    839840
  • sprinque/tags/1.3.8/assets/css/frontend.scss

    r2907071 r2945914  
    10571057#register-company-tab, #register-company-tab-2 {
    10581058  padding: 0 5px;
     1059  text-decoration: underline;
    10591060}
    10601061
  • sprinque/tags/1.3.8/assets/js/frontend.js

    r2932350 r2945914  
    7171            }
    7272
    73             return '€' + calculatedFee.toFixed(2);
     73            return window.admin.currency_symbol + calculatedFee.toFixed(2);
    7474        },
    7575        recalculateTotal() {
     
    7777            const totalWithFee = this.amount * fee;
    7878
    79             jQuery('.wpm-terms-row.total .value').text('€' + totalWithFee.toFixed(2));
     79            jQuery('.wpm-terms-row.total .value').text(window.admin.currency_symbol + totalWithFee.toFixed(2));
    8080        }
    8181    };
     
    539539
    540540        if ($form.find('#ship-to-different-address-checkbox').is(':checked')) {
    541             initial_shipping_address_line1 = $form.find('#shipping_address_1').val();
     541            const house_number = $form.find('#shipping_house_number').length > 0
     542                ? $form.find('#shipping_house_number').val()
     543                : '';
     544            initial_shipping_address_line1 = $form.find('#shipping_address_1').val() + ' ' + house_number;
     545            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     546
    542547            initial_shipping_address_line2 = $form.find('#shipping_address_2').val();
    543548            initial_shipping_city = $form.find('#shipping_city').val();
     
    545550            initial_shipping_country_code = $form.find('#shipping_country').val();
    546551        } else {
    547             initial_shipping_address_line1 = $form.find('#billing_address_1').val();
     552            const house_number = $form.find('#billing_address_1').length > 0
     553                ? $form.find('#billing_address_1').val()
     554                : '';
     555            initial_shipping_address_line1 = $form.find('#billing_address_1').val() + ' ' + house_number;
     556            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     557
    548558            initial_shipping_address_line2 = $form.find('#billing_address_2').val();
    549559            initial_shipping_city = $form.find('#billing_city').val();
     
    742752
    743753        if ($form.find('#ship-to-different-address-checkbox').is(':checked')) {
    744             initial_shipping_address_line1 = $form.find('#shipping_address_1').val();
     754            const house_number = $form.find('#shipping_house_number').length > 0
     755                ? $form.find('#shipping_house_number').val()
     756                : '';
     757            initial_shipping_address_line1 = $form.find('#shipping_address_1').val() + ' ' + house_number;
     758            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     759
    745760            initial_shipping_address_line2 = $form.find('#shipping_address_2').val();
    746761            initial_shipping_city = $form.find('#shipping_city').val();
     
    748763            initial_shipping_country_code = $form.find('#shipping_country').val();
    749764        } else {
    750             initial_shipping_address_line1 = $form.find('#billing_address_1').val();
     765            const house_number = $form.find('#billing_address_1').length > 0
     766                ? $form.find('#billing_address_1').val()
     767                : '';
     768            initial_shipping_address_line1 = $form.find('#billing_address_1').val() + ' ' + house_number;
     769            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     770
    751771            initial_shipping_address_line2 = $form.find('#billing_address_2').val();
    752772            initial_shipping_city = $form.find('#billing_city').val();
  • sprinque/tags/1.3.8/include/payment_method.php

    r2938297 r2945914  
    280280                    'zip_code'      => sanitize_text_field( $_POST['zip_code'] ),
    281281                    'country_code'  => $country
    282                 ],
    283                 'initial_shipping_address' => [
    284                     'address_line1' => sanitize_text_field( $_POST['initial_shipping_address_line1'] ),
    285                     'address_line2' => sanitize_text_field( $_POST['initial_shipping_address_line2'] ),
    286                     'city'          => sanitize_text_field( $_POST['initial_shipping_city'] ),
    287                     'zip_code'      => sanitize_text_field( $_POST['initial_shipping_zip_code'] ),
    288                     'country_code'  => sanitize_text_field( $_POST['initial_shipping_country_code'] )
    289282                ],
    290283                'buyer_users'         => [
     
    302295                ]
    303296            ];
     297
     298            if (!empty($_POST['initial_shipping_address_line1'])) {
     299                $data = array_merge($data, [
     300                    'initial_shipping_address' => [
     301                        'address_line1' => sanitize_text_field( $_POST['initial_shipping_address_line1'] ),
     302                        'address_line2' => sanitize_text_field( $_POST['initial_shipping_address_line2'] ),
     303                        'city'          => sanitize_text_field( $_POST['initial_shipping_city'] ),
     304                        'zip_code'      => sanitize_text_field( $_POST['initial_shipping_zip_code'] ),
     305                        'country_code'  => sanitize_text_field( $_POST['initial_shipping_country_code'] )
     306                    ]
     307                ]);
     308            }
    304309
    305310            if ($country_object !== null && (!empty($_POST['registration_number']) || $country_object['is_registration_number_required'])) {
     
    423428                'merchant_order_id' => sanitize_text_field($_SESSION['order_id']),
    424429                'order_amount'      => WC()->cart->total,
     430                'order_currency'    => get_woocommerce_currency(),
    425431                'shipping_address'  => [
    426432                    'address_line1' => sanitize_text_field( $_POST['address_line1'] ),
  • sprinque/tags/1.3.8/readme.txt

    r2938297 r2945914  
    66Tested up to: 6.0
    77Requires PHP: 5.3
    8 Stable tag: 1.3.7
     8Stable tag: 1.3.8
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Changelog ==
     52
     53= 1.3.8 - August 1, 2023 =
     54* Multiple currencies support;
     55* Fixed initial shipping address not to break the buyer call;
     56* Added house number to initial shipping address;
     57* Style improvements;
     58* Updated b2b-sprinque-tools to v.1.4.2;
    5259
    5360= 1.3.7 - July 13, 2023 =
  • sprinque/tags/1.3.8/sprinque.php

    r2938297 r2945914  
    55Description: Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention.
    66Author: Sprinque
    7 Version: 1.3.7
     7Version: 1.3.8
    88Text Domain: sprinque
    99Domain Path: /languages
    1010*/
    1111
    12 define( 'PLUGIN_SRINQUE_VERSION', '1.3.7' );
     12define( 'PLUGIN_SRINQUE_VERSION', '1.3.8' );
    1313define( 'PLUGIN_SRINQUE_DIR', __DIR__ );
    1414define( 'PLUGIN_SRINQUE_PATH', plugins_url( '', __FILE__ ) );
     
    316316                'url'                 => $pdf_url,
    317317                'amount'              => $order->get_total() - $total_refund,
     318                'currency'            => $order->get_currency(),
    318319                'date'                => date( 'Y-m-d' )
    319320            ],
     
    428429                            'merchant_order_id' =>  ( $order_id_from_sequential_plugin ?: $order->get_id() ) . '_wh',
    429430                            'order_amount'      => $total,
     431                            'order_currency'    => $order->get_currency(),
    430432                            'payment_terms'     => $payment_term,
    431433                            'shipping_address'  => [
     
    618620            // Register scripts
    619621            $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true );
    620             wp_enqueue_script( 'wpm_srinque_tools', 'https://unpkg.com/b2b-sprinque-tools@1.3.6/dist/index.umd.min.js', array( ), PLUGIN_SRINQUE_VERSION, 'all' );
     622            wp_enqueue_script( 'wpm_srinque_tools', 'https://unpkg.com/b2b-sprinque-tools@1.4.2/dist/index.umd.min.js', array( ), PLUGIN_SRINQUE_VERSION, 'all' );
    621623            wp_enqueue_script( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/js/frontend.js', array( 'jquery', 'wpm_srinque_tools' ), PLUGIN_SRINQUE_VERSION, 'all' );
    622624
     
    635637                'place_order' => __( "Place order", 'sprinque' ),
    636638                'days' => __('days', 'sprinque'),
    637                 'payment_terms' => $this->get_payment_terms()
     639                'payment_terms' => $this->get_payment_terms(),
     640                'currency_symbol' => get_woocommerce_currency_symbol()
    638641            ) );
    639642        }
  • sprinque/tags/1.3.8/templates/frontend/srinque_pay_modal_form.php

    r2932350 r2945914  
    132132                        <div class="wpm-terms-row total">
    133133                            <div class="label"><?php _e("Total amount", 'sprinque'); ?></div>
    134                             <div class="value">00.00</div>
     134                            <div class="value"><?= get_woocommerce_currency_symbol(); ?>00.00</div>
    135135                        </div>
    136136                    </div>
  • sprinque/trunk/assets/css/frontend.css

    r2907071 r2945914  
    836836#register-company-tab, #register-company-tab-2 {
    837837  padding: 0 5px;
     838  text-decoration: underline;
    838839}
    839840
  • sprinque/trunk/assets/css/frontend.scss

    r2907071 r2945914  
    10571057#register-company-tab, #register-company-tab-2 {
    10581058  padding: 0 5px;
     1059  text-decoration: underline;
    10591060}
    10601061
  • sprinque/trunk/assets/js/frontend.js

    r2932350 r2945914  
    7171            }
    7272
    73             return '€' + calculatedFee.toFixed(2);
     73            return window.admin.currency_symbol + calculatedFee.toFixed(2);
    7474        },
    7575        recalculateTotal() {
     
    7777            const totalWithFee = this.amount * fee;
    7878
    79             jQuery('.wpm-terms-row.total .value').text('€' + totalWithFee.toFixed(2));
     79            jQuery('.wpm-terms-row.total .value').text(window.admin.currency_symbol + totalWithFee.toFixed(2));
    8080        }
    8181    };
     
    539539
    540540        if ($form.find('#ship-to-different-address-checkbox').is(':checked')) {
    541             initial_shipping_address_line1 = $form.find('#shipping_address_1').val();
     541            const house_number = $form.find('#shipping_house_number').length > 0
     542                ? $form.find('#shipping_house_number').val()
     543                : '';
     544            initial_shipping_address_line1 = $form.find('#shipping_address_1').val() + ' ' + house_number;
     545            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     546
    542547            initial_shipping_address_line2 = $form.find('#shipping_address_2').val();
    543548            initial_shipping_city = $form.find('#shipping_city').val();
     
    545550            initial_shipping_country_code = $form.find('#shipping_country').val();
    546551        } else {
    547             initial_shipping_address_line1 = $form.find('#billing_address_1').val();
     552            const house_number = $form.find('#billing_address_1').length > 0
     553                ? $form.find('#billing_address_1').val()
     554                : '';
     555            initial_shipping_address_line1 = $form.find('#billing_address_1').val() + ' ' + house_number;
     556            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     557
    548558            initial_shipping_address_line2 = $form.find('#billing_address_2').val();
    549559            initial_shipping_city = $form.find('#billing_city').val();
     
    742752
    743753        if ($form.find('#ship-to-different-address-checkbox').is(':checked')) {
    744             initial_shipping_address_line1 = $form.find('#shipping_address_1').val();
     754            const house_number = $form.find('#shipping_house_number').length > 0
     755                ? $form.find('#shipping_house_number').val()
     756                : '';
     757            initial_shipping_address_line1 = $form.find('#shipping_address_1').val() + ' ' + house_number;
     758            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     759
    745760            initial_shipping_address_line2 = $form.find('#shipping_address_2').val();
    746761            initial_shipping_city = $form.find('#shipping_city').val();
     
    748763            initial_shipping_country_code = $form.find('#shipping_country').val();
    749764        } else {
    750             initial_shipping_address_line1 = $form.find('#billing_address_1').val();
     765            const house_number = $form.find('#billing_address_1').length > 0
     766                ? $form.find('#billing_address_1').val()
     767                : '';
     768            initial_shipping_address_line1 = $form.find('#billing_address_1').val() + ' ' + house_number;
     769            initial_shipping_address_line1 = initial_shipping_address_line1.trim();
     770
    751771            initial_shipping_address_line2 = $form.find('#billing_address_2').val();
    752772            initial_shipping_city = $form.find('#billing_city').val();
  • sprinque/trunk/include/payment_method.php

    r2938297 r2945914  
    280280                    'zip_code'      => sanitize_text_field( $_POST['zip_code'] ),
    281281                    'country_code'  => $country
    282                 ],
    283                 'initial_shipping_address' => [
    284                     'address_line1' => sanitize_text_field( $_POST['initial_shipping_address_line1'] ),
    285                     'address_line2' => sanitize_text_field( $_POST['initial_shipping_address_line2'] ),
    286                     'city'          => sanitize_text_field( $_POST['initial_shipping_city'] ),
    287                     'zip_code'      => sanitize_text_field( $_POST['initial_shipping_zip_code'] ),
    288                     'country_code'  => sanitize_text_field( $_POST['initial_shipping_country_code'] )
    289282                ],
    290283                'buyer_users'         => [
     
    302295                ]
    303296            ];
     297
     298            if (!empty($_POST['initial_shipping_address_line1'])) {
     299                $data = array_merge($data, [
     300                    'initial_shipping_address' => [
     301                        'address_line1' => sanitize_text_field( $_POST['initial_shipping_address_line1'] ),
     302                        'address_line2' => sanitize_text_field( $_POST['initial_shipping_address_line2'] ),
     303                        'city'          => sanitize_text_field( $_POST['initial_shipping_city'] ),
     304                        'zip_code'      => sanitize_text_field( $_POST['initial_shipping_zip_code'] ),
     305                        'country_code'  => sanitize_text_field( $_POST['initial_shipping_country_code'] )
     306                    ]
     307                ]);
     308            }
    304309
    305310            if ($country_object !== null && (!empty($_POST['registration_number']) || $country_object['is_registration_number_required'])) {
     
    423428                'merchant_order_id' => sanitize_text_field($_SESSION['order_id']),
    424429                'order_amount'      => WC()->cart->total,
     430                'order_currency'    => get_woocommerce_currency(),
    425431                'shipping_address'  => [
    426432                    'address_line1' => sanitize_text_field( $_POST['address_line1'] ),
  • sprinque/trunk/readme.txt

    r2938297 r2945914  
    66Tested up to: 6.0
    77Requires PHP: 5.3
    8 Stable tag: 1.3.7
     8Stable tag: 1.3.8
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Changelog ==
     52
     53= 1.3.8 - August 1, 2023 =
     54* Multiple currencies support;
     55* Fixed initial shipping address not to break the buyer call;
     56* Added house number to initial shipping address;
     57* Style improvements;
     58* Updated b2b-sprinque-tools to v.1.4.2;
    5259
    5360= 1.3.7 - July 13, 2023 =
  • sprinque/trunk/sprinque.php

    r2938297 r2945914  
    55Description: Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention.
    66Author: Sprinque
    7 Version: 1.3.7
     7Version: 1.3.8
    88Text Domain: sprinque
    99Domain Path: /languages
    1010*/
    1111
    12 define( 'PLUGIN_SRINQUE_VERSION', '1.3.7' );
     12define( 'PLUGIN_SRINQUE_VERSION', '1.3.8' );
    1313define( 'PLUGIN_SRINQUE_DIR', __DIR__ );
    1414define( 'PLUGIN_SRINQUE_PATH', plugins_url( '', __FILE__ ) );
     
    316316                'url'                 => $pdf_url,
    317317                'amount'              => $order->get_total() - $total_refund,
     318                'currency'            => $order->get_currency(),
    318319                'date'                => date( 'Y-m-d' )
    319320            ],
     
    428429                            'merchant_order_id' =>  ( $order_id_from_sequential_plugin ?: $order->get_id() ) . '_wh',
    429430                            'order_amount'      => $total,
     431                            'order_currency'    => $order->get_currency(),
    430432                            'payment_terms'     => $payment_term,
    431433                            'shipping_address'  => [
     
    618620            // Register scripts
    619621            $settings = get_option( 'woocommerce_wpm_srinque_pay_settings', true );
    620             wp_enqueue_script( 'wpm_srinque_tools', 'https://unpkg.com/b2b-sprinque-tools@1.3.6/dist/index.umd.min.js', array( ), PLUGIN_SRINQUE_VERSION, 'all' );
     622            wp_enqueue_script( 'wpm_srinque_tools', 'https://unpkg.com/b2b-sprinque-tools@1.4.2/dist/index.umd.min.js', array( ), PLUGIN_SRINQUE_VERSION, 'all' );
    621623            wp_enqueue_script( 'wpm_srinque_pay', PLUGIN_SRINQUE_PATH . '/assets/js/frontend.js', array( 'jquery', 'wpm_srinque_tools' ), PLUGIN_SRINQUE_VERSION, 'all' );
    622624
     
    635637                'place_order' => __( "Place order", 'sprinque' ),
    636638                'days' => __('days', 'sprinque'),
    637                 'payment_terms' => $this->get_payment_terms()
     639                'payment_terms' => $this->get_payment_terms(),
     640                'currency_symbol' => get_woocommerce_currency_symbol()
    638641            ) );
    639642        }
  • sprinque/trunk/templates/frontend/srinque_pay_modal_form.php

    r2932350 r2945914  
    132132                        <div class="wpm-terms-row total">
    133133                            <div class="label"><?php _e("Total amount", 'sprinque'); ?></div>
    134                             <div class="value">00.00</div>
     134                            <div class="value"><?= get_woocommerce_currency_symbol(); ?>00.00</div>
    135135                        </div>
    136136                    </div>
Note: See TracChangeset for help on using the changeset viewer.