Post by kdmp » Tue Mar 08, 2011 12:43 am

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.

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 11:58 pm, edited 1 time in total.

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Post by Qphoria » Tue Mar 08, 2011 12:52 am

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.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by kdmp » Tue Mar 08, 2011 1:32 am

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.

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Post by kdmp » Mon Apr 04, 2011 12:28 pm

Hey Qphoria,

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!

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Post by juniorsa » Wed Aug 17, 2011 9:05 am

Hi guys,

Is this purolator module available for 1.5 yet?

Thanks,
Gilbert.

Newbie

Posts

Joined
Tue Jul 05, 2011 4:54 am

Post by kdmp » Wed Jan 11, 2012 4:03 am

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.

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Post by kdmp » Sat Mar 31, 2012 2:57 am

Hi Gilbert,

This module should be ready shortly. I have one little bug that I am working out.

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Post by rexlatour » Wed Apr 04, 2012 3:50 am

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

Newbie

Posts

Joined
Thu Dec 15, 2011 11:55 am

Post by kdmp » Fri Apr 20, 2012 2:22 am

Hi Rexlatour,

I had to go over it again with version 1.5.2.1. Will let you know soon.

Kevin Davidson
Purolator Shipping Module
Canpar Shipping Module
VQMod - Paypal Transaction ID to Payment Details


Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada

Active Member

Posts

Joined
Thu Jun 04, 2009 10:40 am
Location - Ontario, Canada
Who is online

Users browsing this forum: No registered users and 7 guests