Hey Rod
I've made some changes and now have letter rates working nicely. I have some not so friendly workarounds for the 'stacked' method for multiple items in a letter but I would really like to try and address this better in the code itself. As I don't know PHP code I have been working on some VBA methods but I still need to do a lot more work before I can offer a viable solution that could be recoded in PHP. I'll report back on this latter.
Following is a summary of the updates/changes I made to austpost.php v1.5.3 (../includes/moduels/shipping/):
...added .01 to dims to ensure exact max accepted i.e., H=2cm is still a letter. Small Letter sweight 250 i/o 2500.
Code:
/////////////// check for letter size ////
if( ($var[2] < 24) && ($var[1] < 13) && ($var[0] < 0.5) && ($sweight < 250) ) { $lr = 1 ; $lrt = " - Small letter" ;}
else {
if( ($var[2] < 36.01) && ($var[1] < 26.01) && ($var[0] < 2.01) ) {
...there was something wrong with the syntax of your code suggestion earlier, but since I was updating with v1.5.3 I noticed what you had done similarly and changed it somewhat as it still didn't work as expected. Note where I commented out your line and replaced with the two following lines.
Code:
/// too large for letter, but may be too small for drc server (minimum = 50x50x30)
$var = array($swidth, $slength, $sheight) ;
sort($var) ;
/////print_r($var) ; // meet minimum requirements
// if (($var[0] < 50) && ($var[1] < 50)) {$var[0] = 50 ; $var[1] = 50 ;}
if ($var[0] < 50) {$var[0] = 50 ;}
if ($var[1] < 50) {$var[1] = 50 ;}
//if ($var[2] < 50) {$var[2] = 50 ;}
I suggest you scrutinise the changes above and consider incorporating them into your next update.
Additionally, I have changed my 'Default Parcel Size' to L5xW5xH2 (H2 being the most important), as the code uses the max dimension of Item and Default. If any of the defaults are outside the 'Letter' max dimensions, Letter size is not available. My suggestion to 'letter' people would be to specify the max letter dimensions... L36 W26 H2 (requires the .01 addition to dimensions in code above too, otherwise specify defaults as L36.01 W26.01 H2.01)
[EDIT: The above (default parcel size) and below (Height) workarounds assume that you have ACCURATE DIMENSIONS SPECIFIED FOR ALL PRODUCTS! If not, you could be quoting letter rates for your light but LARGE boxes ;) ]
For the stacking problem, I will use a workaround along the lines of the following:
- Very small and 'thin' (<20mm) items that could be packed up to 10 to a large envelope, Height specified as 2cm/8 (to be safe)
- Small and 'thin' (<20mm) items that could be packed up to 6 to a large envelope, Height specified as 2cm/5 (to be safe)
- Medium 15-20mm items that could be packed up to 4 to a large envelope, Height specified as 2cm/2 (being very safe).
Although this is less than ideal, it is much better than asking $10 for freight where it costs $1 (many of my poor young customers will appreciate this, especially when they are only spending $10! ;)). I will be scrutinising my products further to identify likely orders/packing scenarios and specifying Heights accordingly to cover at least half the likely variations.
I hope this info is well received and not an unessecary burden ;)
Cheers
GAM
Bookmarks