Purolator Shipping Module
10 posts
• Page 1 of 1
Purolator Shipping Module
I have been working on a Purolator shipping module and I have come to impasse. I have everything done except the model file. I am working in opencart 1.4.9.3.
The issue is I keep receiving these errors:
Unknown: Creating default object from empty value in /home/######/public_html/shop/catalog/model/shipping/purolator.php on line 76
They seem to be where I utilize the purolator provided variables.
I have checked all the opencart variables and they return the data. $get_request is not storing anything. I am missing something simple here.
In turn I am also receiving this error where it mentions the shipping title and total weight of cart. It is in regards to the quote data.
This it the first module I have attempted to create for opencart and would love some insight on this lol
The issue is I keep receiving these errors:
Unknown: Creating default object from empty value in /home/######/public_html/shop/catalog/model/shipping/purolator.php on line 76
They seem to be where I utilize the purolator provided variables.
- Code: Select all
//Populate the Billing Account Number
$get_request->BillingAccountNumber = $this->config->get('purolator_billingaccount');
//Populate the Origin Information
$get_request->SenderPostalCode = $this->config->get('purolator_postcode');
//Populate the Desination Information
$get_request->ReceiverAddress->City = $address['city'];;
$get_request->ReceiverAddress->Province = $address['province'];;
$get_request->ReceiverAddress->Country = $address['iso_code_2'];;
$get_request->ReceiverAddress->PostalCode = $address['postcode'];;
//Populate the Package Information
$get_request->PackageType = "CustomerPackaging";
$get_request->ServiceID = "PurolatorExpress";
//Populate the Shipment Weight
$get_request->TotalWeight->Value = $this->cart->getWeight();
$get_request->TotalWeight->WeightUnit = $this->config->get('purolator_weight_class');
//Execute the request and capture the response
$get_response = $client->GetQuickEstimate($get_request);
I have checked all the opencart variables and they return the data. $get_request is not storing anything. I am missing something simple here.
In turn I am also receiving this error where it mentions the shipping title and total weight of cart. It is in regards to the quote data.
Warning: Invalid argument supplied for foreach() in /home/######/public_html/shop/catalog/view/theme/customcart/template/checkout/shipping.tpl on line 39
- Code: Select all
Line 39: <td width="1"><label for="<?php echo $quote['id']; ?>">
This it the first module I have attempted to create for opencart and would love some insight on this lol
Last edited by kdmp on Mon Apr 23, 2012 3:58 pm, edited 1 time in total.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module - model errors
kdmp wrote:They seem to be where I utilize the purolator provided variables.
- Code: Select all
//Populate the Billing Account Number
$get_request->BillingAccountNumber = $this->config->get('purolator_billingaccount');
//Populate the Origin Information
$get_request->SenderPostalCode = $this->config->get('purolator_postcode');
//Populate the Desination Information
$get_request->ReceiverAddress->City = $address['city'];;
$get_request->ReceiverAddress->Province = $address['province'];;
$get_request->ReceiverAddress->Country = $address['iso_code_2'];;
$get_request->ReceiverAddress->PostalCode = $address['postcode'];;
//Populate the Package Information
$get_request->PackageType = "CustomerPackaging";
$get_request->ServiceID = "PurolatorExpress";
//Populate the Shipment Weight
$get_request->TotalWeight->Value = $this->cart->getWeight();
$get_request->TotalWeight->WeightUnit = $this->config->get('purolator_weight_class');
//Execute the request and capture the response
$get_response = $client->GetQuickEstimate($get_request);
I have checked all the opencart variables and they return the data. $get_request is not storing anything. I am missing something simple here.
$get_request appears to be an object. But I don't see you setting it to a class instance.

Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
-

Qphoria - Administrator
- Posts: 18197
- Joined: Mon Jul 21, 2008 7:02 pm

Re: Purolator Shipping Module - model errors
How would I do that within the model? I understand a class will have to be set up. I tried that, but I can't seem to figure it out to get the output I want.
The supplied purolator code does not do an instance class. This is what threw me for a loop.
The supplied purolator code does not do an instance class. This is what threw me for a loop.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module - model errors
Hey Qphoria,
If I add:
I eliminate the first two errors, but run into the errors when I try to store the opencart values.
The other errors disappeared
So what am I looking at wrong here? Thanks!
If I add:
- Code: Select all
$request = new request;
I eliminate the first two errors, but run into the errors when I try to store the opencart values.
- Code: Select all
$request = new request;
/*********************************************************************************
GetQuickEstimate
*********************************************************************************/
//Create a SOAP Client
$client = createPWSSOAPClient();
//Populate the Billing Account Number
$request->BillingAccountNumber = $this->config->get('purolator_billingaccount');
//Populate the Origin Information
$request->SenderPostalCode = $this->config->get('purolator_postcode');
//Populate the Desination Information
$request->ReceiverAddress->City = $address['city']; <- errors
$request->ReceiverAddress->Province = $address['province']; <- errors
$request->ReceiverAddress->Country = $address['iso_code_2'];
$request->ReceiverAddress->PostalCode = $address['postcode'];
//Populate the Package Information
$request->PackageType = "CustomerPackaging";
$request->ServiceID = "PurolatorExpress";
//Populate the Shipment Weight
$request->TotalWeight->Value = $this->cart->getWeight(); <- errors
$request->TotalWeight->WeightUnit = $this->config->get('purolator_weight_class');
The other errors disappeared

So what am I looking at wrong here? Thanks!
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module - model errors
Hi guys,
Is this purolator module available for 1.5 yet?
Thanks,
Gilbert.
Is this purolator module available for 1.5 yet?
Thanks,
Gilbert.
- juniorsa
- Posts: 1
- Joined: Mon Jul 04, 2011 8:54 pm
Re: Purolator Shipping Module - model errors
Hi Gilbert...a bit late - I had to stop working on it, but may start working on it soon to bring it up to 1.5.x.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module - model errors
Hi Gilbert,
This module should be ready shortly. I have one little bug that I am working out.
This module should be ready shortly. I have one little bug that I am working out.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module - model errors
I would be looking for this also, so please let us know when it is ready....
There is one available for Open cart, but at this moment we are having problems with that one.
Thanks again,
Rexlatour
There is one available for Open cart, but at this moment we are having problems with that one.
Thanks again,
Rexlatour
- rexlatour
- Posts: 7
- Joined: Thu Dec 15, 2011 3:55 am
Re: Purolator Shipping Module - model errors
Hi Rexlatour,
I had to go over it again with version 1.5.2.1. Will let you know soon.
I had to go over it again with version 1.5.2.1. Will let you know soon.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
Re: Purolator Shipping Module
It has been released: Here.
- kdmp
- Posts: 348
- Joined: Thu Jun 04, 2009 2:40 am
- Location: Ontario, Canada
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests













