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.
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).
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.
- All Categories
- 38 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 33 Spryker News
- 549 Developer Corner
- 420 Spryker Development
- 54 Spryker Dev Environment
- 284 Spryker Releases
- 30 Propel ORM
- 46 Community Projects
- 6 Gacela Project
- 3 PHP Bridge
- 21 Hackathon
- 3.2K 📜 Slack Archives
- 115 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random
- 4 Code Testing
- 23 Product & Business Questions
- 44 Spryker Safari Questions
- 36 The Blackhole