-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
GUI to Edit EAV Attributes & Sets #25
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
@justinbeaty first of all thank you for this PR, for sure questions will arise, first ones being...
|
My initial thought is that it should support scopes. An example might be a wholesaler website that asks for tax info. Similarly an EU store view might ask for a VAT id, but a USA one would not. We also have the "Share Customer Accounts" option in the backend that might influence the decision, but I am positive that would cause any issues. I have to admit I have very limited experience in running more than one Website / Store / Store View. |
I am pretty sure this is because of the same ID. What if you try to change this line:
to: $this->setId('attributeGrid' . (Mage::registry('entity_type') ?? '')); |
done! I changed a bit just because Mage::registry('entity_type') is an object but thanks! works as expected. |
I just remembered that in addition to (or instead of) supporting scopes, we have the ability to set a customer attribute set per customer group. See this comment: OpenMage/magento-lts#2352 (comment)
alter table customer_group add customer_attribute_set_id smallint unsigned not null default 0;
alter table customer_group add customer_address_attribute_set_id smallint unsigned not null default 0; |
Looking into the scope issue again, and it turns out However, Magento actually has something more complicated for customer attributes with the table This is actually already functional by setting various values in System Config -> Customer Configuration -> Name and Address Options. For example, select "Default Config" and set Show Prefix to Required and it's saved in I'm still investigating the best way to wrangle this all... |
Hi @justinbeaty, when I go to checkout I get this |
I believe I hit that error too, but just haven't gone back to fix it yet. It is for sure just something small. |
@justinbeaty I've tried to solve the conflicts, hope I didn't mess things up |
I double check the merge in a bit, still working locally with some commits. |
solved minor conflicts |
8c826ab
to
2b5c4d0
Compare
Okay, some big updates: De-duplicate CodeThe generic EAV code was adapted from the product attribute code, but previously the old code was left as-is. I made all of the product attribute blocks extend the generic EAV ones. We went from net +3,624 LOC to net +1,231 LOC, which is absolutely essential for maintainability: I took pretty good care to make sure this change doesn't break things. While the other EAV types (category, customer, address) use observers to change things if needed, it is now also possible to extend the generic block classes for more control. Thus, all of the old One of the main ways this was accomplished was to convert all of the hardcoded Consolidated logic into EAV helperMagento had tons of logic spread around probably a dozen files dealing with EAV attribute's backend types, models, display options, etc. It would have been pretty much impossible to define new input types or add logic for other entity types without overriding tons of classes. Instead, I moved all of this info into the config.xml files, and wrote a bunch of helper methods to return this info. Everything is now super flexible. Rewrote JS filesInstead of the inline JS in a few files, I created new files at MiscThere's probably some other stuff too, but those are the major changes. It's very possible something broke here as I haven't fully tested, but all can be fixed and this is still a hundred times better for the long-term. One thing to note, you might see few attributes in the manage customer attribute grid. I have to investigate how Magento devs used the I also ended up merging main into this branch locally, which is the reason for the force-push. Hopefully you hadn't spent too much time resolving conflicts since I overwrote those commits. |
One more thing, I re-introduced the |
Don't worry about conflicts, I'll resolve later... |
Cherry-picked commits from OpenMage/magento-lts#2317, OpenMage/magento-lts#2352, and OpenMage/magento-lts#2353.
A couple of notes:
The files
js/varien/js.js
,skin/frontend/base/default/js/opcheckout.js
, andskin/frontend/rwd/default/scss/module/_eav.scss
had changes in GUI to Edit EAV Attributes & Sets - Customer OpenMage/magento-lts#2352, but I'm not sure where those changes go in Maho.The last two WIP commits were part of an experimental feature to automatically add fields into various customer forms in the frontend and backend. I had an experimental branch that did more work here, but I think I may have lost it.
I didn't pull any of the short array syntax, phpcs, or merge commits. Instead I rebased on top of Maho/main.