Re: ozpost shipping module
Hi again.
I've updated the module, but now it won't add the small letter items I had before. Eg: if I order 50 cards, it shows the error rate. If I order 100 cards it will show the letter rate correctly. Whereas before it would add them as letters regardless.
Also, it isn't adding my leadtime to the delivery estimation. Is this an error I am causing? I have a leadtime of around 21 days and it is displaying 1 day delivery!
Thanks again,
Tegan
Re: ozpost shipping module
Quote:
Originally Posted by
pinksugardesign
I've updated the module, but now it won't add the small letter items I had before. Eg: if I order 50 cards, it shows the error rate. If I order 100 cards it will show the letter rate correctly. Whereas before it would add them as letters regardless.
Check your Kg/gms weight setting, as this is the most common 'gotcha' that some people have when upgrading.
Quote:
Originally Posted by
pinksugardesign
Also, it isn't adding my leadtime to the delivery estimation. Is this an error I am causing? I have a leadtime of around 21 days and it is displaying 1 day delivery!
After you upgraded the files did you also remember to perform the 'remove/install' process from your admin panel?
This is required in order to update the database for the newer options.
This may also be a possible cause of your letter problem.
I'll be able to consider other possibilities If/when you can confirm you've performed this operation.
Cheers
Rod
Re: ozpost shipping module
Quote:
Originally Posted by
pinksugardesign
Also, it isn't adding my leadtime to the delivery estimation. Is this an error I am causing? I have a leadtime of around 21 days and it is displaying 1 day delivery!
Thanks again,
Tegan
This turned out to be a bug. I have been able to fix it serverside. All should work 'as advertised' now.
Cheers
Rod
Re: ozpost shipping module
Hi Rod,
Currently using 2.09 and I am about to upgrade to 2.2.2.
I know I only need to update the 2 ozpost files, but wanted to check something first.
Not sure if you recall, but I have a heavily modded ozpost file (includes/modules/shipping) that takes the Fast track text and converts it to read Registered Courier Service, such as;
if ( $quote->description == "FastWay Labels (RED)") { $quote->description = "Registered Courier Service" ; $description = "Registered Courier Service" ; }
and another example,
if ( $quote->description == "3Kg Satchel") { $quote->description = "Express Satchel" ; $description = "Express Satchel" ; }
I did do a compare and added the lines after
$carrier=" ";
But it did nothing in regards to modifying the text on the website, eg it would still return (from the first example), "FastWay Labels (RED)"
Are you able to have a check and see where I would insert the changes for them to be effective ?
Thanks,
Mike
Re: ozpost shipping module
Quote:
Originally Posted by
Mike_Dean
Currently using 2.09 and I am about to upgrade to 2.2.2.
That's quite a jump.
Quote:
Originally Posted by
Mike_Dean
I know I only need to update the 2 ozpost files,
Except for the v2.2.2 update, which has the image/icon files relocated into the /images/ folder.
Quote:
Originally Posted by
Mike_Dean
but wanted to check something first.
Not sure if you recall, but I have a heavily modded ozpost file (includes/modules/shipping) that takes the Fast track text and converts it to read Registered Courier Service, such as;
if ( $quote->description == "FastWay Labels (RED)") { $quote->description = "Registered Courier Service" ; $description = "Registered Courier Service" ; }
Yes, I remember those mods.. not the exact details though..
Quote:
Originally Posted by
Mike_Dean
I did do a compare and added the lines after
$carrier=" ";
I can't locate this line in V2.2.2 .. there have been about 3 upgrades since V2.0.9 (not to mention writing similar code for 4 other shopping carts).
Quote:
Originally Posted by
Mike_Dean
But it did nothing in regards to modifying the text on the website, eg it would still return (from the first example), "FastWay Labels (RED)"
Clearly the code has evolved to the point where it is no longer recognisable and simple comrparisons are next to useless.
Quote:
Originally Posted by
Mike_Dean
Are you able to have a check and see where I would insert the changes for them to be effective ?
Look for the line(s) in /includes/modules/shipping/ozpost.php that contain the method(s) you wish to change: For example, the Fastway 5kg satchels are handled/processed in line#578 which currently reads:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) $handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING ;
You'll need to split this into multiple lines like:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) {
$handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING;
}
Note how I've added the braces {} when splitting!
Now you can define your own description text by adding a line like:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) {
$handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING;
$quote->description = "Your new description goes here" ;
}
Save the file and you're home and hosed.
This process can be repeated for any method's description. In fact if you take a look at lines #584 and #590 you'll note that this method is already used to modify the Ego and Transdirect descriptions. I *should* have emphasised the fact that these were included to serve as an example 'cos I did have it in the back of my mind when I recoded it that there was at least one person (you) that needed this 'easily' modifiable.
Let me know if you have any problems.
Cheers
Rod
Re: ozpost shipping module
Quote:
Originally Posted by
RodG
That's quite a jump.
Tell me about it .!
Quote:
Originally Posted by
RodG
Except for the v2.2.2 update, which has the image/icon files relocated into the /images/ folder.
I'm not using the images, so no issue there
Quote:
Originally Posted by
RodG
Look for the line(s) in /includes/modules/shipping/ozpost.php that contain the method(s) you wish to change: For example, the Fastway 5kg satchels are handled/processed in line#578 which currently reads:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) $handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING ;
You'll need to split this into multiple lines like:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) {
$handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING;
}
Note how I've added the braces
{} when splitting!
Now you can define your own description text by adding a line like:
Code:
if((in_array("A2 Satchel (5Kg)", $this->allowed_methods)) && (strstr($quote->description, "A2"))) {
$handlingFee = MODULE_SHIPPING_OZPOST_FWS_HANDLING;
$quote->description = "Your new description goes here" ;
}
Save the file and you're home and hosed.
Seeing as I want one generic description eg "Registered Courier Service" will I still need to add a new line for every Fastway / Aust Post description that is available (which is what I needed to do for 2.0.9) .
Thanks Rod :clap:
Re: ozpost shipping module
Quote:
Originally Posted by
Mike_Dean
I'm not using the images, so no issue there
There is one icon that is always displayed (during checkout) that isn't disabled along with the other icons. This is the ozpost logo. Although the logo itself can be disabled by simply not having one, this does leave a tiny bit of screen 'corruption'. If you don't want/need/like this icon just replace it with a 1x1px transparent gif. :-)
Quote:
Originally Posted by
Mike_Dean
Seeing as I want one generic description eg "Registered Courier Service" will I still need to add a new line for every Fastway / Aust Post description that is available (which is what I needed to do for 2.0.9) .
The simple answer to this is that as long as you update the $quote->description BEFORE it gets saved into the "method" variable (line #661) then the updated info will be used. ... but that is the simple answer.. the more truthful answer is that the $quote->description is used to create a 'description' variable (lines 647 - 660) and it is this $description variable that is saved/stored.
So, armed with that knowledge, if you wish to change the description of *everything* you only need insert a line
$description = "Whatever" ;
in between lines 660 and 661.
Now, if you only wish to change the text for *some* couriers or methods. you'll need to change the $quote->description in the place(s) it is being set.
This is always within one of those 'case' blocks, and to make the change on a per method basis just follow my previous instructions. If you wish to change the text for (say) all of the FastWay methods at one, you'll need to do this with a line of code place *immediately* before the 'break' command for that block ... This code needs to do TWO things though. 1. Set the text you want, and 2. Ensure that the quote is one that is allowed.
sometrhing like
if (isset($handling_fee)) $quote->description = "Whatever" ;
will suffice (as the $handling fee variable is unset at the start of each loop, and then set to the OZPOST_?_HANDLING fee if/when an acceptable match is found.
So, to change the text for all methods for all carriers edit the $description variable.
To change the text for any matching 'CASE' (courier) you'll need to edit the $quote->description variable immediately before the 'break' command. Ensuring that one of the 'methods' for that 'case' was set.
To change the text for any individual method, edit the $quote->description variable after the merhod match has been made, as per original and coded example(s).
I think that covers all scenarious, but as always, make a backup before making any changes.
Cheers
Rod
Re: ozpost shipping module
Hey Rod,
Thanks for the detailed advice.
Need to absorb it all and work out my plan of attack now.!
Thanks,
Mike
Re: ozpost shipping module
Hi Rod,
Pretty much got this sorted to where I need it. Many Thanks.!
Just one more if I may,
I have checked the option to Use Core Weight, which, (when enough weighted items are added)
returns a description such as
Registered Parcel Service(x2)
Can I / How do I, change the (x2) to read Bulk Service ? for example..
Thanks,
Mike
Re: ozpost shipping module
Quote:
Originally Posted by
Mike_Dean
returns a description such as
Registered Parcel Service(x2)
Can I / How do I, change the (x2) to read Bulk Service ? for example..
ozpost.php line#659
You'll need to alter both variables on this line (the $description and the $quote->description).
Take special note of the quotes and periods when editing this line. If you don't disturb the exsisting periods, and ensure you keep the quotes balanced you shouldn't have too much trouble with this edit.
Cheers
Rod
ps. Be careful, this was added to let the store admin know how parcels were calculated for. By removing this data you could be losing important information.