Filtering products on specific super attributes?
For context: I'm in the middle of implementing a feature where I have to update the stock for products sharing a specific super-attribute, and that share another super-attribute.
I ended up in the SpyStockProduct::doUpdate() method.
Example:
Product A has superAttribute1 = blue and superAttribute2 = wood
Product B has superAttribute1 = yellow and superAttribute2 = wood
Product C has superAttribute1 = green and superAttribute2 = metal
When I have to update product A, I want product B to be added to the select criteria. I can get product abstracts, but I don't see an obvious (performant) way of filtering out by shared super attribute (in this case, all concrete products that have superAttribute = wood). Attributes are stored as a json object (text type in mysql).
I thought of crating some kind of functional indexes, but apparently propel is not ready for that (I can only add columns to indexes?). Also filtering out on some regex (expensive, I'd say).
Any ideas?
P.S. We are already studying the possibility to update product structure to match better the feature requirements, but we need to fix this for now first.
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 896 Developer Corner
- 758 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 23 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random