Changeset 3347096
- Timestamp:
- 08/19/2025 02:52:13 PM (5 months ago)
- Location:
- a2z-canada-post-automated-shipping
- Files:
-
- 32 added
- 4 edited
-
tags/3.0.2 (added)
-
tags/3.0.2/controllors (added)
-
tags/3.0.2/controllors/classes (added)
-
tags/3.0.2/controllors/classes/hit-box-packing.php (added)
-
tags/3.0.2/controllors/classes/index.php (added)
-
tags/3.0.2/controllors/classes/weight_pack (added)
-
tags/3.0.2/controllors/classes/weight_pack/class-hit-weight-packing-util.php (added)
-
tags/3.0.2/controllors/classes/weight_pack/class-hit-weight-packing.php (added)
-
tags/3.0.2/controllors/classes/weight_pack/class-hit-weight-strategy-ascend.php (added)
-
tags/3.0.2/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php (added)
-
tags/3.0.2/controllors/classes/weight_pack/class-hit-weight-strategy-simple.php (added)
-
tags/3.0.2/controllors/classes/weight_pack/index.php (added)
-
tags/3.0.2/controllors/hit_canadapost_auto_init.php (added)
-
tags/3.0.2/controllors/index.php (added)
-
tags/3.0.2/controllors/views (added)
-
tags/3.0.2/controllors/views/cp_logo.png (added)
-
tags/3.0.2/controllors/views/hit_canadapost_auto_settings_view.php (added)
-
tags/3.0.2/controllors/xml (added)
-
tags/3.0.2/controllors/xml/cacert.pem (added)
-
tags/3.0.2/controllors/xml/index.php (added)
-
tags/3.0.2/controllors/xml/label.xml (added)
-
tags/3.0.2/controllors/xml/rate.xml (added)
-
tags/3.0.2/controllors/xml/rateca.xml (added)
-
tags/3.0.2/controllors/xml/rateus.xml (added)
-
tags/3.0.2/controllors/xml/transmit.xml (added)
-
tags/3.0.2/hit_canadapost_auto_basic.php (added)
-
tags/3.0.2/i18n (added)
-
tags/3.0.2/i18n/index.php (added)
-
tags/3.0.2/i18n/languages (added)
-
tags/3.0.2/i18n/languages/index.php (added)
-
tags/3.0.2/index.php (added)
-
tags/3.0.2/readme.txt (added)
-
trunk/controllors/hit_canadapost_auto_init.php (modified) (2 diffs)
-
trunk/controllors/views/hit_canadapost_auto_settings_view.php (modified) (2 diffs)
-
trunk/hit_canadapost_auto_basic.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
a2z-canada-post-automated-shipping/trunk/controllors/hit_canadapost_auto_init.php
r3110727 r3347096 365 365 $parcel .= '<weight>'.$package['Weight']['Value'].'</weight>'; 366 366 $parcel .= '</parcel-characteristics>'; 367 368 // Build options XML if needed 369 $options_xml = ''; 370 if(isset($general_settings['hit_cp_auto_cod']) && $general_settings['hit_cp_auto_cod'] == 'yes' || 371 isset($general_settings['hit_cp_auto_sig_req']) && $general_settings['hit_cp_auto_sig_req'] == 'yes' || 372 (isset($general_settings['hit_cp_auto_ndh']) && $general_settings['hit_cp_auto_ndh'] !== 'N') || 373 (isset($general_settings['hit_cp_auto_insurance']) && $general_settings['hit_cp_auto_insurance'] == 'yes') || 374 (isset($general_settings['hit_cp_auto_hfp']) && $general_settings['hit_cp_auto_hfp'] == 'yes') || 375 (isset($general_settings['hit_cp_auto_dns']) && $general_settings['hit_cp_auto_dns'] == 'yes') || 376 (isset($general_settings['hit_cp_auto_lad']) && $general_settings['hit_cp_auto_lad'] == 'yes')) { 377 378 $options_xml = '<options>'; 379 380 // COD 381 if(isset($general_settings['hit_cp_auto_cod']) && $general_settings['hit_cp_auto_cod'] == 'yes') { 382 $options_xml .= '<option> 383 <option-code>COD</option-code> 384 <option-amount>'.round($package['InsuredValue']['Amount'],2).'</option-amount> 385 </option>'; 386 } 387 388 // Signature 389 if(isset($general_settings['hit_cp_auto_sig_req']) && $general_settings['hit_cp_auto_sig_req'] == 'yes') { 390 $options_xml .= '<option><option-code>SO</option-code></option>'; 391 } 392 393 // Non-Delivery Handling 394 $ndh = ''; 395 if(isset($general_settings['hit_cp_auto_ndh']) && $general_settings['hit_cp_auto_ndh'] !== 'N') { 396 $ndh = $general_settings['hit_cp_auto_ndh']; 397 } 398 if($des_coun == 'US') { 399 $ndh = 'RASE'; 400 } 401 if(!empty($ndh)) { 402 $options_xml .= '<option><option-code>'.$ndh.'</option-code></option>'; 403 } 404 405 // Insurance 406 if(isset($general_settings['hit_cp_auto_insurance']) && $general_settings['hit_cp_auto_insurance'] == 'yes') { 407 $options_xml .= '<option> 408 <option-code>COV</option-code> 409 <option-amount>'.round($package['InsuredValue']['Amount'],2).'</option-amount> 410 </option>'; 411 } 412 413 // Card for Pickup 414 if(isset($general_settings['hit_cp_auto_hfp']) && $general_settings['hit_cp_auto_hfp'] == 'yes') { 415 $options_xml .= '<option><option-code>HFP</option-code></option>'; 416 } 417 418 // Do Not Safe Drop 419 if(isset($general_settings['hit_cp_auto_dns']) && $general_settings['hit_cp_auto_dns'] == 'yes') { 420 $options_xml .= '<option><option-code>DNS</option-code></option>'; 421 } 422 423 // Leave at Door 424 if(isset($general_settings['hit_cp_auto_lad']) && $general_settings['hit_cp_auto_lad'] == 'yes') { 425 $options_xml .= '<option><option-code>LAD</option-code></option>'; 426 } 427 428 $options_xml .= '</options>'; 429 } 430 367 431 368 432 $cont_id = !empty($general_settings['hit_cp_auto_access_key']) ? '<contract-id>'.$general_settings['hit_cp_auto_access_key'].'</contract-id>' : ''; … … 372 436 $xmlRequest = str_replace('{$originPostalCode}',$general_settings['hit_cp_auto_zip'],$xmlRequest); 373 437 $xmlRequest = str_replace('{$postalCode}',strtoupper(str_replace(" ", "", $postalcode)),$xmlRequest); 438 439 // Add options if they exist 440 if(!empty($options_xml)) { 441 $xmlRequest = str_replace('</mailing-scenario>', $options_xml.'</mailing-scenario>', $xmlRequest); 442 } 374 443 375 444 // echo "<pre>"; -
a2z-canada-post-automated-shipping/trunk/controllors/views/hit_canadapost_auto_settings_view.php
r3178221 r3347096 601 601 $general_settings['hit_cp_auto_cod'] = sanitize_text_field(isset($_POST['hit_cp_auto_cod']) ? 'yes' :'no'); 602 602 $general_settings['hit_cp_auto_sig_req'] = sanitize_text_field(isset($_POST['hit_cp_auto_sig_req']) ? 'yes' :'no'); 603 604 $general_settings['hit_cp_auto_insurance'] = sanitize_text_field(isset($_POST['hit_cp_auto_insurance']) ? 'yes' :'no'); 605 $general_settings['hit_cp_auto_dns'] = sanitize_text_field(isset($_POST['hit_cp_auto_dns']) ? 'yes' :'no'); 606 $general_settings['hit_cp_auto_lad'] = sanitize_text_field(isset($_POST['hit_cp_auto_lad']) ? 'yes' :'no'); 607 $general_settings['hit_cp_auto_hfp'] = sanitize_text_field(isset($_POST['hit_cp_auto_hfp']) ? 'yes' :'no'); 608 603 609 $general_settings['hit_cp_auto_ndh'] = sanitize_text_field(isset($_POST['hit_cp_auto_ndh']) ? $_POST['hit_cp_auto_ndh'] : 'RTS'); 604 605 610 $general_settings['hit_cp_auto_sat'] = sanitize_text_field(isset($_POST['hit_cp_auto_sat']) ? 'yes' :'no'); 606 611 $general_settings['hit_cp_auto_ppt'] = sanitize_text_field(isset($_POST['hit_cp_auto_ppt']) ? 'yes' :'no'); … … 1158 1163 <table style="padding-left:10px;padding-right:10px;"> 1159 1164 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_cod" <?php echo (isset($general_settings['hit_cp_auto_cod']) && $general_settings['hit_cp_auto_cod'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Cash on Delivery.</small></span></td> 1165 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_sig_req" <?php echo (isset($general_settings['hit_cp_auto_sig_req']) && $general_settings['hit_cp_auto_sig_req'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Signature.</small></span></td> 1166 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_insurance" <?php echo (isset($general_settings['hit_cp_auto_insurance']) && $general_settings['hit_cp_auto_insurance'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Insurance.</small></span></td> 1167 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_dns" <?php echo (isset($general_settings['hit_cp_auto_dns']) && $general_settings['hit_cp_auto_dns'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Do not safe drop.</small></span></td> 1168 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_lad" <?php echo (isset($general_settings['hit_cp_auto_lad']) && $general_settings['hit_cp_auto_lad'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Leave at door.</small></span></td> 1169 <td><span style="float:left;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_hfp" <?php echo (isset($general_settings['hit_cp_auto_hfp']) && $general_settings['hit_cp_auto_hfp'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Card for pickup.</small></span></td> 1160 1170 <td><span style="float:right;padding-right:10px;"><input type="checkbox" name="hit_cp_auto_uostatus" <?php echo (isset($general_settings['hit_cp_auto_uostatus']) && $general_settings['hit_cp_auto_uostatus'] == 'yes') ? 'checked="true"' : ''; ?> value="yes" ><small style="color:gray"> Update order status by tracking</small></span></td> 1161 1171 </table></center> -
a2z-canada-post-automated-shipping/trunk/hit_canadapost_auto_basic.php
r3178221 r3347096 4 4 * Plugin URI: https://wordpress.org/plugins/a2z-canada-post-automated-shipping/#developers 5 5 * Description: Realtime Shipping Rates, Shipping label, commercial invoice automation included. 6 * Version: 3.0. 16 * Version: 3.0.2 7 7 * Author: Shipi 8 8 * Author URI: https://myshipi.com/ … … 262 262 263 263 // echo '</select>'; 264 265 echo '<br/><b>Signature</b>'; 266 echo '<br/><select name="hit_cp_auto_sig_req_m">'; 267 echo "<option value='N' " . ($general_settings['hit_cp_auto_sig_req'] == 'yes' ? '' : 'selected') . ">disabled</option>"; 268 echo "<option value='Y' " . ($general_settings['hit_cp_auto_sig_req'] == 'yes' ? 'selected' : '') . ">enabled</option>"; 269 echo '</select>'; 270 271 echo '<br/><b>Insurance</b>'; 272 echo '<br/><select name="hit_cp_auto_insurance_m">'; 273 echo "<option value='N' " . ($general_settings['hit_cp_auto_insurance'] == 'yes' ? '' : 'selected') . ">disabled</option>"; 274 echo "<option value='Y' " . ($general_settings['hit_cp_auto_insurance'] == 'yes' ? 'selected' : '') . ">enabled</option>"; 275 echo '</select>'; 276 277 echo '<br/><b>Do not safe drop</b>'; 278 echo '<br/><select name="hit_cp_auto_dns_m">'; 279 echo "<option value='N' " . ($general_settings['hit_cp_auto_dns'] == 'yes' ? '' : 'selected') . ">disabled</option>"; 280 echo "<option value='Y' " . ($general_settings['hit_cp_auto_dns'] == 'yes' ? 'selected' : '') . ">enabled</option>"; 281 echo '</select>'; 282 283 echo '<br/><b>Leave at door</b>'; 284 echo '<br/><select name="hit_cp_auto_lad_m">'; 285 echo "<option value='N' " . ($general_settings['hit_cp_auto_lad'] == 'yes' ? '' : 'selected') . ">disabled</option>"; 286 echo "<option value='Y' " . ($general_settings['hit_cp_auto_lad'] == 'yes' ? 'selected' : '') . ">enabled</option>"; 287 echo '</select>'; 288 289 echo '<br/><b>Card for pickup</b>'; 290 echo '<br/><select name="hit_cp_auto_hfp_m">'; 291 echo "<option value='N' " . ($general_settings['hit_cp_auto_hfp'] == 'yes' ? '' : 'selected') . ">disabled</option>"; 292 echo "<option value='Y' " . ($general_settings['hit_cp_auto_hfp'] == 'yes' ? 'selected' : '') . ">enabled</option>"; 293 echo '</select>'; 264 294 265 295 echo '<br/><b>Shipment Content</b>'; … … 567 597 "s_phone" => $general_settings['hit_cp_auto_mob_num'], 568 598 "s_email" => $general_settings['hit_cp_auto_email'], 569 "sig_req" => ($general_settings['hit_cp_auto_sig_req'] == 'yes') ? "Y" : "N", 599 "sig_req" => ($general_settings['hit_cp_auto_sig_req'] == 'yes') ? "Y" : "N", 600 "insurance" => ($general_settings['hit_cp_auto_insurance'] == 'yes') ? "Y" : "N", 601 "dns" => ($general_settings['hit_cp_auto_dns'] == 'yes') ? "Y" : "N", 602 "lad" => ($general_settings['hit_cp_auto_lad'] == 'yes') ? "Y" : "N", 603 "hfp" => ($general_settings['hit_cp_auto_hfp'] == 'yes') ? "Y" : "N", 570 604 "label_format" => "PDF", 571 605 "label_size" => $general_settings['hit_cp_auto_print_size'], … … 616 650 $service_code = str_replace("cp_","",$_POST['hit_cp_auto_service_code']); 617 651 $ship_content = !empty($_POST['hit_cp_auto_shipment_content']) ? $_POST['hit_cp_auto_shipment_content'] : 'Shipment Content'; 652 653 $sig_req = !empty($_POST['hit_cp_auto_sig_req_m']) ? $_POST['hit_cp_auto_sig_req_m'] : 'N'; 654 $insurance = !empty($_POST['hit_cp_auto_insurance_m']) ? $_POST['hit_cp_auto_insurance_m'] : 'N'; 655 $dns = !empty($_POST['hit_cp_auto_dns_m']) ? $_POST['hit_cp_auto_dns_m'] : 'N'; 656 $lad = !empty($_POST['hit_cp_auto_lad_m']) ? $_POST['hit_cp_auto_lad_m'] : 'N'; 657 $hfp = !empty($_POST['hit_cp_auto_hfp_m']) ? $_POST['hit_cp_auto_hfp_m'] : 'N'; 658 618 659 $order = wc_get_order( $order_id ); 619 660 if($order){ … … 749 790 "t_email" => $order_shipping_email, 750 791 "dutiable" => $general_settings['hit_cp_auto_duty_payment'], 751 "insurance" => $general_settings['hit_cp_auto_insure'],792 // "insurance" => $general_settings['hit_cp_auto_insure'], 752 793 "pack_this" => "Y", 753 794 "residential" => 'false', … … 777 818 "s_email" => $general_settings['hit_cp_auto_email'], 778 819 "label_format" => "PDF", 779 "sig_req" => ($general_settings['hit_cp_auto_sig_req'] == 'yes') ? "Y" : "N", 820 "sig_req" => $sig_req, 821 "insurance" => $insurance, 822 "dns" => $dns, 823 "lad" => $lad, 824 "hfp" => $hfp, 780 825 "label_size" => $general_settings['hit_cp_auto_print_size'], 781 826 "sent_email_to" => $general_settings['hit_cp_auto_label_email'], -
a2z-canada-post-automated-shipping/trunk/readme.txt
r3336110 r3347096 5 5 Tested up to: 6.8 6 6 Requires PHP: 5.6 7 Stable tag: 3.0. 17 Stable tag: 3.0.2 8 8 License: GPLv3 or later License 9 9 URI: http://www.gnu.org/licenses/gpl-3.0.html … … 80 80 81 81 == Changelog == 82 82 = 3.0.2 = 83 > Added New services in configuration page 83 84 = 3.0.1 = 84 85 > New Wordpress version tested
Note: See TracChangeset
for help on using the changeset viewer.