Plugin Directory

Changeset 3153875


Ignore:
Timestamp:
09/18/2024 10:41:35 AM (19 months ago)
Author:
boxnow
Message:

HPOS fix

Location:
box-now-delivery
Files:
19 added
5 edited

Legend:

Unmodified
Added
Removed
  • box-now-delivery/trunk/box-now-delivery.php

    r3122791 r3153875  
    55Author: BOX NOW
    66Text Domain: box-now-delivery
    7 Version: 2.1.2
     7Version: 2.1.3
    88*/
    99
     
    3030    if (is_checkout()) {
    3131      $button_color = esc_attr(get_option('boxnow_button_color', '#84C33F'));
    32       $button_text = esc_attr(get_option('boxnow_button_text', 'Pick a ocker'));
     32      $button_text = esc_attr(get_option('boxnow_button_text', 'Pick a Locker'));
    3333
    3434      wp_enqueue_script('box-now-delivery-js', plugin_dir_url(__FILE__) . 'js/box-now-delivery.js', array('jquery'), '1.0.0', true);
     
    154154          <div class="edit_address">
    155155            <?php
    156             woocommerce_wp_text_input(array('id' => '_boxnow_locker_id', 'label' => esc_html__('Locker ID'), 'wrapper_class' => '_boxnow_locker_id'));
     156            woocommerce_wp_text_input(array(
     157              'id' => '_boxnow_locker_id',
     158              'label' => esc_html__('Locker ID'),
     159              'wrapper_class' => '_boxnow_locker_id',
     160              'value' => get_post_meta($order->get_id(), '_boxnow_locker_id', true)
     161          ));
    157162
    158163            $warehouse_ids = explode(',', str_replace(' ', '', get_option('boxnow_warehouse_id', '')));
  • box-now-delivery/trunk/includes/box-now-delivery-admin-page.php

    r3122791 r3153875  
    4949            <p>
    5050              <label>Your API URL:</label>
    51               <br />
    52               <input type="text" name="boxnow_api_url" value="<?php echo esc_attr(get_option('boxnow_api_url', '')); ?>" placeholder="Enter your API URL without the http:// or https:// prefix" />
     51             <br />
     52              <select name="boxnow_api_url">
     53               <option value="api-stage.boxnow.gr" <?php selected(get_option('boxnow_api_url', ''), 'api-stage.boxnow.gr'); ?>>api-stage.boxnow.gr</option>
     54               <option value="api-production.boxnow.gr" <?php selected(get_option('boxnow_api_url', ''), 'api-production.boxnow.gr'); ?>>api-production.boxnow.gr</option>
     55              </select>
    5356            </p>
    5457            <p>
  • box-now-delivery/trunk/js/box-now-delivery-admin-page.js

    r3002071 r3153875  
    11document.addEventListener("DOMContentLoaded", function () {
    2   var apiUrlInput = document.querySelector('input[name="boxnow_api_url"]');
     2  var apiUrlInput = document.querySelector(
     3    'select[name="boxnow_api_url"], input[name="boxnow_api_url"]'
     4  );
    35
    4   // Check if apiUrlInput exists
    5   if (apiUrlInput) {
    6     apiUrlInput.addEventListener("input", function () {
    7       var currentValue = apiUrlInput.value;
    8       var newValue = currentValue
    9         .replace(/^https?:\/\//i, "")
    10         .replace(/\/+$/, "");
    11       apiUrlInput.value = newValue;
    12     });
    13   } else {
    14     console.error('Element with name "boxnow_api_url" was not found');
    15   }
     6  // Check if apiUrlInput exists (Not needed Dropdown)
     7  // if (apiUrlInput) {
     8  //   apiUrlInput.addEventListener("input", function () {
     9  //     var currentValue = apiUrlInput.value;
     10  //     var newValue = currentValue
     11  //       .replace(/^https?:\/\//i, "")
     12  //       .replace(/\/+$/, "");
     13  //     apiUrlInput.value = newValue;
     14  //   });
     15  // } else {
     16  //   console.error('Element with name "boxnow_api_url" was not found');
     17  // }
    1618
    1719  const emailOption = document.getElementById("send_voucher_email");
  • box-now-delivery/trunk/js/box-now-delivery.js

    r3122791 r3153875  
    363363    } else if ($("shipping_method_[0]").is(":checked")) {
    364364      boxButton.hide();
    365     } else if ($("input[name='shipping_method[0]']").length == 1) {
     365    } else if (
     366      $('input[type="hidden"][name="shipping_method[0]"]').val() ===
     367      "box_now_delivery"
     368    ) {
    366369      boxButton.show();
    367370    }
     
    396399        if (
    397400          !lockerData &&
    398           $('input[type="radio"][name="shipping_method[0]"]:checked').val() ===
    399             "box_now_delivery"
     401          ($('input[type="radio"][name="shipping_method[0]"]:checked').val() ===
     402            "box_now_delivery" ||
     403            $('input[type="hidden"][name="shipping_method[0]"]').val() ===
     404              "box_now_delivery")
    400405        ) {
    401406          event.preventDefault();
  • box-now-delivery/trunk/readme.txt

    r3122791 r3153875  
    11=== BOX NOW Delivery ===
    2 Contributors: boxnow, theodorosgrivas, giannistsonis
     2Contributors: boxnow
    33Tags: delivery, boxnow
    44Requires at least: 6.2
    5 Tested up to: 6.6
    6 Stable tag: 2.1.2
     5Tested up to: 6.6.2
     6Stable tag: 2.1.3
    77Requires PHP: 8.0
    88License: GPLv2 or later
     
    1717== Changelog ==
    1818
    19 = 2.1.2 =
    20 *Added Sender's contact phone
    21 *Added Phone "check and fix" for cyprus and greek numbers
     19= 2.1.3 =
     20*Fixed HPOS locker bug
     21*Minor changes
    2222*Minor Bug fixes
    2323
    2424== Upgrade Notice ==
    2525
    26 = 2.1.2 =
     26= 2.1.3 =
    2727Please upgrade to our latest plugin version to avoid coflicts and errors of any older versions.
Note: See TracChangeset for help on using the changeset viewer.