Plugin Directory

Changeset 2617574


Ignore:
Timestamp:
10/21/2021 06:04:34 AM (4 years ago)
Author:
redboxsa
Message:

Version 1.17

Location:
redbox-pickup
Files:
5 edited
6 copied

Legend:

Unmodified
Added
Removed
  • redbox-pickup/tags/1.17/admin/config.php

    r2374921 r2617574  
    4747                                            if(!empty(get_option( 'redbox_key' ))) {
    4848                                                echo get_option( 'redbox_key' );
     49                                            } else {
     50                                                echo "";
     51                                            }
     52                                        ?>"
     53                                        style="
     54                                            width: 100%;
     55                                            height: 35px;
     56                                            line-height: 35px;
     57                                        "
     58                                    >
     59                                </div>
     60                                <p style="font-size: 14px; margin: 10px 0px 5px 0px">
     61                                    <?php echo REDBOX_LANGUAGE[$this->lang]['min_total_price_for_free'] ?>
     62                                </p>
     63                                <div>
     64                                    <input type="number" min="0" step="any" name="min_price_for_free"
     65                                        value="<?php
     66                                            if(!empty(get_option( 'min_price_for_free' ))) {
     67                                                echo get_option( 'min_price_for_free' );
    4968                                            } else {
    5069                                                echo "";
     
    121140                                "store_url" => $storeUrl
    122141                            ];
     142                            if (isset($_POST['min_price_for_free'])) {
     143                                update_option('min_price_for_free', sanitize_text_field( $_REQUEST['min_price_for_free'] ), 'yes');
     144                            }
    123145                            if (isset($_POST['consumer_key'])) {
    124146                                $dataStore['consumer_key'] = $_POST['consumer_key'];
  • redbox-pickup/tags/1.17/front/front.php

    r2551895 r2617574  
    55            public $lang;
    66            public $redboxKey;
     7            public $minimumAmount;
    78
    89            public function __construct(){
    910               $this->lang = get_locale() == "ar" ? "ar" : "en";
    10                $this->redboxKey = get_option('redbox_key');           
     11               $this->redboxKey = get_option('redbox_key');
     12               $this->minimumAmount = get_option('min_price_for_free') && is_numeric(get_option('min_price_for_free')) ?floatval(get_option('min_price_for_free')) : false;           
    1113            }
    1214
     
    292294            }
    293295
     296            function bbloomer_woocommerce_tiered_shipping( $rates, $package ) {
     297                if ($this->minimumAmount == false) {
     298                    return $rates;
     299                }
     300                $total = WC()->cart->subtotal;
     301                if ($total >= $this->minimumAmount) {
     302                    if ($rates["redbox_pickup_delivery"]) {
     303                        $rates["redbox_pickup_delivery"]->cost = 0;
     304                    }
     305                }
     306                return $rates;
     307            }
     308
    294309            function init() {
    295310                add_action('woocommerce_after_checkout_form', array( $this, 'redbox_create_modal_redbox'));
     
    307322                add_action( 'save_post', array($this, 'redbox_update_shipment'));
    308323                add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'redbox_add_button_print_label'));
     324                add_filter( 'woocommerce_package_rates', array($this, 'bbloomer_woocommerce_tiered_shipping'), 10, 2 );
    309325            }
    310326         
  • redbox-pickup/tags/1.17/readme.txt

    r2595446 r2617574  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.16
     7Stable tag: 1.17
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4343= 1.8 =
    4444Make page load list point after load checkout page.
     45= 1.17 =
     46Update the minimum order amount for free shipping
    4547
    4648
     
    5860= 1.14 =
    5961Update the name of shipping method
     62= 1.17 =
     63Update the minimum order amount for free shipping
    6064
    6165
  • redbox-pickup/tags/1.17/redbox.php

    r2595446 r2617574  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.16
     6        * Version: 1.17
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
     
    7575                "consumer_secret" => "Consumer secret",
    7676                "how_generate" => "Guide to generate API keys",
    77                 "print_shipping_label" => "Print label"
     77                "print_shipping_label" => "Print label",
     78                "min_total_price_for_free" => "Minimum order amount for free shipping"
    7879            ],
    7980            "ar" => [
     
    99100                "consumer_secret" => "Consumer secret",
    100101                "how_generate" => "Guide to generate API keys",
    101                 "print_shipping_label" => "Print label"
     102                "print_shipping_label" => "Print label",
     103                "min_total_price_for_free" => "Minimum order amount for free shipping"
    102104            ]
    103105        ]);
     
    117119            function redbox_load_scrip_and_style_front() {
    118120                wp_enqueue_style( 'redbox_font_awesome', 'https://pro.fontawesome.com/releases/v5.10.0/css/all.css' );
    119                 wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.12' );
     121                wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.17' );
    120122                wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' );
    121123                wp_enqueue_style( 'redbox_font_cario', 'https://fonts.googleapis.com/css?family=Cairo' );
    122                 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.16' );
     124                wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.17' );
    123125                wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&amp;sensor=false&amp;libraries=places' );
    124126                wp_enqueue_script( 'redbox_front_js_map_clustor', 'https://unpkg.com/@google/markerclustererplus@4.0.1/dist/markerclustererplus.min.js' );
  • redbox-pickup/trunk/admin/config.php

    r2374921 r2617574  
    4747                                            if(!empty(get_option( 'redbox_key' ))) {
    4848                                                echo get_option( 'redbox_key' );
     49                                            } else {
     50                                                echo "";
     51                                            }
     52                                        ?>"
     53                                        style="
     54                                            width: 100%;
     55                                            height: 35px;
     56                                            line-height: 35px;
     57                                        "
     58                                    >
     59                                </div>
     60                                <p style="font-size: 14px; margin: 10px 0px 5px 0px">
     61                                    <?php echo REDBOX_LANGUAGE[$this->lang]['min_total_price_for_free'] ?>
     62                                </p>
     63                                <div>
     64                                    <input type="number" min="0" step="any" name="min_price_for_free"
     65                                        value="<?php
     66                                            if(!empty(get_option( 'min_price_for_free' ))) {
     67                                                echo get_option( 'min_price_for_free' );
    4968                                            } else {
    5069                                                echo "";
     
    121140                                "store_url" => $storeUrl
    122141                            ];
     142                            if (isset($_POST['min_price_for_free'])) {
     143                                update_option('min_price_for_free', sanitize_text_field( $_REQUEST['min_price_for_free'] ), 'yes');
     144                            }
    123145                            if (isset($_POST['consumer_key'])) {
    124146                                $dataStore['consumer_key'] = $_POST['consumer_key'];
  • redbox-pickup/trunk/front/front.php

    r2551895 r2617574  
    55            public $lang;
    66            public $redboxKey;
     7            public $minimumAmount;
    78
    89            public function __construct(){
    910               $this->lang = get_locale() == "ar" ? "ar" : "en";
    10                $this->redboxKey = get_option('redbox_key');           
     11               $this->redboxKey = get_option('redbox_key');
     12               $this->minimumAmount = get_option('min_price_for_free') && is_numeric(get_option('min_price_for_free')) ?floatval(get_option('min_price_for_free')) : false;           
    1113            }
    1214
     
    292294            }
    293295
     296            function bbloomer_woocommerce_tiered_shipping( $rates, $package ) {
     297                if ($this->minimumAmount == false) {
     298                    return $rates;
     299                }
     300                $total = WC()->cart->subtotal;
     301                if ($total >= $this->minimumAmount) {
     302                    if ($rates["redbox_pickup_delivery"]) {
     303                        $rates["redbox_pickup_delivery"]->cost = 0;
     304                    }
     305                }
     306                return $rates;
     307            }
     308
    294309            function init() {
    295310                add_action('woocommerce_after_checkout_form', array( $this, 'redbox_create_modal_redbox'));
     
    307322                add_action( 'save_post', array($this, 'redbox_update_shipment'));
    308323                add_action( 'woocommerce_admin_order_data_after_shipping_address', array($this, 'redbox_add_button_print_label'));
     324                add_filter( 'woocommerce_package_rates', array($this, 'bbloomer_woocommerce_tiered_shipping'), 10, 2 );
    309325            }
    310326         
  • redbox-pickup/trunk/readme.txt

    r2595446 r2617574  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.16
     7Stable tag: 1.17
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4343= 1.8 =
    4444Make page load list point after load checkout page.
     45= 1.17 =
     46Update the minimum order amount for free shipping
    4547
    4648
     
    5860= 1.14 =
    5961Update the name of shipping method
     62= 1.17 =
     63Update the minimum order amount for free shipping
    6064
    6165
  • redbox-pickup/trunk/redbox.php

    r2595446 r2617574  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.16
     6        * Version: 1.17
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
     
    7575                "consumer_secret" => "Consumer secret",
    7676                "how_generate" => "Guide to generate API keys",
    77                 "print_shipping_label" => "Print label"
     77                "print_shipping_label" => "Print label",
     78                "min_total_price_for_free" => "Minimum order amount for free shipping"
    7879            ],
    7980            "ar" => [
     
    99100                "consumer_secret" => "Consumer secret",
    100101                "how_generate" => "Guide to generate API keys",
    101                 "print_shipping_label" => "Print label"
     102                "print_shipping_label" => "Print label",
     103                "min_total_price_for_free" => "Minimum order amount for free shipping"
    102104            ]
    103105        ]);
     
    117119            function redbox_load_scrip_and_style_front() {
    118120                wp_enqueue_style( 'redbox_font_awesome', 'https://pro.fontawesome.com/releases/v5.10.0/css/all.css' );
    119                 wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.12' );
     121                wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.17' );
    120122                wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' );
    121123                wp_enqueue_style( 'redbox_font_cario', 'https://fonts.googleapis.com/css?family=Cairo' );
    122                 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.16' );
     124                wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.17' );
    123125                wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&amp;sensor=false&amp;libraries=places' );
    124126                wp_enqueue_script( 'redbox_front_js_map_clustor', 'https://unpkg.com/@google/markerclustererplus@4.0.1/dist/markerclustererplus.min.js' );
Note: See TracChangeset for help on using the changeset viewer.