Changeset 3255617
- Timestamp:
- 03/13/2025 09:25:56 PM (13 months ago)
- Location:
- sendbox-shipping
- Files:
-
- 46 added
- 3 edited
-
tags/5.1 (added)
-
tags/5.1/LICENSE.txt (added)
-
tags/5.1/README.md (added)
-
tags/5.1/README.txt (added)
-
tags/5.1/admin (added)
-
tags/5.1/admin/class-wooss-admin.php (added)
-
tags/5.1/admin/css (added)
-
tags/5.1/admin/css/wooss-admin.css (added)
-
tags/5.1/admin/images (added)
-
tags/5.1/admin/images/loader.gif (added)
-
tags/5.1/admin/index.php (added)
-
tags/5.1/admin/js (added)
-
tags/5.1/admin/js/wooss-admin.js (added)
-
tags/5.1/admin/partials (added)
-
tags/5.1/admin/partials/wooss-admin-display.php (added)
-
tags/5.1/includes (added)
-
tags/5.1/includes/assets (added)
-
tags/5.1/includes/assets/css (added)
-
tags/5.1/includes/assets/css/styles.css (added)
-
tags/5.1/includes/assets/js (added)
-
tags/5.1/includes/assets/js/jqueryserilize.js (added)
-
tags/5.1/includes/assets/js/script.js (added)
-
tags/5.1/includes/class-wooss-activator.php (added)
-
tags/5.1/includes/class-wooss-deactivator.php (added)
-
tags/5.1/includes/class-wooss-i18n.php (added)
-
tags/5.1/includes/class-wooss-loader.php (added)
-
tags/5.1/includes/class-wooss-sendbox-shipping-api.php (added)
-
tags/5.1/includes/class-wooss-shipping-method.php (added)
-
tags/5.1/includes/class-wooss.php (added)
-
tags/5.1/includes/index.php (added)
-
tags/5.1/index.php (added)
-
tags/5.1/languages (added)
-
tags/5.1/languages/wooss-en_US.mo (added)
-
tags/5.1/languages/wooss-en_US.po (added)
-
tags/5.1/languages/wooss.pot (added)
-
tags/5.1/public (added)
-
tags/5.1/public/class-wooss-public.php (added)
-
tags/5.1/public/css (added)
-
tags/5.1/public/css/wooss-public.css (added)
-
tags/5.1/public/index.php (added)
-
tags/5.1/public/js (added)
-
tags/5.1/public/js/wooss-public.js (added)
-
tags/5.1/public/partials (added)
-
tags/5.1/public/partials/wooss-public-display.php (added)
-
tags/5.1/uninstall.php (added)
-
tags/5.1/wooss.php (added)
-
trunk/README.txt (modified) (1 diff)
-
trunk/includes/class-wooss-shipping-method.php (modified) (1 diff)
-
trunk/wooss.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sendbox-shipping/trunk/README.txt
r3217295 r3255617 1 1 === Sendbox-Shipping === 2 Contributors: Sendbox, Adejoke Haastrup,jastrup2 Contributors: Sendbox, jastrup 3 3 Donate link: # 4 4 Tags: shipping, shipping zones, local shipping, international shipping 5 5 Requires at least: 6.5.4 6 6 Tested up to: 6.7 7 Stable tag: 5. 07 Stable tag: 5.1 8 8 Requires PHP: 8.0 9 9 License: GPLv2 or later -
sendbox-shipping/trunk/includes/class-wooss-shipping-method.php
r3157691 r3255617 220 220 ); 221 221 222 $delivery_quotes_details = wooss_calculate_shipping( $api_call, $payload_array_data, $auth_header ); 223 224 225 226 /* $wooss_rates_type = $sendbox_data['wooss_rates_type']; 227 if ( 'maximum' == $wooss_rates_type && isset( $delivery_quotes_details->max_quoted_fee ) ) { 228 $quotes_fee = $delivery_quotes_details->max_quoted_fee; 229 } elseif ( 'minimum' == $wooss_rates_type && isset( $delivery_quotes_details->min_quoted_fee ) ) { 230 $quotes_fee = $delivery_quotes_details->min_quoted_fee; 231 } 232 */ 233 234 //updating based on the sendbox new change to pass service code response change now returns rate.fee September 25th 2024 235 236 $wooss_rates_type = $sendbox_data['wooss_rates_type']; 237 if ( 'maximum' == $wooss_rates_type && isset( $delivery_quotes_details->rate) ) { 238 $quotes_fee = $delivery_quotes_details->rate->fee; 239 } elseif ( 'minimum' == $wooss_rates_type && isset( $delivery_quotes_details->rate ) ) { 240 $quotes_fee = $delivery_quotes_details->rate->fee; 241 } 242 243 244 245 $quoted_fee = $quotes_fee + $wooss_extra_fees; 246 247 248 /* 249 $destination_country = "United States of America"; 250 $destination_state = "Washington"; 251 $destination_city = "New York"; 252 $destination_postcode = "10001"; */ 253 $payload_array_data['destination_country'] = $destination_country; 254 $payload_array_data['destination_state'] = $destination_state; 255 $payload_array_data['destination_city'] = $destination_city; 256 $payload_array_data['currency'] = $currency; 257 258 /* if ( (int)$quoted_fee == 0 ) { 259 $delivery_quotes_details = wooss_calculate_shipping( $api_call, $payload_array_data, $auth_header ); 260 if ( 'maximum' == $wooss_rates_type && isset( $delivery_quotes_details->max_quoted_fee ) ) { 261 $quotes_fee = $delivery_quotes_details->max_quoted_fee; 262 } elseif ( 'minimum' == $wooss_rates_type && isset( $delivery_quotes_details->min_quoted_fee ) ) { 263 $quotes_fee = $delivery_quotes_details->min_quoted_fee; 264 } 265 266 $quoted_fee = $quotes_fee + $wooss_extra_fees; 267 } */ 268 269 270 271 //updating based on the sendbox new change to pass service code response now returns rate.fee September 25th 2024 272 273 274 if ( (int)$quoted_fee == 0 ) { 275 $delivery_quotes_details = wooss_calculate_shipping( $api_call, $payload_array_data, $auth_header ); 276 if ( 'maximum' == $wooss_rates_type && isset( $delivery_quotes_details->rate ) ) { 277 $quotes_fee = $delivery_quotes_details->rate->fee; 278 } elseif ( 'minimum' == $wooss_rates_type && isset( $delivery_quotes_details->rate ) ) { 279 $quotes_fee = $delivery_quotes_details->rate->fee; 280 } 281 282 $quoted_fee = $quotes_fee + $wooss_extra_fees; 283 } 284 285 $new_rate = array( 286 'id' => $this->id, 287 'label' => $this->title, 288 'cost' => $quoted_fee, 289 'package' => $package, 290 ); 291 292 $this->add_rate( $new_rate ); 293 } 222 $delivery_quotes_details = wooss_calculate_shipping( $api_call, $payload_array_data, $auth_header ); 223 224 // Check if rates is set and is an array 225 if ( isset( $delivery_quotes_details->rates ) && is_array( $delivery_quotes_details->rates ) ) { 226 227 // Loop through each rate option and add it as a shipping rate 228 foreach ( $delivery_quotes_details->rates as $rate ) { 229 // Calculate the total fee with any extra fees 230 $quoted_fee = $rate->fee + $wooss_extra_fees; 231 232 // Build the label. For example, you can append the service code or name if available. 233 // Adjust the label formatting as needed. 234 $label = $this->title; 235 if ( isset( $rate->service_code ) && !empty( $rate->service_code ) ) { 236 $label .= ' - ' . $rate->service_code; 237 } elseif ( isset( $rate->service_name ) && !empty( $rate->service_name ) ) { 238 $label .= ' - ' . $rate->service_name; 239 } 240 241 $new_rate = array( 242 'id' => $this->id, 243 'label' => $label, 244 'cost' => $quoted_fee, 245 'package' => $package, 246 ); 247 248 $this->add_rate( $new_rate ); 249 } 250 251 } else { 252 // Fallback in case the API response doesn't contain a rates array 253 $wooss_rates_type = $sendbox_data['wooss_rates_type']; 254 if ( 'maximum' == $wooss_rates_type && isset( $delivery_quotes_details->rate ) ) { 255 $quotes_fee = $delivery_quotes_details->rate->fee; 256 } elseif ( 'minimum' == $wooss_rates_type && isset( $delivery_quotes_details->rate ) ) { 257 $quotes_fee = $delivery_quotes_details->rate->fee; 258 } 259 $quoted_fee = $quotes_fee + $wooss_extra_fees; 260 261 $new_rate = array( 262 'id' => $this->id, 263 'label' => $this->title, 264 'cost' => $quoted_fee, 265 'package' => $package, 266 ); 267 268 $this->add_rate( $new_rate ); 269 } } 294 270 } 295 271 } -
sendbox-shipping/trunk/wooss.php
r3217295 r3255617 16 16 * Plugin URI: # 17 17 * Description: A Sendbox WooCommerce shipping plugin that enables you ship from your store to anywhere in the world. 18 * Version: 5. 018 * Version: 5.1 19 19 * Author: sendbox 20 20 * Author URI: https://sendbox.ng/ … … 35 35 * Rename this for your plugin and update it as you release new versions. 36 36 */ 37 define('WOOSS_VERSION', '5. 0');37 define('WOOSS_VERSION', '5.1'); 38 38 39 39 /**
Note: See TracChangeset
for help on using the changeset viewer.