Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

Don't index disabled products or stores with disabled module #26

Open Vinai opened 11 years ago

Vinai commented 11 years ago

[From email]: My company currently uses your GroupCatalog2 module for a multi store setup. We found an issue which is causing us significant heart ache. Your module creates an index for every product for every group and every store. Even where the output is disabled. For our configuration this is not optimal as the resulting index table is over 1.5million records. Is there a way to disable the indexing for stores where the module is disabled and where the product is not listed? Any help is appreciated, thank you.

Vinai commented 11 years ago

Additional thoughts on this as a note to myself:

Definitely disable indexing of stores where the extension is disabled.

For deactivated products indexing can be disabled, too.

Products where the output is disabled (that is "Not visible individually" is selected) still have to be indexed, since they can be part of a super product (for example associated with a configurable product). If there is a fast way to check if they are used, do that, otherwise it probably is better to simply keep them in the index.

If products are out of stock and those products shouldn't be visible according to the system configuration, they could be removed from the index, too - but that would also require additional checks, which would slow down the indexing process. Once again, if I can't think of a fast way to check, simply keep them in the index, too.

Vinai commented 11 years ago

Fyi: work in progress

Vinai commented 11 years ago

In the current master disabled stores and stores where the module is deactivated are no longer included in the index. Still need to work on excluding out of stock products with disabled backorders. Will leave that for a future date though.