Zen Cart Logo
Forums / All Other Contributions/Addons / Dimensions being overwritten.

Dimensions being overwritten.

Views: 1,076

Results 1 to 13 of 13
12 Jul 2011, 6:33 PM
#1
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Dimensions being overwritten.

Zen Cart version. 1.3.9h

When entering a new product, it does not matter what dimensions I enter, as soon as I update the values and re-check the listing the length, width and height are defaulted back to 6.00, 9.00, 2.00. I can change them again but they change back.

also the Item Ships in original box is also defaulted to a '1' or checked.

This started at database at product record 5273

I have the Canada Post module installed, but this has been installed for several years and never caused a problem in the past.

I did however recently install the multi-price module, but that appears to be working, and I can't see where the conflict might be between this module and the dimensions of the product.

Any advice, that might point me in the right direction would be appreciated.

Phil

12 Jul 2011, 7:04 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Dimensions being overwritten.

Zen Cart v1.3.x doesn't have built-in dimension support.
Your dimension support is likely a result of adding the Canada Post module.
If that's been broken, then it's likely a consequence of adding a conflicting module.

12 Jul 2011, 7:49 PM
#3
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

More information:

when I change the number in the database through Cpanel, it stays changed, it seems that the input fields for dimensions and packaging that are located near the bottom of the 'add new product' page are not functioning at all, since these are part of the Canada Post Module, I expect the problem is in one of those files.

Can anyone give me information on what statement(s) collect the data and input it into the database? - I used developer tool kit to find the fields with the Width, but do not know how the information is collected on the form and put in to the database.

I expect that this post should now be moved over to that area.

12 Jul 2011, 7:50 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Dimensions being overwritten.

Again, it seems like you've got conflicting code, where your newest addon replaces functionality added by a prior addon.

12 Jul 2011, 8:00 PM
#5
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

I realize that I might have a conflict, but I am trying to determine where that conflicting code might be, so I might correct it, and knowing what type of code/file to look for and where the code is for the 'input new product' might help me look in the right file(s).

I was hoping for a little information on where that particular file might be.

I am currently looking at collect_info.php - does this make sense?

12 Jul 2011, 8:10 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Dimensions being overwritten.

The files under /admin/includes/modules/ would be one place to start.

Specifically, I'd start by looking at both addons' files, and seeing which files exist in both. That would be an immediate clue as to where exactly you should be looking.

13 Jul 2011, 4:05 PM
#7
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

So far...

Removed the Dual Pricing Module
Turned off the UPS module
turned off then Removed and re-installed the Canada Post Module

  • none of these items seem to have any effect -

I can modify the values in the DataBase through Cpanel and that works, however any new input in any of the four fields length, width, height or 'ships in own package' do not get transfered to the database when we click update OR add a new product.

This used to work, so I can only think that when I installed the Dual Pricing Module (and merged the files), it messed something up - but now even after restoring everything back to pre-DP install, it is not working.

Pulling my hair out over this one, if anyone has any advice as to where to look next, it would be appreciated. I have checked and double checked the CP install.

14 Jul 2011, 12:43 PM
#8
rodg avatar

rodg

Deceased

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

Re: Dimensions being overwritten.

phlipper:

Removed and re-installed the Canada Post Module

This module needs to replace a few files in the /admin/ folder.
I suspect they weren't replaced with your re-install.

phlipper:

Pulling my hair out over this one, if anyone has any advice as to where to look next, it would be appreciated.

The files in question are
/admin/includes/modules/update_product.php
and
/admin/includes/modules/product/collect_info.php

The first of these files add the dimension fields into the product editor, and the other is what is used to store the inputted data back to the database.

Replace these with the ones from the Canada post module and all should be well.

Cheers
Rod

17 Jul 2011, 1:18 PM
#9
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

Thanks for the reply, I appreciate it.

I replaced both those files from the latest version of the CP module. - still the same problem - the values always change back to the default values from the database. If I change them in the database, they stay changed - but I am unable to change them through the add/modify product page. Interesting that all the other fields work, just not the CP fields.

17 Jul 2011, 1:49 PM
#10
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

Thank-you Rod for posting the files, it got me looking in the right place.

After my failed fix, I started looking at the files in the folder, under /admin/includes/modules/product/ there was a file update_product.php ( I looked at that file and the Canada Post additions were missing from the code) - I don't think the file was supposed to be there. I renamed the file as a .bak and now things seem to be working again.

I do not know if this was the 'right' fix, but it seems to work

Phil

18 Jul 2011, 4:10 AM
#11
rodg avatar

rodg

Deceased

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

Re: Dimensions being overwritten.

phlipper:

I started looking at the files in the folder, under /admin/includes/modules/product/ there was a file update_product.php ( I looked at that file and the Canada Post additions were missing from the code) - I don't think the file was supposed to be there

This file IS supposed to be there, and if it was the one from the CA module it will have the dimensional additions.

The original zencart file doesn't have the dimensional data, which is why this is one of the files that need replacing.

phlipper:

I renamed the file as a .bak and now things seem to be working again.
Seriously? I don't see how it can work without this essential file.
phlipper:

I do not know if this was the 'right' fix, but it seems to work
The right fix is to replace the file with the one from the CA module.

When I 'deleted' this file from my test server all I get when I hit the update button is a blank screen (which is pretty much what I expected).

Your fix and findings have no logical explanation, but as long as it works I'm not going to dwell on the matter.

Cheers
Rod

21 Jul 2011, 10:00 AM
#12
phlipper avatar

phlipper

Zen Follower

Join Date:
Jan 2006
Posts:
128
Plugin Contributions:
0

Re: Dimensions being overwritten.

Thank-you for the reply Rod, your original response is what got me looking in the right place, and I appreciate that.

RE: Your statement about update_product.php file needing to be in the folder /admin/includes/modules/product/

I downloaded a fresh copy of Zencart and checked the file system. I must have somehow copied the file in to the wrong folder while installing the dual pricing module.

the only four files that are supposed to be in that folder are:

collect_info.php
collect_info_metatags.php
preview_info.php
preview_info-meta_tags.php

The fact that I had update_product.php in the folder WAS the problem, and was obviously a mistake I made while installing one of the modules.

Once again, thank-you for your help, it is much appreciated.

Phil

21 Jul 2011, 11:43 AM
#13
rodg avatar

rodg

Deceased

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

Re: Dimensions being overwritten.

phlipper:

the only four files that are supposed to be in that folder are:
collect_info.php
collect_info_metatags.php
preview_info.php
preview_info-meta_tags.php

Correct.

phlipper:

The fact that I had update_product.php in the folder WAS the problem, and was obviously a mistake I made while installing one of the modules.

The update_product.php file belongs in
/admin/includes/modules, and you'll still need to replace this one with the copy from the Canada Post Module (if you haven't already done so).

Cheers
Rod