Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add product dimension fields #6233

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

drbyte
Copy link
Member

@drbyte drbyte commented Feb 18, 2024

Add product dimension fields. Primarily to be used by shipping modules to prepare more accurate shipping quotes.

Also addresses #6232

Screen Shot 2024-02-17 at 10 23 52 PM

Screen Shot 2024-02-17 at 10 25 54 PM

@scottcwilson
Copy link
Sponsor Contributor

Love it! Looks like Canada Post. :)

@scottcwilson
Copy link
Sponsor Contributor

New doc: https://docs.zen-cart.com/user/shipping/shipping_dimensions/ plus references in What's New and the Release Specific Upgrade Considerations pages.

@torvista
Copy link
Member

Couple of typos

2024-02-18 21_28_22-Shipping Dimensions _ Zen Cart Documentation

2024-02-18 21_29_12-Settings

@drbyte drbyte force-pushed the dimensions branch 2 times, most recently from c79c7d8 to 73571a4 Compare February 18, 2024 20:39
@scottcwilson
Copy link
Sponsor Contributor

scottcwilson commented Feb 19, 2024

Couple of typos

Thank you, @torvista. The first one I already had but the second one was a surprise. Will push these shortly.

@scottcwilson scottcwilson merged commit 868cdd8 into zencart:master Feb 19, 2024
8 checks passed
@drbyte drbyte deleted the dimensions branch February 20, 2024 00:11
@@ -583,6 +583,10 @@
'TEXT_SALEMAKER_IMMEDIATELY' => 'Immediately',
'TEXT_SALEMAKER_NEVER' => 'Never',
'TEXT_SET_DEFAULT' => 'Set as default',
'TEXT_SHIPPING_lbs' => '(lbs)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be UPPER case
'TEXT_SHIPPING_LBS' => '(lbs)',
etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See PR #6245

Copy link
Contributor

@piloujp piloujp Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand well, this file is overridden by other collect_info.php in different products types folders. Shouldn't these be updated too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See PR #6245

@drbyte
Copy link
Member Author

drbyte commented Feb 21, 2024 via email

@neekfenwick
Copy link
Contributor

I just tried to monkey patch my database using the SQL added here, but it fails because there's a MODIFY on products_length which does not exist:

ALTER TABLE products MODIFY products_length DECIMAL(8,4) DEFAULT NULL;
ALTER TABLE products ADD products_length DECIMAL(8,4) DEFAULT NULL AFTER products_weight;

In fact, why does this SQL attempt to MODIFY and then ADD the same field? The MODIFY line appears redundant. Same goes for the width and height lines just below.

@scottcwilson
Copy link
Sponsor Contributor

I just tried to monkey patch my database ...

If you're doing that, remove the ALTER TABLE MODIFY statements. These were put in place for people who already had these fields because of mods (like Numinix Product Fields).

@neekfenwick
Copy link
Contributor

If you're doing that, remove the ALTER TABLE MODIFY statements. These were put in place for people who already had these fields because of mods (like Numinix Product Fields).

Ah, there's obviously some black magic going on in zc_install that I'm unaware of 👍 Thanks.

@scottcwilson
Copy link
Sponsor Contributor

scottcwilson commented Feb 27, 2024

Please note: FOR LIVE-STORES THAT HAVE NOT RUN ZC_INSTALL, the guidance is to not do what you're doing. That's why it says in red text in the Install SQL Patches tool:

This tool should NOT be used to execute Zen Cart database-upgrade scripts: use the Zen Cart Installer as per the documentation.

If you still want to do it, you have to dig in and understand the details.

@drbyte
Copy link
Member Author

drbyte commented Feb 27, 2024

Ah, there's obviously some black magic going on in zc_install that I'm unaware of 👍 Thanks.

Yes, both zc_install and Install SQL Patch will check whether add/change/modify/drop operations, and some insert operations, would fail due to required dependencies, and simply skip running those statements. It logs it to upgrade_exceptions table and the logs directory, and the admin will display the alert ... but the script will not fail.
This is why Zen Cart upgrades can do all their SQL changes with just .sql files instead of having to write PHP code specific to every version upgrade. It also means one "can" copy/paste the statements into phpmyadmin or sqlpatch in most cases without side-effects. (The reason that "the guidance" says "not" to do that, is because uninformed end-users tend to cherrypick things and assume they did enough, and then come on the forum asking why their site isn't working after "upgrading" when they didn't follow the complete upgrade.) zc_install is still important for most upgrades because it does use PHP code to check various dependencies and fix incompatible situations; and also upgrade configure.php if it's in an old format, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants