Zen Cart Logo
Forums / Addon Shipping Modules / Custom purolator module won't allow checkout to continue to page 2

Custom purolator module won't allow checkout to continue to page 2

Views: 12,979

Results 1 to 20 of 54
2 Dec 2010, 6:10 AM
#1
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

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.

http://Mediagoldshop.com/images/snapshot1.png
2 Dec 2010, 4:46 PM
#2
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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?

3 Dec 2010, 5:09 PM
#3
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to continue to page 2

Ok, how about this, can anyone tell me which files do the processing of the order?

3 Dec 2010, 9:05 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Custom purolator module won't allow checkout to continue to page 2

It will not advance to the payment screen unless the shipping method being selected is confirmed to be valid.

4 Dec 2010, 7:33 PM
#5
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to continue to page 2

Thank you, a reply!!

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.

4 Dec 2010, 9:39 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Custom purolator module won't allow checkout to 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.

5 Dec 2010, 5:06 AM
#7
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to continue to page 2

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:

$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.

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

5 Dec 2010, 5:19 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Custom purolator module won't allow checkout to 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?

6 Dec 2010, 2:51 AM
#9
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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

14 Dec 2010, 4:45 PM
#10
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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

24 Jan 2011, 10:29 PM
#11
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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

1 Mar 2011, 1:39 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Custom purolator module won't allow checkout to 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?

1 Mar 2011, 2:49 AM
#13
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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

7 Jun 2011, 1:42 AM
#14
danger avatar

danger

New Zenner

Join Date:
Feb 2011
Posts:
43
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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.

7 Jun 2011, 3:46 PM
#15
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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.

7 Jun 2011, 10:52 PM
#16
danger avatar

danger

New Zenner

Join Date:
Feb 2011
Posts:
43
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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.

7 Jun 2011, 11:17 PM
#17
luxifer avatar

luxifer

New Zenner

Join Date:
Mar 2009
Posts:
57
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to continue to page 2

You need to contact Purolator and set up your account with them.

https://eship.purolator.com/SITE/en/content/webservices.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

7 Jun 2011, 11:42 PM
#18
danger avatar

danger

New Zenner

Join Date:
Feb 2011
Posts:
43
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to continue to page 2

Luxifer:

You need to contact Purolator and set up your account with them.

https://eship.purolator.com/SITE/en/content/webservices.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.

8 Jun 2011, 1:10 AM
#19
danger avatar

danger

New Zenner

Join Date:
Feb 2011
Posts:
43
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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.

8 Jun 2011, 1:45 AM
#20
danger avatar

danger

New Zenner

Join Date:
Feb 2011
Posts:
43
Plugin Contributions:
0

Re: Custom purolator module won't allow checkout to 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.