Zen Cart Logo
Forums / Addon Shipping Modules / Canada Post - Dimensions by attributes

Canada Post - Dimensions by attributes

Views: 2,387

Results 1 to 12 of 12
24 Nov 2010, 2:57 PM
#1
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Canada Post - Dimensions by attributes

Hi, I'm new to zen cart but not new to PHP....

I just installed v1.3.9h - new install - new site.

I've installed the Canada Post Shipping Module and it seems to be working ok - one thing is I'm not seeing how many boxes are being shipped.

My main question is this:

In the admin-categories/products page when editing/adding a product, there's an option to price by attributes - which will also allow weight by attribute.

Canada Post module has the weight and dimensions in the product description, right now it looks like the weight is being pulled from my attributes. I'm wondering how I can do the same thing for dimensions.

The product/attributes are as follows:

small bag 50g(weight) 11x10x2(size of bag)
medium bag 100g 15x12x3.5
large bag 200g 22x15x5

If I all packages were the same it'd be fine but I need to calculate the sizes. I can get x amount of bags in a box depending on the size.

Is there a way to grab dimension by attributes for CPM?

Thanks.

24 Nov 2010, 6:49 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Canada Post - Dimensions by attributes

There is no DB records for l, w, h
There is no admin code to allow entry
There is no shopping cart, shipping calc, etc code for using

Start with creating a new product type based upon product general
See tutorials

But first look at the free software addons for Canada Post Shipping Module

24 Nov 2010, 7:13 PM
#3
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

Sorry I'm not quite sure I understand... your statement: > Start with creating a new product type based upon product general

I'm able to creat a product and enter the l,w,h for it within the Canda Post Shipping Module (which is already installed). My problem is I'd like to add it for each size without creating three different products.

Also: > free software addons for Canada Post Shipping Module is there additional addons for this module? I didn't see any other then the module itself - which as I mentioned is already installed and functioning.

24 Nov 2010, 8:24 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Canada Post - Dimensions by attributes

I'm not quite sure I understand... your statement:
As stated, earlier much code and DB addition might be necessary
A new product type will assist in inputting it into the product
https://www.zen-cart.com/tutorials/index.php?article=114

24 Nov 2010, 9:21 PM
#5
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

So in theory... if I'm going to have to modify code I could essentially modify the attribute controller. Within the php code I could add values for L W H in the Prices & Weight section - as the weight isn't part of the Product Type Descriptor just part of Canada Shipping Module and the attribute controller is appending the amount just fine.?

Canada Post module has added the products_length, products_width, products_height to the products table.

So if I add products_length, products_lenght_previx, products_width, products_width_previx, products_heigth, product_heigth_previx to the products_attributes table this should do the same as the weight does?

I can't do any coding right now I'm at work... so writing my theories down maybe it'll work maybe I'm way off...

25 Nov 2010, 4:38 AM
#6
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

]Just FYI, I did get this to work as described above...

Basically I edited the attributes_controller.php file withing /admin. I also had to edit the /admin/includes/languages/attributes_controller.php file.

Within these files I just copied everywhere there was a weight section and put the same code for length width height.

Then I added products_attributes_length, products_attributes_length_prefix (same for width height) to the znc_products_attributes table.

30 Nov 2010, 6:27 PM
#7
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

Does anyone know where the Canada Post Shipping module grabs the weight from or which part/page puts the weight attribute into the actual item when the Canada Post shipping module gets the info?

As I mentioned I did get it working in terms of I can add the LxWxH to the attribute tables but for some reason canada post is still grabbing the LxWxH from the products table without adding the attributes.

30 Nov 2010, 7:20 PM
#8
bloodgrave avatar

bloodgrave

New Zenner

Join Date:
Nov 2010
Posts:
8
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

Figured it out ... I had an typo in my shopping_cart.php - everything is working as it should now :)

13 Oct 2011, 9:45 PM
#9
mhaskell avatar

mhaskell

New Zenner

Join Date:
Oct 2011
Posts:
3
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

Hello bloodgrave, i have sent you a private message as well as replying to your post. Would it be possible for you to share the changes you made to the shopping cart to make it work.
thanks Mike

16 Oct 2011, 11:46 PM
#10
mhaskell avatar

mhaskell

New Zenner

Join Date:
Oct 2011
Posts:
3
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

anyone?

17 Oct 2011, 4:23 AM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Canada Post - Dimensions by attributes

mhaskell:

Hello bloodgrave, i have sent you a private message as well as replying to your post. Would it be possible for you to share the changes you made to the shopping cart to make it work.
thanks Mike

He already did.

I edited the attributes_controller.php file withing /admin. I also had to edit the /admin/includes/languages/attributes_controller.php file.

Within these files I just copied everywhere there was a weight section and put the same code for length width height.

Then I added products_attributes_length, products_attributes_length_prefix (same for width height) to the znc_products_attributes table.It'll be no good asking for the files themselves as this was done over a year ago, so you will probably be using a different version of zencart, and the files have probably changed, which means you'll need to re-edit as per the information provided.

Cheers
rod

18 Oct 2011, 12:26 AM
#12
mhaskell avatar

mhaskell

New Zenner

Join Date:
Oct 2011
Posts:
3
Plugin Contributions:
0

Re: Canada Post - Dimensions by attributes

hello Rod,
thanks for the reply. I have done the edits for the attributes_control.php files and the language files and added the fields to the database already. that part is working well. bloodgrave also mentioned that shoppingcart.php that comes with the canadapost module had to be changed as well. It looks much more complicated, I am not sure what to do with it.
mike