If this is your first visit, check our documentation. To post, register or login.

Shipping dimensions

Started by heathenmagic on 16 Jun 2025, 2:35 PM · Views: 1,223

Results 1 to 9 of 9
16 Jun 2025, 2:35 PM
#1
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Shipping dimensions

Version 2.1 php 8.3

Hello there,

I see that dimensions have been added for shipping as the following fields:-

products_length , products_width , products_height

Has anyone made it so they can display these item fields on the product info page? I know Numinix Fields supposed to do this, but it only works for 1.58, thats the last time I actually worked for me. From that module, I have products_diameter. I guess its just a case of moving that sql data to the new zencart sql fields that are relevant? Thanks for any thoughts in advance.

16 Jun 2025, 4:34 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Shipping dimensions

Just modify your template to display these fields. No need for Numinix product fields.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

16 Jun 2025, 5:24 PM
#3
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Shipping dimensions

swguy:

Just modify your template to display these fields. No need for Numinix product fields.

Ah okay. So perhaps I just do an php echo or similar, the only issue is I have in cms and inches. But I bet I could just do a call to show the dimension unit alongside it. The nice thing about the numinix module is that it would do a conversion of the measurement into the opposite one, but changing php version threw an error with that anyway. Thanks, I will have a crack at it, didn't realise it could be that straightforward lol!

16 Jun 2025, 6:05 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Shipping dimensions

the only issue is I have in cms and inches.

By default you have to use consistent units (as specified by Shipping Dimension Units in Admin> Configuration > Shipping)

If you want to mix and match metric and imperial units, you'd have to add a per product field to indicate if the measurement is in cm or in.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

17 Jun 2025, 7:38 AM
#5
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Shipping dimensions

swguy:

the only issue is I have in cms and inches.

By default you have to use consistent units (as specified by Shipping Dimension Units in Admin> Configuration > Shipping

If you want to mix and match metric and imperial units, you'd have to add a per product field to indicate if the measurement is in cm or in.

Thanks Scott, much appreciated!

17 Jun 2025, 11:09 AM
#6
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Shipping dimensions

If you want to mix and match metric and imperial units, you'd have to add a per product field to indicate if the measurement is in cm or in.

Bear in mind that you'd also have to customize any logic that used these units (since the assumption is that all products use a single standard of measurement for weight and for size).

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

2 Aug 2025, 10:17 AM
#7
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Shipping dimensions

swguy:

If you want to mix and match metric and imperial units, you'd have to add a per product field to indicate if the measurement is in cm or in.

Bear in mind that you'd also have to customize any logic that used these units (since the assumption is that all products use a single standard of measurement for weight and for size).

Sorry for delay in replying Scott, had to sort out masses of bots attacking site :-(.

I managed to learn how to add fields for product phrases from a while ago, which is easy as its just text. So I learnt to set the fields in main_template_vars (or similar spelling, apologies if wrong). So they show nicely actually.

I found an issue showing dimensions. So I set the above, and then in product info display file:-

 <?php if(!empty($products_length)) {?>
 <li><?php echo $products_length;?></li>

Trying one for now. It throws blank page, and the error log doesn't make much sense. But it could be as I am setting in the other file "!empty"

The issue is for some reason the products_length either contains 'null' or '0.00' if there are no dimensions applicable. I am guessing this is throwing the error. The entries seem to save going through the edit product in admin, rather than giving an empty field in the SQL, for some reason.

Maybe I have to clear the masses of sql 'null' and '0.00' and try and stop it saving that in future. Or I did try making statement !> instead of !empty, but thats seems to not work (trying 'greater than' rather than if empty). I am not a coder really, but I assume the code is saying normally don't show if !empty logic present.

Yes in reference to what you said, I will crudely display measurement unit either cms or inches, which should suffice. Strangely that product table for measurements only includes 'cm' or 'in' , so am guessing using !empty logic should work fine for that.

2 Aug 2025, 10:45 AM
#8
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Shipping dimensions

You have to close the paren that you opened on the first line.

<?php if(!empty($products_length)) {?> <li><?php echo $products_length;?></li> <?php } ?>

or perhaps easier:

<?php if(!empty($products_length)) { echo '<li>' . $products_length . '</li>'; } ?>

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

2 Aug 2025, 2:16 PM
#9
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Shipping dimensions

swguy:

You have to close the paren that you opened on the first line.

<?php if(!empty($products_length)) {?> <li><?php echo $products_length;?></li> <?php } ?>

or perhaps easier:

<?php if(!empty($products_length)) { echo '<li>' . $products_length . '</li>'; } ?>

Ah shucks! My bad there, total newbie mistake :D. Thanks so much for pointing that out, I might try your alternative line it looks a lot neater actually. Have a nice weekend Scott!