-
Custom purolator module won't allow checkout to continue to page 2
Clean install of Zencart 1.39h
I've built my own Purolator module. It's working in that it fetches a proper quote with pricing. See attached image.
The problem is, when I try to continue, I keep coming back to page 1, it will never move on to page 2.
Using any other module, pickup, free shipping, etc, works fine and it continues. But using my Purolator module, it stalls.
Any ideas?
Is there any place that tells you what exactly is required in a shipping module and where?
By the way, the 'currently unavailable' is there on purpose from me, and the 'confirm before shipping' is also a module I wrote, and it works.
[SCR]http://Mediagoldshop.com/images/snapshot1.png[/SCR]
-
Re: module works, but won't continue to page 2
More info:
There are NO errors on the page, it just keeps refreshing back to page 1 of 3 of the shipping screen.
This is what I'm providing in the 'quote()' method:
$this->quotes( $id, $module, $method($id, $title, $cost) )
It makes no sense that the page would just reload without throwing some sort of error, and that any other module would work.
Ideas?
-
Re: module works, but won't continue to page 2
Ok, how about this, can anyone tell me which files do the processing of the order?
-
Re: module works, but won't continue to page 2
It will not advance to the payment screen unless the shipping method being selected is confirmed to be valid.
-
Re: module works, but won't continue to page 2
Thank you, a reply!!
Quote:
Originally Posted by
DrByte
It will not advance to the payment screen unless the shipping method being selected is confirmed to be valid.
Yes, that's what I figured was happening.
Where can I find what is required to be valid?
Why can't it at least throw some sort of error so I know what doesn't validate?
It's very difficult writing this kind of code without an API.
I'm thankful for any advise. As a Java programmer, I find PHP very frustrating.
-
Re: module works, but won't continue to page 2
The list of quotes is presented to the customer, using the quotes returned in the array by the quotes() method.
The validation requests the quotes() again, and takes what the customer submitted and compares that against the list of quotes returned. If there's a match, it sets that as the shipping method, and moves on to the payment page. If it fails, it stays on the shipping-options page, and lets the customer choose from the list of available options.
-
Re: module works, but won't continue to page 2
Quote:
Originally Posted by
DrByte
The list of quotes is presented to the customer, using the quotes returned in the array by the quotes() method.
That part I got. I have a quote($method) function.
Q: is it quote, or quotes? I see both in different places.
I have a quote() function, and a this->quotes array.
Here's what I put in it:
PHP Code:
$this->quotes = array('id' => $this->code,
'module' => $this->title,
$methods = array());
$methods[] = array('id' => $type, // with an iteration here
'title' => $type, // for each service type
'cost' => $cost); // like am or weekend
$this->quotes['methods'] = $methods;
return $this->quotes;
Obviously I took out some details for clarity, but that's what I have.
Quote:
Originally Posted by
DrByte
The validation requests the quotes() again, and takes what the customer submitted and compares that against the list of quotes returned. If there's a match, it sets that as the shipping method, and moves on to the payment page. If it fails, it stays on the shipping-options page, and lets the customer choose from the list of available options.
Now it shows up on the screen, why doesn't it validate? I feel like I'm almost there, but something simple is missing.
Lux
-
Re: module works, but won't continue to page 2
I wasn't looking at actual code, so I apologize for referring to quotes() when the method name is actually quote().
Can you zip and attach your module as you have it now?
-
1 Attachment(s)
Re: module works, but won't continue to page 2
here's the zip. er.. assuming I can figure it out.
I will open-source this, with the rest of the files (language files and such) as soon as it's working. Also, this one uses nusoap libraries. I have a non-nusoap one available too.
Also, the error handling codes have been stripped out except for one, just because they triple the filesize and don't affect functionality.
Hopefully you can see what's wrong, I'm so close...Attachment 8506
-
Re: module works, but won't continue to page 2
ok, I haven't had any answers, and haven't figured it out, so I will provide the entire module to the community in its current form.
I'm asking that if you try this, you let me know if it works for you or not, and if it does, what version and modules you have installed.
Thanks
Download Purloator Shipping Module from mediagoldshop.com
-
Re: module works, but won't continue to page 2
Issue is solved, thanks to the keen eye of bitsmith2k.
I've updated the code for the download, along with a few added features, such as maximum weight.
Still working on removing the Nusoap libraries.
But it is a working module!!!
Thanks Bitsmith2k
Lux
-
Re: module works, but won't continue to page 2
Glad you got it sorted out! Yes, xmlentity-encoding can throw wrinkles into things sometimes. That certainly explains why the quote() results weren't able to match up with customer-selections.
Are you going to post your module to the Addons area?
-
Re: module works, but won't continue to page 2
Very good timing
Yes, I will be posting it. It's available for users to test right now, and I'm just finishing up some changes to it. First, removing excess code, and 2nd, removing the need for extra libraries.
Then, I will test it with a stock installation and post it to the Addons.
Thanks for the feedback of those that have tested it and notified me.
Lux
-
Re: module works, but won't continue to page 2
It's now June... any progress on this module? I would love to add it to my website as a shipping option.
-
Re: module works, but won't continue to page 2
The module as posted is working, just use the download link in my post. I haven't posted it to the add-ons yet because I still haven't removed the excess code. I also wanted some feedback from people that are using it to see that it works.
This could be you :smile:
Download it, install, try it out. It's been working on my site for many months.
If you have any problems at all, let me know.
When I get a few moments, I will clean out the unnecessary code and upload it. Sorry for the slow pace, but, as many of us here, this is not my paying job, so it gets done when it gets done.
I was also kinda expecting an update in zencart to spoil my code, since around the time I was working on it we went through all the updates with the 1.39a-h, but things seem to have settled until the 1.5 update.
You can PM me if there's any issues. and I will fix them and post changes.
-
Re: module works, but won't continue to page 2
Thanks for the quick reply. Just a couple questions on the setup.
What is "Enter Your Purolator Production Key"?
Would that be my Purolator Username?
I've been trying that but I get:
Purolator e-Ship
An unknown error occured with the Purolator shipping calculations.
Please Correct this information in your profile, or contact the Island Rain Natural Soap via Email.
-
Re: module works, but won't continue to page 2
You need to contact Purolator and set up your account with them.
https://eship.purolator.com/SITE/en/...bservices.aspx
They will give you a production key, and password. This will give you access to the eship server. That, along with your account number will let you get quotes.
Having an account with Purolator and having access to E-ship are separate. This is a good point, I will add this to the documentation so it's more clear. Thanks for your feedback. Let me know once it's working and you're happy.
Lux
-
Re: module works, but won't continue to page 2
Quote:
Originally Posted by
Luxifer
You need to contact Purolator and set up your account with them.
https://eship.purolator.com/SITE/en/...bservices.aspx
They will give you a production key, and password. This will give you access to the eship server. That, along with your account number will let you get quotes.
Having an account with Purolator and having access to E-ship are separate. This is a good point, I will add this to the documentation so it's more clear. Thanks for your feedback. Let me know once it's working and you're happy.
Lux
Ahhhhh ok, yah I have an account set up but didn't realize there was a difference.
Thanks.
-
Re: module works, but won't continue to page 2
Ok, got that set up, just waiting on a rep to confirm.
In the mean time, can I remove the text "Purolator e-Ship" from in front of the Purolator logo? If so how?
I've tried a couple of things but either nothing changed, the page wouldn't load or I got a blank line in the admin shipping module but nothing changed in the checkout area.
-
Re: module works, but won't continue to page 2
Alright figured it out for the moment. We'll see once Purolator confirms whatever it is they need to confirm but so far it appears to work.
To remove the text before the logo, I created a new define for the title so I could change (remove) the checkout text without changing the text for the shipping module in the admin area.
Should be noted that the define cannot be blank '' meaning nothing in between the single quotes. When I tried that the Purolator shipping option just disappeared from the checkout page. I then tried a dot '.' between the quotes and that worked. Then I tried a space ' ' and that seems to do the trick.
Here's my define:
define('MODULE_SHIPPING_PUROLATOR_TEXT_E_TITLE', ' ');
What I changed in module:
$this->quotes = array('module' => $this->etitle , 'error' => $errmsg);
}
if (zen_not_null($this->icon))
$this->quotes['icon'] = zen_image($this->icon, $this->etitle);
Not sure about that second etitle change but I'll see what happens when I can get rid of the error msg.
-
Re: module works, but won't continue to page 2
I also added:
var $title;
/**
* Shipping module display description
*
* @var string
*/
var $etitle;
/**
* Shipping module display description
*
* @var string
*/
and
$this->code = 'purolator';
$this->title = MODULE_SHIPPING_PUROLATOR_TEXT_TITLE;
$this->etitle = MODULE_SHIPPING_PUROLATOR_TEXT_E_TITLE;
to the module. Figured if I'm going to put up my modifications, I better put all the changes I made.
-
Re: module works, but won't continue to page 2
tried module today, it seem works somewhat by can see any quotes:
An unknown error occured with the Purolator shipping calculations.
Please Correct this information in your profile
Triple checked my keys. Perhaps it may be typo in URLs?
-
Re: module works, but won't continue to page 2
Quote:
Originally Posted by
DazAna
tried module today, it seem works somewhat by can see any quotes:
An unknown error occured with the Purolator shipping calculations.
Please Correct this information in your profile
Triple checked my keys. Perhaps it may be typo in URLs?
Has Purolator "confirmed" you? I'm still waiting for them to get back to me after I registered with their e-Ship service. Day 3 for me for what was suppose to be 2 business days. Until they do their confirmation by contacting you the keys won't work. At least that is what I am assuming is the problem as mine says the same error.
-
Re: module works, but won't continue to page 2
Oh, yes I see. I got e-mail notification that key although issued immediately is not really usable until confirmed.
Darn it.
-
Re: module works, but won't continue to page 2
I got my credentials verified, but module is still doesn't work out of the box...
Error" An unknown error occured with the Purolator shipping calculations."
Anybody have a better luck with this?
-
Re: module works, but won't continue to page 2
-
Re: Custom purolator module won't allow checkout to continue to page 2
Not sure myself. Purolator still hasn't contacted me. I will of course be contacting them by phone tomorrow. Little disgusted with their customer service already.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
Danger
Not sure myself. Purolator still hasn't contacted me. I will of course be contacting them by phone tomorrow. Little disgusted with their customer service already.
They will not. Call them and they will enable your key instantly: 604-298-2181
-
Re: Custom purolator module won't allow checkout to continue to page 2
After a bit of a run around, I was able to get a hold of a guy name Kevin who looks after the web development area. Seems my problem of not getting confirmed was because I didn't apply for a development key first and go through the development/testing phase.
So I now have my production key enable for estimating purposes but I am still getting the same error:
An unknown error occured with the Purolator shipping calculations.
Not sure why as that error isn't all that informative. Currently trying a few things and will see what happens.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Well I've tried a bunch of things that I thought might be causing the error but be damned if any of it worked. I'm now at a loss.
I know you're busy Luxifer but any help would be greatly appreciated. Actually any help from anyone would be greatly appreciated. My PHP is greatly limited making it quite hard to find where the error might lie. Heck it could even be something else in the website.
My Website
-
Re: Custom purolator module won't allow checkout to continue to page 2
So you got the same result as I did.
I believe it is safe to assume that module still need some work. It is a shame really.
Code is very well documented, but still above my level.
-
Re: Custom purolator module won't allow checkout to continue to page 2
If you haven't done so, make sure you download the wsdl file from purolator and upload the production wsdl file to your catalog root.
This file is vital to the module working
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
hey_you
If you haven't done so, make sure you download the wsdl file from purolator and upload the production wsdl file to your catalog root.
This file is vital to the module working
I've searched high and low for this file but be damned if I can find on the Purolator site.
nevermind, I'm just blind...
-
Re: Custom purolator module won't allow checkout to continue to page 2
Ok, so where exactly does this file go? Not sure what you mean by catalog root.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by Danger
so where exactly does this file go? Not sure what you mean by catalog root.
Quote:
Originally Posted by hey_you
upload the production wsdl file to your catalog root.
Catalog "root" is the base area where you have your ZenCart installed
It can be
/htdocs
/public_html
or if installed into a directory under the main root you ZenCart root becomes
/htdocs/catalog
/public_html/shop
/public_html/catalog
Or what ever you have named the directory
-
Re: Custom purolator module won't allow checkout to continue to page 2
Ahhh ok. I thought that's what it might have meant but I wanted to be sure. Thank you for explaining that nicely :) Now to see if I can get the Purolator Mod working... fingers crossed...
-
Re: Custom purolator module won't allow checkout to continue to page 2
Ok, it's working... mostly. Now if I try to order anything that weighs under half a kg. I still get the error "An unknown error occured with the Purolator shipping calculations."
However anything half a kg and above seems to work just fine.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
Danger
Ok, it's working... mostly. Now if I try to order anything that weighs under half a kg. I still get the error "An unknown error occured with the Purolator shipping calculations."
However anything half a kg and above seems to work just fine.
I'll check this, but puro works on min .5kg anyways, so it's supposed to round up.
Any other problems?
-
Re: Custom purolator module won't allow checkout to continue to page 2
I do have another problem. Not sure why but the shipping module is showing about $4.00 more than what it actually costs to ship an item express.
I just shipped an item Express with a weight of 1lb at a cost of $15.07.
I set up a customer with that same address and added a couple items to make up the 1lb and the module shows a cost of $19.06 for Express and Ground shipping.
Both prices are without tax added.
I know it's just an estimate but $3.99 seems a bit out even for an estimate.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
Danger
I do have another problem. Not sure why but the shipping module is showing about $4.00 more than what it actually costs to ship an item express.
I just shipped an item Express with a weight of 1lb at a cost of $15.07.
I set up a customer with that same address and added a couple items to make up the 1lb and the module shows a cost of $19.06 for Express and Ground shipping.
Both prices are without tax added.
I know it's just an estimate but $3.99 seems a bit out even for an estimate.
Turn on the error checking for this module. This involves un-commenting a few lines in the code. I've made it obvious where to do this, but I can tell you how if you need.
This will tell you exactly what Purolator is returning as a value.
My suspicion is it's not Puro or my code.
Zencart has a specification where it adds to the calculated weight before it does the request (to account for packing) and/or it adds to the value received to give you a markup.
After turning on error checking, when you do a quote, there will be a comment at the top of the source-code of the page. This will give you the weight and the quote price. Compare these to what you were calculating.
If the weight is different, you have Zencart set to add weight. If the price is different, you have zencart set to add $.
Once you figure out which, there's 2 things to do.
1) It's probably the weight tare, in which case go to Configuration/shipping-packaging. There are two lines that are to add a percentage to package tare. Set them both to 0:0.
If it's not the weight tare, I forget where the other setting is, let me know and I'll look for it.
2) re-comment the source code so that it doesn't do the error-checking anymore.
Let us know if this works for you.
<edit> Actually, before going through the trouble of playing with the code, just check your zencart settings first to see that both are set to 0:0. If this fails, then play with the code. <end edit>
-
Re: Custom purolator module won't allow checkout to continue to page 2
-
Re: Custom purolator module won't allow checkout to continue to page 2
Need some advice if possible.
I ahve the module installed, my account from Puro, my production key & password (verified and activated by Puro) yet I'm getting the:
"An unknown error occured with the Purolator shipping calculations" error message.
My Zen cart is setup in '/store/' on my website. I put the wsdl file in there (eg so it's path is www.xxxx.com/store/estimatingservice.wsdl). Should this be put somewhere else? Cant figure out what else could be wrong.
-
Re: Custom purolator module won't allow checkout to continue to page 2
RESOLVED.
Believe the problem was that I was using some heavier shipments (my product is normally). But had the Purolator module setting at PuroBox or PuroPak. Believe the weight I was using was likely exceeding the packaging limits and hence returning an error.
Changed to 'custom packaging' and BAM off to the races.
Purolator Web Development was great once I was able to reach the appropriate folks. And once they understood that there was a module in existence understood the reasoning to skid the dev key processes.
Thanks again Luxifer for an excellent module!
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
kobra
Catalog "root" is the base area where you have your ZenCart installed
It can be
/htdocs
/public_html
or if installed into a directory under the main root you ZenCart root becomes
/htdocs/catalog
/public_html/shop
/public_html/catalog
Or what ever you have named the directory
For some reason, the only way I could get this to work was to put the WSDL file in my site root, not my store root. Just wanted to share in case anyone else was banging their head against the wall...
-
Re: Custom purolator module won't allow checkout to continue to page 2
Yes, I made it in the site root so that if you have multiple stores, they can all share the same file.
And yes, I will get this updated as soon as I work out all my other 1.5 module issues.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
Danger
Ok, it's working... mostly. Now if I try to order anything that weighs under half a kg. I still get the error "An unknown error occured with the Purolator shipping calculations."
However anything half a kg and above seems to work just fine.
I'm having this minimum weight issue. I set package tare to add weight, but it still won't give me a quote. Is there any way to make it round up to a minimum weight?
-
Re: Custom purolator module won't allow checkout to continue to page 2
ok, open the includes/modules/shipping/purolator.php file.
line 119 or so, change the line to read:
PHP Code:
$shipping_weight = ceil($shipping_weight);
Haven't tested it, but that should certainly work.
Let me know how it goes, and I'll put it in my list of things to test for the new version.
Quote:
Originally Posted by
abcisme
I'm having this minimum weight issue. I set package tare to add weight, but it still won't give me a quote. Is there any way to make it round up to a minimum weight?
-
Re: Custom purolator module won't allow checkout to continue to page 2
Quote:
Originally Posted by
Luxifer
ok, open the
includes/modules/shipping/purolator.php file.
line 119 or so, change the line to read:
PHP Code:
$shipping_weight = ceil($shipping_weight);
Haven't tested it, but that should certainly work.
Let me know how it goes, and I'll put it in my list of things to test for the new version.
Changed this line:
Code:
$shipping_weight = round($shipping_weight, 2);
To:
Code:
$shipping_weight = ceil($shipping_weight);
Still nothing.
-
Re: Custom purolator module won't allow checkout to continue to page 2
Hey guys,
I was recently asked to solve this shipping weight problem. Here's the solution:
Edit purolator.php
Around Line 300,
Find this line:
Quote:
$this->totalWeight = round($this->totalWeight); //rounds up to the nearest interger
Replace with:
Quote:
if($this->totalWeight > 0 && $this->totalWeight < 0.5) { $this->totalWeight = 0.5; } // minimum charge fix, will not quote lowest rate if item has no weight
$this->totalWeight = round($this->totalWeight); //rounds up to the nearest interger
if $this->totalWeight was less than 0.5, it would round to 0. With it equal to 0.5, it rounds to 1.
:clap:
Thanks Luxifer for your work on the module :cool:
-
Re: Custom purolator module won't allow checkout to continue to page 2
giantfan, thanks for your efforts in building this module! Any plans to get it packaged up and posted in the Plugins section? I'm happy to help gather up the files and make them plugin-ready.
-
Re: module works, but won't continue to page 2
Thank you Luxifer for the module. I'm using it (development phase at Purolator) with ZenCart V.5.
Two questions:
1-Can it be used for shipping worldwide? It only works for USA-Canada as I can see.
2-Weights on my database are in kg. but are assumed lb. by the module. Can be changed?
Thank you again.
-
Re: module works, but won't continue to page 2
Does anyone know if you can use this mod on php5.3 or 5.4, additionally I noticed the nuSOAP files are no where near the most current do these need to be updated to the most current? and then can you use development keys/password/account to test it before installing on live server? and last but not least I noticed this error after installing it the way it is
[21-Mar-2014 23:37:50 America/New_York] PHP Warning: Creating default object from empty value in /includes/modules/shipping/lib/nusoap.php on line 55
-
Re: module works, but won't continue to page 2
Could not find an up to date thread.
Is there any current purolator modules? if not where can I find the latest to start from there
-
Re: module works, but won't continue to page 2
Where can I found the module installation files?