Skip to main content

Why is the Relation Between a Configurable Product and a Simple Product Stored Twice?


Deep dive on the Magento internals here, not looking for a solution to a concrete problem, just trying to understand some implementation details.



When you create a Configurable Product in Magento, and then create child Simple Products to implement things like shirt size, color, etc., Magento stores this relationship in two separate tables.




catalog_product_relation
catalog_product_superlink_table



Why are these relationships stored twice?



Is this legacy code, or is there a semantic distinction between a product relation link and a product "superlink" link?



Does the system expect these to be the same, or is it a valid object state to have these tables representing different parent/child relationships?


Source: Tips4allCCNA FINAL EXAM

Comments

  1. Why is great question. The catalog_product_super_link table only contains data related to configurable products. catalog_product_relation also contains the relation information for bundled and grouped products, in addition to the configurable relations.

    All the business logic revolving around configurable products refers to the catalog_product_super_*tables, e.g. finding the configurable attributes and price updates for a configurable product.

    The catalog_product_relation table in contrast is used by classes not specific to configurable products, like the abstract catalog product indexer classes.

    It seems that the Magento core team wanted to separate the logically distinct functionality not only into separate PHP classes, but also into separate database tables. Possible advantages? I guess theoretically it is easier this way to change the configurable product implementation without disrupting the indexer implementation.

    This is just a guess - I haven't confirmed that or spoken with someone who "knows" (mental-note-for-imagine)

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex