Changeset 2617574
- Timestamp:
- 10/21/2021 06:04:34 AM (4 years ago)
- Location:
- redbox-pickup
- Files:
-
- 5 edited
- 6 copied
-
tags/1.17 (copied) (copied from redbox-pickup/trunk)
-
tags/1.17/admin/config.php (modified) (2 diffs)
-
tags/1.17/css/front.css (copied) (copied from redbox-pickup/trunk/css/front.css)
-
tags/1.17/front/front.php (copied) (copied from redbox-pickup/trunk/front/front.php) (3 diffs)
-
tags/1.17/js/front.js (copied) (copied from redbox-pickup/trunk/js/front.js)
-
tags/1.17/readme.txt (copied) (copied from redbox-pickup/trunk/readme.txt) (3 diffs)
-
tags/1.17/redbox.php (copied) (copied from redbox-pickup/trunk/redbox.php) (4 diffs)
-
trunk/admin/config.php (modified) (2 diffs)
-
trunk/front/front.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/redbox.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
redbox-pickup/tags/1.17/admin/config.php
r2374921 r2617574 47 47 if(!empty(get_option( 'redbox_key' ))) { 48 48 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' ); 49 68 } else { 50 69 echo ""; … … 121 140 "store_url" => $storeUrl 122 141 ]; 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 } 123 145 if (isset($_POST['consumer_key'])) { 124 146 $dataStore['consumer_key'] = $_POST['consumer_key']; -
redbox-pickup/tags/1.17/front/front.php
r2551895 r2617574 5 5 public $lang; 6 6 public $redboxKey; 7 public $minimumAmount; 7 8 8 9 public function __construct(){ 9 10 $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; 11 13 } 12 14 … … 292 294 } 293 295 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 294 309 function init() { 295 310 add_action('woocommerce_after_checkout_form', array( $this, 'redbox_create_modal_redbox')); … … 307 322 add_action( 'save_post', array($this, 'redbox_update_shipment')); 308 323 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 ); 309 325 } 310 326 -
redbox-pickup/tags/1.17/readme.txt
r2595446 r2617574 5 5 Requires at least: 3.3 6 6 Tested up to: 5.5.1 7 Stable tag: 1.1 67 Stable tag: 1.17 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 43 43 = 1.8 = 44 44 Make page load list point after load checkout page. 45 = 1.17 = 46 Update the minimum order amount for free shipping 45 47 46 48 … … 58 60 = 1.14 = 59 61 Update the name of shipping method 62 = 1.17 = 63 Update the minimum order amount for free shipping 60 64 61 65 -
redbox-pickup/tags/1.17/redbox.php
r2595446 r2617574 4 4 * Description: This plugin allows customers pickup package at RedBox Locker. 5 5 * Plugin URI: https://woocommerce.com/ 6 * Version: 1.1 66 * Version: 1.17 7 7 * Author: RedBox 8 8 * Author URI: https://redboxsa.com … … 75 75 "consumer_secret" => "Consumer secret", 76 76 "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" 78 79 ], 79 80 "ar" => [ … … 99 100 "consumer_secret" => "Consumer secret", 100 101 "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" 102 104 ] 103 105 ]); … … 117 119 function redbox_load_scrip_and_style_front() { 118 120 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.1 2' );121 wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.17' ); 120 122 wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' ); 121 123 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.1 6' );124 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.17' ); 123 125 wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&sensor=false&libraries=places' ); 124 126 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 47 47 if(!empty(get_option( 'redbox_key' ))) { 48 48 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' ); 49 68 } else { 50 69 echo ""; … … 121 140 "store_url" => $storeUrl 122 141 ]; 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 } 123 145 if (isset($_POST['consumer_key'])) { 124 146 $dataStore['consumer_key'] = $_POST['consumer_key']; -
redbox-pickup/trunk/front/front.php
r2551895 r2617574 5 5 public $lang; 6 6 public $redboxKey; 7 public $minimumAmount; 7 8 8 9 public function __construct(){ 9 10 $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; 11 13 } 12 14 … … 292 294 } 293 295 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 294 309 function init() { 295 310 add_action('woocommerce_after_checkout_form', array( $this, 'redbox_create_modal_redbox')); … … 307 322 add_action( 'save_post', array($this, 'redbox_update_shipment')); 308 323 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 ); 309 325 } 310 326 -
redbox-pickup/trunk/readme.txt
r2595446 r2617574 5 5 Requires at least: 3.3 6 6 Tested up to: 5.5.1 7 Stable tag: 1.1 67 Stable tag: 1.17 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 43 43 = 1.8 = 44 44 Make page load list point after load checkout page. 45 = 1.17 = 46 Update the minimum order amount for free shipping 45 47 46 48 … … 58 60 = 1.14 = 59 61 Update the name of shipping method 62 = 1.17 = 63 Update the minimum order amount for free shipping 60 64 61 65 -
redbox-pickup/trunk/redbox.php
r2595446 r2617574 4 4 * Description: This plugin allows customers pickup package at RedBox Locker. 5 5 * Plugin URI: https://woocommerce.com/ 6 * Version: 1.1 66 * Version: 1.17 7 7 * Author: RedBox 8 8 * Author URI: https://redboxsa.com … … 75 75 "consumer_secret" => "Consumer secret", 76 76 "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" 78 79 ], 79 80 "ar" => [ … … 99 100 "consumer_secret" => "Consumer secret", 100 101 "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" 102 104 ] 103 105 ]); … … 117 119 function redbox_load_scrip_and_style_front() { 118 120 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.1 2' );121 wp_enqueue_style( 'redbox_front_css', REDBOX_PLUGIN_DIR . '/css/front.css', false, '1.0.17' ); 120 122 wp_enqueue_style( 'redbox_font_roboto', 'https://fonts.googleapis.com/css?family=Roboto' ); 121 123 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.1 6' );124 wp_enqueue_script( 'redbox_front_js', REDBOX_PLUGIN_DIR . '/js/front.js', false, '1.0.17' ); 123 125 wp_enqueue_script( 'redbox_front_js_map', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBY1xlGe6jLbugOJegCsUGnzlufYWa5CRw&sensor=false&libraries=places' ); 124 126 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.