Changeset 2678892
- Timestamp:
- 02/15/2022 08:50:32 AM (4 years ago)
- Location:
- logisnap
- Files:
-
- 37 added
- 3 edited
-
tags/1.0.2 (added)
-
tags/1.0.2/LogiSnap.php (added)
-
tags/1.0.2/includes (added)
-
tags/1.0.2/includes/class-lss-actions.php (added)
-
tags/1.0.2/includes/class-lss-admin.php (added)
-
tags/1.0.2/includes/class-lss-api-client-response.php (added)
-
tags/1.0.2/includes/class-lss-api-client.php (added)
-
tags/1.0.2/includes/class-lss-carriers.php (added)
-
tags/1.0.2/includes/class-lss-notices.php (added)
-
tags/1.0.2/includes/class-lss-options.php (added)
-
tags/1.0.2/includes/class-lss-shipping.php (added)
-
tags/1.0.2/includes/class-lss-woocommerce.php (added)
-
tags/1.0.2/includes/index.php (added)
-
tags/1.0.2/includes/persist-admin-notices-dismissal.php (added)
-
tags/1.0.2/index.php (added)
-
tags/1.0.2/public (added)
-
tags/1.0.2/public/css (added)
-
tags/1.0.2/public/css/style.css (added)
-
tags/1.0.2/public/images (added)
-
tags/1.0.2/public/images/carriers (added)
-
tags/1.0.2/public/images/carriers/airmee.png (added)
-
tags/1.0.2/public/images/carriers/bring.png (added)
-
tags/1.0.2/public/images/carriers/burd.png (added)
-
tags/1.0.2/public/images/carriers/danske_fragtmaend.png (added)
-
tags/1.0.2/public/images/carriers/dao.png (added)
-
tags/1.0.2/public/images/carriers/gls.png (added)
-
tags/1.0.2/public/images/carriers/misc.png (added)
-
tags/1.0.2/public/images/carriers/postnord.png (added)
-
tags/1.0.2/public/images/carriers/pstnord.png (added)
-
tags/1.0.2/public/images/carriers/srt.png (added)
-
tags/1.0.2/public/images/logo.png (added)
-
tags/1.0.2/public/js (added)
-
tags/1.0.2/public/js/dismiss-notice.js (added)
-
tags/1.0.2/public/js/pickup-points.js (added)
-
tags/1.0.2/readme.txt (added)
-
tags/1.0.2/translations (added)
-
tags/1.0.2/translations/index.php (added)
-
trunk/LogiSnap.php (modified) (2 diffs)
-
trunk/includes/class-lss-shipping.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
logisnap/trunk/LogiSnap.php
r2672047 r2678892 3 3 * Plugin Name: LogiSnap 4 4 * Description: Easily integrate your LogiSnap solution into Woocommerce. 5 * Version: 1.0. 15 * Version: 1.0.2 6 6 * Author: LogiSnap 7 7 * Author URI: //LogiSnap.com … … 29 29 30 30 /** @var $*/ 31 public $version = '1.0. 1';31 public $version = '1.0.2'; 32 32 33 33 /** @var LSS_Options */ -
logisnap/trunk/includes/class-lss-shipping.php
r2597913 r2678892 101 101 102 102 $this->instance_form_fields['carrier'] = [ 103 'title' => __( 'S hipping Method', 'logisnap-shipping-for-woocommerce' ),103 'title' => __( 'Select Carrier', 'logisnap-shipping-for-woocommerce' ), 104 104 'type' => 'select', 105 105 'class' => '', 106 'description' => __( 'Which carrier this shipping method should apply to', 'logisnap-shipping-for-woocommerce' ),107 106 'options' => $options 108 107 ]; 109 108 110 109 $this->instance_form_fields['type'] = [ 111 'title' => __( ' Product', 'logisnap-shipping-for-woocommerce' ),110 'title' => __( 'Shipment Type', 'logisnap-shipping-for-woocommerce' ), 112 111 'type' => 'select', 113 112 'class' => 'lss_product_type_field', 114 'description' => __( 'Which Carrier product type to use', 'logisnap-shipping-for-woocommerce' ),115 113 'options' => $type_options 116 114 ]; … … 118 116 119 117 $this->instance_form_fields['cost'] = [ 120 'title' => __( ' Cost', 'woocommerce' ),118 'title' => __( 'Shipping Price', 'woocommerce' ), 121 119 'type' => 'text', 122 120 'placeholder' => '', … … 134 132 ]; 135 133 134 $this->instance_form_fields['reduce_shipping_price'] = [ 135 'title' => __( 'Reduce Shipping Price By %', 'woocommerce' ), 136 'type' => 'text', 137 'placeholder' => '', 138 'default' => '0', 139 'sanitize_callback' => array( $this, 'sanitize_cost' ) 140 ]; 141 142 143 $this->instance_form_fields['reduce_shipping_price_condition'] = [ 144 'title' => __( 'Condition', 'woocommerce' ), 145 'type' => 'select', 146 'placeholder' => '', 147 'default' => '0', 148 'sanitize_callback' => array( $this, 'sanitize_cost' ), 149 'options' => $this->get_conditions() 150 ]; 151 152 $this->instance_form_fields['reduce_shipping_condition_amount'] = [ 153 'title' => __( 'Amount', 'woocommerce' ), 154 'type' => 'text', 155 'placeholder' => '', 156 'default' => '0', 157 'sanitize_callback' => array( $this, 'sanitize_cost' ) 158 ]; 159 136 160 // when changing position 137 161 // change index in admin enque js 162 // 'When cart is below a price', 163 // 'When cart is above a price', 138 164 $coupon_optionsArray = [ 139 'When cart is below a price',140 'When cart is above a price',141 165 'Cut shipping price by procent', 142 166 'Cut shipping price by amount', … … 149 173 'type' => 'select', 150 174 'class' => 'lss_coupon_options_field', 151 'description' => __( 'What should happen when free coupon is applied',152 'logisnap-shipping-for-woocommerce' ),153 175 'options' => $coupon_optionsArray, 154 176 'sanitize_callback' => array( $this, 'sanitize_cost' ) … … 164 186 ]; 165 187 } 188 } 189 190 function get_conditions(){ 191 // when changing position 192 // change index in admin enque js 193 $condiction = [ 194 'When cart is above amount', 195 'When cart is below amount' 196 ]; 197 return $condiction; 166 198 } 167 199 … … 317 349 } 318 350 351 $reduce_choice = $this->get_option('reduce_shipping_price_condition'); 352 $cart_price = $package['contents_cost']; 353 354 355 if($reduce_choice == 0){ 356 $reduce_amount = $this->get_option( 'reduce_shipping_price' ); 357 $reduce_condition_amount = $this->get_option( 'reduce_shipping_condition_amount' ); 358 359 if($reduce_condition_amount < $cart_price) 360 $rate['cost'] -= ($rate['cost'] / 100) * $reduce_amount; 361 } 362 else if($reduce_choice == 1){ 363 $reduce_amount = $this->get_option( 'reduce_shipping_price' ); 364 $reduce_condition_amount = $this->get_option( 'reduce_shipping_condition_amount' ); 365 366 if($reduce_condition_amount > $cart_price) 367 $rate['cost'] -= ($rate['cost'] / 100) * $reduce_amount; 368 } 369 370 319 371 if($free_shipping_coupon) 320 372 { 321 373 $coupon_choice = $this->get_option( 'coupon_options' ); 322 $cart_price = $package['contents_cost'];323 374 324 375 if($coupon_choice == 0) 325 {326 // check if the price is lower then selected327 if($this->get_option( 'coupon_amount' ) > $cart_price)328 $rate['cost'] = 0;329 }330 else if($coupon_choice == 1)331 {332 // check if the price is higher then selected333 if($this->get_option( 'coupon_amount' ) < $cart_price)334 $rate['cost'] = 0;335 }336 else if($coupon_choice == 2)337 376 { 338 377 $rate['cost'] -= ($rate['cost'] / 100) * $this->get_option( 'coupon_amount' ); 339 378 } 340 else if($coupon_choice == 3){379 else if($coupon_choice == 1){ 341 380 342 381 $rate['cost'] -= $this->get_option( 'coupon_amount' ); 343 382 } 344 else if($coupon_choice == 4){383 else if($coupon_choice == 2){ 345 384 346 385 $rate['cost'] = 0; … … 426 465 // if free shipping is selected hide the amount field 427 466 // or if dont apply free coupon is selected 428 if(valueOption == 4 || valueOption == 5){467 if(valueOption == 2 || valueOption == 3){ 429 468 minAmountField.hide(); 430 469 -
logisnap/trunk/readme.txt
r2672041 r2678892 5 5 Requires at least: 5.0 6 6 Tested up to: 5.8 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 Requires PHP: 5.6.0 9 9 Requires WooCommerce: 3.0.0 … … 23 23 24 24 == Changelog == 25 26 = 1.0.2 = 27 * Added more options for the shipping methods 28 * Updated shipment method pop up 29 25 30 = 1.0.1 = 26 31 * Updated endpoints
Note: See TracChangeset
for help on using the changeset viewer.