Plugin Directory

Changeset 3322332


Ignore:
Timestamp:
07/04/2025 12:56:50 PM (9 months ago)
Author:
boxnow
Message:

*Fixed an issue when the iframe embedded map didn’t display when only one shipping method was enabled.
*Quantity of vouchers in order view is already filled out and has pattern recognition to minimize wrongful entries.
*Visual rework of Selected Locker element in checkout.
*Removal of unused custom status for Order Statuses.
*Added a new setting to allow/disallow returns on voucher creation.

Location:
box-now-delivery/trunk
Files:
8 edited

Legend:

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

    r3313182 r3322332  
    55Author: BOX NOW
    66Text Domain: box-now-delivery
    7 Version: 2.1.7
     7Version: 2.1.8
    88*/
    99
     
    2929    {
    3030        if (is_checkout()) {
    31             $button_color = esc_attr(get_option('boxnow_button_color', '#84C33F'));
     31            $button_color = esc_attr(get_option('boxnow_button_color', '#6CD04E '));
    3232            $button_text = esc_attr(get_option('boxnow_button_text', 'Pick a Locker'));
    3333
     
    387387            "paymentMode" => $payment_method === 'cod' ? "cod" : "prepaid",
    388388            "amountToBeCollected" => $payment_method === 'cod' ? number_format($prep_data['order_total'], 2, '.', '') : "0",
    389             "allowReturn" => true,
     389            "allowReturn" => boolval(get_option('boxnow_allow_returns', '')),
    390390            "origin" => [
    391391                    "contactNumber" => get_option('boxnow_mobile_number', ''),
     
    602602            "paymentMode" => $payment_method === 'cod' ? "cod" : "prepaid",
    603603            "amountToBeCollected" => $payment_method === 'cod' ? number_format($prep_data['order_total'], 2, '.', '') : "0",
    604             "allowReturn" => true,
     604            "allowReturn" => boolval(get_option('boxnow_allow_returns', '')),
    605605            "origin" => [
    606606                    "contactNumber" => get_option('boxnow_mobile_number', ''),
     
    733733                <p>Vouchers for this order (Max Vouchers: <span style="font-weight: bold; color: red;"><?php echo esc_html($max_vouchers); ?></span>)</p>
    734734                <input type="hidden" id="box_now_order_id" value="<?php echo esc_attr($order->get_id()); ?>" />
    735                 <input type="number" id="box_now_voucher_code" name="box_now_voucher_code" min="1" max="<?php echo esc_attr($max_vouchers); ?>" placeholder="Enter voucher quantity" style="width: 50%;" />
    736 
     735                <input pattern="^[1-<?php echo esc_attr($max_vouchers); ?>]$" type="number" id="box_now_voucher_code" name="box_now_voucher_code" min="1" max="<?php echo esc_attr($max_vouchers); ?>" value="1" placeholder="Enter voucher quantity" style="width: 50%;" />
    737736                <!-- Add buttons for each compartment size -->
    738737                <div class="box-now-compartment-size-buttons" style="margin-top: 10px;">
  • box-now-delivery/trunk/css/box-now-delivery-admin.css

    r3309736 r3322332  
    1212
    1313.wrap h1 {
    14     color: #84C33F;
     14    color: #6CD04E ;
    1515    font-size: 36px;
    1616}
     
    1818.wrap h2 {
    1919    font-size: 24px;
    20     color: #84C33F;
     20    color: #6CD04E ;
    2121    margin-bottom: 20px;
    2222}
     
    4141
    4242.wrap input[type="submit"] {
    43     background-color: #84C33F;
     43    background-color: #6CD04E ;
    4444    color: #fff;
    4545    border: none;
     
    5151
    5252.wrap input[type="submit"]:hover {
    53     background-color: #84C33F;
     53    background-color: #6CD04E ;
    5454}
    5555
    5656.wrap a {
    57     color: #84C33F;
     57    color: #6CD04E ;
    5858    text-decoration: none;
    5959}
     
    6565/* Save Changes button styles */
    6666.wrap .button-primary {
    67     background-color: #84C33F;
     67    background-color: #6CD04E ;
    6868    border: 2px solid #62a02c;
    6969    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  • box-now-delivery/trunk/css/box-now-delivery.css

    r3309736 r3322332  
    11#box_now_delivery_button {
    2     border-radius: 10px;
     2    border-radius: 6px;
    33    box-shadow: 0px 4px 0px 0px rgba(0, 0, 0, 0.1);
    44    transition: all 0.3s;
    55    margin-top: 6px;
     6    margin-left: 5px;
     7    position: absolute;
    68}
    79
     
    1113}
    1214
     15#box_now_selected_locker_details {
     16    padding: 8px;
     17    font-size: 15px;
     18    border: 2px solid #6CD04E ;
     19    border-radius: 6px;
     20    margin-top: 13px;
     21    width: 83%;
     22    background-color: #f0ffeb;
     23    overflow: auto;
     24    max-height: 370px;
     25}
     26
    1327/* Print Voucher button in WooCommerce order page */
    1428.print-voucher-button {
    15     background-color: #84C33F;
     29    background-color: #6CD04E ;
    1630    border: 2px solid #62a02c;
    1731    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
     
    4256    display: inline-block;
    4357    padding: 6px 12px;
    44     background-color: #84C33F;
     58    background-color: #6CD04E ;
    4559    color: #ffffff;
    4660    text-decoration: none;
  • box-now-delivery/trunk/includes/box-now-delivery-admin-page.php

    r3313182 r3322332  
    116116                        <p>*Please note: Automatic voucher issuance is not recommended. This method automatically selects compartment sizes based on item dimensions, which may lead to incorrect compartment assignments if your items are not properly configured.</p>
    117117                    </div>
     118                    <h3 style="width: 100%; float: left;">Allow Returns</h3>
     119                    <div style="width: 100%; float: left;">
     120                        <p>
     121                            <input type="radio" id="display_allow_returns_yes" name="boxnow_allow_returns" value="1" <?php checked(get_option('boxnow_allow_returns', '0'), '1'); ?>>
     122                            <label for="display_allowReturns_yes">Yes</label>
     123                        </p>
     124                        <p>
     125                            <input type="radio" id="display_allow_returns_no" name="boxnow_allow_returns" value="0" <?php checked(get_option('boxnow_allow_returns', '0'), '0'); ?>>
     126                            <label for="display_allowReturns_no">No</label>
     127                        </p>
     128                    </div>
    118129
    119130                    <!-- Widget Options -->
     
    150161                            <label>Change Button Background Color</label>
    151162                            <br />
    152                             <input type="text" name="boxnow_button_color" value="<?php echo esc_attr(get_option('boxnow_button_color', '#84C33F')); ?>" placeholder="#84C33F" />
     163                            <input type="text" name="boxnow_button_color" value="<?php echo esc_attr(get_option('boxnow_button_color', '#6CD04E ')); ?>" placeholder="#6CD04E " />
    153164                        </p>
    154165                        <p>
  • box-now-delivery/trunk/includes/box-now-delivery-cancel-order.php

    r3309736 r3322332  
    44add_action('init', 'boxnow_register_boxnow_canceled_order_status');
    55// Add custom order status to WooCommerce
    6 add_filter('wc_order_statuses', 'boxnow_add_canceled_order_status');
     6//add_filter('wc_order_statuses', 'boxnow_add_canceled_order_status');
    77add_filter('woocommerce_admin_order_actions', 'boxnow_add_cancel_order_button', 10, 2);
    88add_action('admin_head', 'boxnow_add_cancel_order_button_css');
     
    3030}
    3131
    32 function boxnow_add_canceled_order_status($order_statuses)
     32/**function boxnow_add_canceled_order_status($order_statuses)
    3333{
    3434    $order_statuses['wc-boxnow-canceled'] = __('BOX NOW Cancel Order', 'box-now-delivery');
    3535    return $order_statuses;
    36 }
     36}**/
    3737
    3838function boxnow_add_cancel_order_button($actions, $order)
  • box-now-delivery/trunk/includes/box-now-delivery-validation.php

    r3309736 r3322332  
    5656            update_option('boxnow_voucher_email', sanitize_email($_POST['boxnow_voucher_email']));
    5757        }
     58        if (isset($_POST['boxnow_allow_returns'])) {
     59            update_option('boxnow_allow_returns', sanitize_text_field($_POST['boxnow_allow_returns']));
     60        }
    5861        if (isset($_POST['boxnow_mobile_number'])) {
    5962            update_option('boxnow_mobile_number', sanitize_text_field($_POST['boxnow_mobile_number']));
  • box-now-delivery/trunk/js/box-now-delivery.js

    r3309736 r3322332  
    3030     */
    3131    function applyButtonStyles() {
    32         var buttonColor = boxNowDeliverySettings.buttonColor || "#84C33F";
     32        var buttonColor = boxNowDeliverySettings.buttonColor || "#6CD04E ";
    3333
    3434        var styleBlock = `
     
    110110        }
    111111
    112         if ($("#shipping_method_0_box_now_delivery").is(":checked")) {
     112        var selected = $('input[name^="shipping_method"]:checked, input[name^="shipping_method"][type="hidden"]');
     113
     114        if (selected.length && selected.val().includes('box_now_delivery')) {
    113115            $("#box_now_delivery_embedded_map").show();
    114116        } else {
     
    309311        // Define the content for English.
    310312        var englishContent = `
    311 <div style="font-family: Arial, sans-serif; margin-top: 10px;">
    312   <p style="margin-bottom: 10px; color: rgb(132 195 62);"><b>Selected Locker</b></p>
    313   <p style="margin-bottom: 5px; font-size: 14px;"><b>Locker Name:</b> ${locker_name}</p>
    314   <p style="margin-bottom: 5px; font-size: 14px;"><b>Locker Address:</b> ${locker_address}</p>
    315   <p style="margin-bottom: 5px; font-size: 14px;"><b>Postal Code:</b> ${locker_postal_code}</p>
     313<div style="font-family: Verdana , Arial, sans-serif;font-weight:300;margin-top: -7px;">
     314  <p style="margin: 1px 0px; color: #61bb46;font-weight: 400;height: 25px;"><b>Selected Locker</b></p>
     315  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_name}</p>
     316  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_address}</p>
     317  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_postal_code}</p>
    316318</div>`;
    317319
    318320        // Define the content for Greek.
    319321        var greekContent = `
    320 <div style="font-family: Arial, sans-serif; margin-top: 10px;">
    321   <p style="margin-bottom: 10px; color: rgb(132 195 62);"><b>Επιλεγμένο locker</b></p>
    322   <p style="margin-bottom: 5px; font-size: 14px;"><b>Όνομα locker:</b> ${locker_name}</p>
    323   <p style="margin-bottom: 5px; font-size: 14px;"><b>Διεύθυνση locker:</b> ${locker_address}</p>
    324   <p style="margin-bottom: 5px; font-size: 14px;"><b>ΤΚ:</b> ${locker_postal_code}</p>
     322<div style="font-family: Verdana , Arial, sans-serif;font-weight:300;margin-top: -7px;">
     323  <p style="margin: 1px 0px; color: #61bb46;font-weight: 400;height: 25px;"><b>Επιλεγμένο locker</b></p>
     324  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_name}</p>
     325  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_address}</p>
     326  <p style="margin: 1px 0px; font-size: 13px;line-height:20px;height: 20px;">${locker_postal_code}</p>
    325327</div>`;
    326328
     
    463465        addOrderValidation();
    464466
    465         $('body').on('change', '#billing_country', function(){
     467        $('body').on('change', '#billing_country', function () {
    466468            clearSelectedLockerDetails();
    467469        });
  • box-now-delivery/trunk/readme.txt

    r3313182 r3322332  
    44Requires at least: 6.2
    55Tested up to: 6.8
    6 Stable tag: 2.1.7
     6Stable tag: 2.1.8
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1717== Changelog ==
    1818
    19 = 2.1.7 =
    20 *Fix Cyprus phone number in admin
     19= 2.1.8 =
     20*Fixed an issue when the iframe embedded map didn’t display when only one shipping method was enabled.
     21*Quantity of vouchers in order view is already filled out and has pattern recognition to minimize wrongful entries.
     22*Visual rework of Selected Locker element in checkout.
     23*Removal of unused custom status for Order Statuses.
     24*Added a new setting to allow/disallow returns on voucher creation.
    2125
    2226== Upgrade Notice ==
    2327
    24 = 2.1.7 =
     28= 2.1.8 =
    2529Please 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.