@@ -426,9 +426,14 @@ protected function _getXmlQuotes()
426
426
if (!$ service ) {
427
427
$ service = $ r ->getService ();
428
428
}
429
- if ($ r ->getContainer () == 'FLAT RATE BOX ' || $ r ->getContainer () == 'FLAT RATE ENVELOPE ' ) {
429
+
430
+ if (
431
+ strpos ($ r ->getContainer (), 'FLAT RATE ENVELOPE ' ) !== false ||
432
+ strpos ($ r ->getContainer (), 'FLAT RATE BOX ' ) !== false
433
+ ) {
430
434
$ service = 'Priority ' ;
431
435
}
436
+
432
437
$ package ->addChild ('Service ' , $ service );
433
438
434
439
// no matter Letter, Flat or Parcel, use Parcel
@@ -794,8 +799,15 @@ public function getCode($type, $code = '')
794
799
'first_class_mail_type ' => ['LETTER ' => __ ('Letter ' ), 'FLAT ' => __ ('Flat ' ), 'PARCEL ' => __ ('Parcel ' )],
795
800
'container ' => [
796
801
'VARIABLE ' => __ ('Variable ' ),
797
- 'FLAT RATE BOX ' => __ ('Flat-Rate Box ' ),
802
+ 'SM FLAT RATE BOX ' => __ ('Small Flat-Rate Box ' ),
803
+ 'MD FLAT RATE BOX ' => __ ('Medium Flat-Rate Box ' ),
804
+ 'LG FLAT RATE BOX ' => __ ('Large Flat-Rate Box ' ),
798
805
'FLAT RATE ENVELOPE ' => __ ('Flat-Rate Envelope ' ),
806
+ 'SM FLAT RATE ENVELOPE ' => __ ('Small Flat-Rate Envelope ' ),
807
+ 'WINDOW FLAT RATE ENVELOPE ' => __ ('Window Flat-Rate Envelope ' ),
808
+ 'GIFT CARD FLAT RATE ENVELOPE ' => __ ('Gift Card Flat-Rate Envelope ' ),
809
+ 'LEGAL FLAT RATE ENVELOPE ' => __ ('Legal Flat-Rate Envelope ' ),
810
+ 'PADDED FLAT RATE ENVELOPE ' => __ ('Padded Flat-Rate Envelope ' ),
799
811
'RECTANGULAR ' => __ ('Rectangular ' ),
800
812
'NONRECTANGULAR ' => __ ('Non-rectangular ' ),
801
813
],
@@ -805,104 +817,115 @@ public function getCode($type, $code = '')
805
817
'filters ' => [
806
818
'within_us ' => [
807
819
'method ' => [
808
- 'Priority Mail Express Flat Rate Envelope ' ,
809
- 'Priority Mail Express Flat Rate Envelope Hold For Pickup ' ,
810
- 'Priority Mail Flat Rate Envelope ' ,
811
- 'Priority Mail Large Flat Rate Box ' ,
812
- 'Priority Mail Medium Flat Rate Box ' ,
813
- 'Priority Mail Small Flat Rate Box ' ,
814
- 'Priority Mail Express Hold For Pickup ' ,
815
- 'Priority Mail Express ' ,
816
- 'Priority Mail ' ,
817
- 'Priority Mail Hold For Pickup ' ,
818
- 'Priority Mail Large Flat Rate Box Hold For Pickup ' ,
819
- 'Priority Mail Medium Flat Rate Box Hold For Pickup ' ,
820
- 'Priority Mail Small Flat Rate Box Hold For Pickup ' ,
821
- 'Priority Mail Flat Rate Envelope Hold For Pickup ' ,
822
- 'Priority Mail Small Flat Rate Envelope ' ,
823
- 'Priority Mail Small Flat Rate Envelope Hold For Pickup ' ,
824
- 'First-Class Package Service Hold For Pickup ' ,
825
- 'Retail Ground ' ,
826
- 'Media Mail ' ,
827
- 'First-Class Mail Large Envelope ' ,
828
- 'Priority Mail Express Sunday/Holiday Delivery ' ,
829
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope ' ,
830
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes ' ,
820
+ '13 ' , '27 ' , '16 ' , '22 ' , '17 ' , '28 ' , '2 ' , '3 ' , '1 ' , '33 ' , '34 ' , '35 ' ,
821
+ '36 ' , '37 ' , '42 ' , '43 ' , '53 ' , '4 ' , '6 ' , '15 ' , '23 ' , '25 ' , '57 '
831
822
],
832
823
],
833
824
'from_us ' => [
834
825
'method ' => [
835
- 'Priority Mail Express International Flat Rate Envelope ' ,
836
- 'Priority Mail International Flat Rate Envelope ' ,
837
- 'Priority Mail International Large Flat Rate Box ' ,
838
- 'Priority Mail International Medium Flat Rate Box ' ,
839
- 'Priority Mail International Small Flat Rate Box ' ,
840
- 'Priority Mail International Small Flat Rate Envelope ' ,
841
- 'Priority Mail Express International Flat Rate Boxes ' ,
842
- 'Global Express Guaranteed (GXG) ' ,
843
- 'USPS GXG Envelopes ' ,
844
- 'Priority Mail Express International ' ,
845
- 'Priority Mail International ' ,
846
- 'First-Class Mail International Letter ' ,
847
- 'First-Class Mail International Large Envelope ' ,
848
- 'First-Class Package International Service ' ,
826
+ 'INT_10 ' , 'INT_8 ' , 'INT_11 ' , 'INT_9 ' , 'INT_16 ' , 'INT_20 ' , 'INT_4 ' ,
827
+ 'INT_12 ' , 'INT_1 ' , 'INT_2 ' , 'INT_13 ' , 'INT_14 ' , 'INT_15 '
849
828
],
850
829
],
851
830
],
852
831
],
853
832
[
854
- 'containers ' => ['FLAT RATE BOX ' ],
833
+ 'containers ' => ['SM FLAT RATE BOX ' ],
855
834
'filters ' => [
856
835
'within_us ' => [
857
- 'method ' => [
858
- 'Priority Mail Large Flat Rate Box ' ,
859
- 'Priority Mail Medium Flat Rate Box ' ,
860
- 'Priority Mail Small Flat Rate Box ' ,
861
- 'Priority Mail International Large Flat Rate Box ' ,
862
- 'Priority Mail International Medium Flat Rate Box ' ,
863
- 'Priority Mail International Small Flat Rate Box ' ,
864
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes ' ,
865
- ],
836
+ 'method ' => ['28 ' , '57 ' ],
866
837
],
867
838
'from_us ' => [
868
- 'method ' => [
869
- 'Priority Mail International Large Flat Rate Box ' ,
870
- 'Priority Mail International Medium Flat Rate Box ' ,
871
- 'Priority Mail International Small Flat Rate Box ' ,
872
- 'Priority Mail International DVD Flat Rate priced box ' ,
873
- 'Priority Mail International Large Video Flat Rate priced box ' ,
874
- ],
839
+ 'method ' => ['INT_16 ' , 'INT_24 ' ],
840
+ ],
841
+ ]
842
+ ],
843
+ [
844
+ 'containers ' => ['MD FLAT RATE BOX ' ],
845
+ 'filters ' => [
846
+ 'within_us ' => [
847
+ 'method ' => ['17 ' , '57 ' ],
848
+ ],
849
+ 'from_us ' => [
850
+ 'method ' => ['INT_9 ' , 'INT_24 ' ],
851
+ ],
852
+ ]
853
+ ],
854
+ [
855
+ 'containers ' => ['LG FLAT RATE BOX ' ],
856
+ 'filters ' => [
857
+ 'within_us ' => [
858
+ 'method ' => ['22 ' , '57 ' ],
859
+ ],
860
+ 'from_us ' => [
861
+ 'method ' => ['INT_11 ' , 'INT_24 ' , 'INT_25 ' ],
862
+ ],
863
+ ]
864
+ ],
865
+ [
866
+ 'containers ' => ['SM FLAT RATE ENVELOPE ' ],
867
+ 'filters ' => [
868
+ 'within_us ' => [
869
+ 'method ' => ['42 ' , '43 ' ],
870
+ ],
871
+ 'from_us ' => [
872
+ 'method ' => ['INT_20 ' ],
873
+ ],
874
+ ]
875
+ ],
876
+ [
877
+ 'containers ' => ['WINDOW FLAT RATE ENVELOPE ' ],
878
+ 'filters ' => [
879
+ 'within_us ' => [
880
+ 'method ' => ['40 ' , '41 ' ],
881
+ ],
882
+ 'from_us ' => [
883
+ 'method ' => ['INT_19 ' ],
884
+ ],
885
+ ]
886
+ ],
887
+ [
888
+ 'containers ' => ['GIFT CARD FLAT RATE ENVELOPE ' ],
889
+ 'filters ' => [
890
+ 'within_us ' => [
891
+ 'method ' => ['38 ' , '39 ' ],
892
+ ],
893
+ 'from_us ' => [
894
+ 'method ' => ['INT_18 ' ],
895
+ ],
896
+ ]
897
+ ],
898
+ [
899
+ 'containers ' => ['PADDED FLAT RATE ENVELOPE ' ],
900
+ 'filters ' => [
901
+ 'within_us ' => [
902
+ 'method ' => ['62 ' , '63 ' , '64 ' , '46 ' , '29 ' ],
903
+ ],
904
+ 'from_us ' => [
905
+ 'method ' => ['INT_27 ' , 'INT_23 ' ],
906
+ ],
907
+ ]
908
+ ],
909
+ [
910
+ 'containers ' => ['LEGAL FLAT RATE ENVELOPE ' ],
911
+ 'filters ' => [
912
+ 'within_us ' => [
913
+ 'method ' => ['44 ' , '45 ' , '30 ' , '31 ' , '32 ' ],
914
+ ],
915
+ 'from_us ' => [
916
+ 'method ' => ['INT_17 ' , 'INT_22 ' ],
875
917
],
876
918
]
877
919
],
878
920
[
879
921
'containers ' => ['FLAT RATE ENVELOPE ' ],
880
922
'filters ' => [
881
923
'within_us ' => [
882
- 'method ' => [
883
- 'Priority Mail Flat Rate Envelope ' ,
884
- 'Priority Mail Express Flat Rate Envelope ' ,
885
- 'Priority Mail Express Flat Rate Envelope Hold For Pickup ' ,
886
- 'Priority Mail Flat Rate Envelope ' ,
887
- 'First-Class Mail Large Envelope ' ,
888
- 'Priority Mail Flat Rate Envelope Hold For Pickup ' ,
889
- 'Priority Mail Small Flat Rate Envelope ' ,
890
- 'Priority Mail Small Flat Rate Envelope Hold For Pickup ' ,
891
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope ' ,
892
- 'Priority Mail Express Padded Flat Rate Envelope ' ,
893
- ],
924
+ 'method ' => ['16 ' , '13 ' , '27 ' , '16 ' , '15 ' , '37 ' , '42 ' , '43 ' , '25 ' , '62 ' ],
894
925
],
895
926
'from_us ' => [
896
927
'method ' => [
897
- 'Priority Mail Express International Flat Rate Envelope ' ,
898
- 'Priority Mail International Flat Rate Envelope ' ,
899
- 'First-Class Mail International Large Envelope ' ,
900
- 'Priority Mail International Small Flat Rate Envelope ' ,
901
- 'Priority Mail Express International Legal Flat Rate Envelope ' ,
902
- 'Priority Mail International Gift Card Flat Rate Envelope ' ,
903
- 'Priority Mail International Window Flat Rate Envelope ' ,
904
- 'Priority Mail International Legal Flat Rate Envelope ' ,
905
- 'Priority Mail Express International Padded Flat Rate Envelope ' ,
928
+ 'INT_10 ' , 'INT_8 ' , 'INT_14 ' , 'INT_20 ' , 'INT_17 ' , 'INT_18 ' , 'INT_19 ' , 'INT_22 ' , 'INT_27 '
906
929
],
907
930
],
908
931
]
@@ -911,44 +934,21 @@ public function getCode($type, $code = '')
911
934
'containers ' => ['RECTANGULAR ' ],
912
935
'filters ' => [
913
936
'within_us ' => [
914
- 'method ' => [
915
- 'Priority Mail Express ' ,
916
- 'Priority Mail ' ,
917
- 'Retail Ground ' ,
918
- 'Media Mail ' ,
919
- 'Library Mail ' ,
920
- 'First-Class Package Service ' ,
921
- ],
937
+ 'method ' => ['3 ' , '1 ' , '4 ' , '6 ' , '7 ' , '61 ' ],
922
938
],
923
939
'from_us ' => [
924
- 'method ' => [
925
- 'USPS GXG Envelopes ' ,
926
- 'Priority Mail Express International ' ,
927
- 'Priority Mail International ' ,
928
- 'First-Class Package International Service ' ,
929
- ],
940
+ 'method ' => ['INT_12 ' , 'INT_1 ' , 'INT_2 ' , 'INT_15 ' ],
930
941
],
931
942
]
932
943
],
933
944
[
934
945
'containers ' => ['NONRECTANGULAR ' ],
935
946
'filters ' => [
936
947
'within_us ' => [
937
- 'method ' => [
938
- 'Priority Mail Express ' ,
939
- 'Priority Mail ' ,
940
- 'Retail Ground ' ,
941
- 'Media Mail ' ,
942
- 'Library Mail ' ,
943
- ],
948
+ 'method ' => ['3 ' , '1 ' , '4 ' , '6 ' , '7 ' ],
944
949
],
945
950
'from_us ' => [
946
- 'method ' => [
947
- 'Global Express Guaranteed (GXG) ' ,
948
- 'Priority Mail Express International ' ,
949
- 'Priority Mail International ' ,
950
- 'First-Class Package International Service ' ,
951
- ],
951
+ 'method ' => ['INT_4 ' , 'INT_1 ' , 'INT_2 ' , 'INT_15 ' ],
952
952
],
953
953
]
954
954
],
0 commit comments