Community Forums

Purolator Shipping Module

Support for Shipping extensions

Purolator Shipping Module

Postby kdmp » Mon Mar 07, 2011 4:43 pm

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

Postby Qphoria » Mon Mar 07, 2011 4:52 pm

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 Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 18210
Joined: Mon Jul 21, 2008 7:02 pm
Donate to Qphoria

Re: Purolator Shipping Module - model errors

Postby kdmp » Mon Mar 07, 2011 5:32 pm

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.
kdmp
 
Posts: 348
Joined: Thu Jun 04, 2009 2:40 am
Location: Ontario, Canada

Re: Purolator Shipping Module - model errors

Postby kdmp » Mon Apr 04, 2011 4:28 am

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!
kdmp
 
Posts: 348
Joined: Thu Jun 04, 2009 2:40 am
Location: Ontario, Canada

Re: Purolator Shipping Module - model errors

Postby juniorsa » Wed Aug 17, 2011 1:05 am

Hi guys,

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

Postby kdmp » Tue Jan 10, 2012 8:03 pm

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

Postby kdmp » Fri Mar 30, 2012 6:57 pm

Hi Gilbert,

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

Postby rexlatour » Tue Apr 03, 2012 7:50 pm

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
rexlatour
 
Posts: 7
Joined: Thu Dec 15, 2011 3:55 am

Re: Purolator Shipping Module - model errors

Postby kdmp » Thu Apr 19, 2012 6:22 pm

Hi Rexlatour,

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

Postby kdmp » Tue Apr 24, 2012 2:28 am

It has been released: Here.
kdmp
 
Posts: 348
Joined: Thu Jun 04, 2009 2:40 am
Location: Ontario, Canada


Return to Shipping

Who is online

Users browsing this forum: No registered users and 3 guests

Hosted by Arvixe Web Hosting