I have a strange issue with the Magento Target rule up-sells.
Scenario: Magento EE 1.12. 30+ store views on the same Magento instance. 30k+ products. Most of the products have the same settings on all the store views. I’ve created a rule for showing upsells as follows. “Show products from the same category with price 100% or more that the current product”. Settings for showing upsells: ‘Rule based only’ (the issue reproduces for ‘Rule based and selected’). I’ve saved the rule. reindexed everything. Everything seams to look OK, upsells appear (for the products I tested) as defined by the rule, BUT… After some time for the same product on one store view the upsells appear and on other store views they don’t. The product has the same settings on all the store views. (and it should have the same upsells.)
If I modify something in the rule and save it again the upsells start appearing on all store views but after some time the issue reproduces.
After digging in the code I found out that the upsells generated by target rule are kept in the table enterprise_targetrule_index_upsell to avoid parsing all the rules each time. Here is how it works. (the table is truncated when saving a rule) If there are any ‘target rule’ upsells in the table I mentioned then they are retrieved. If they are not then the rules are parsed and the result is put in the index table. Here are some records from that table for a specific product.
+-----------+----------+-------------------+---------------------------------------------------------------------+---------------------+
| entity_id | store_id | customer_group_id | product_ids | customer_segment_id |
+-----------+----------+-------------------+---------------------------------------------------------------------+---------------------+
| 17372 | 2 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 5 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 17 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 18 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 19 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 20 | 0 | | 0 |
| 17372 | 21 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 22 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
| 17372 | 23 | 0 | 17373,350,583,487,17664,29737,14719,443,445,29502,17666,17667,17668 | 0 |
As you can see the upsells for product with id 17372 are all the same on all the store views except store_id 20 which is blank. There is nothing special about store 20. All the products involved here are available on all the stores.
Any idea?
Thanks. Marius.
cron
configured properly. IIRC the rules are re-built nightly and without an activecron
will produce odd behaviour – Ben Lessani - Sonassi Mar 5 '13 at 12:06