0

A Magento EE 1.14.0.1 site I'm working on was having problem with target rules. The rule would be something very simple, like this:

Products to Match:
If ALL of these conditions are TRUE:
Category is 10

Products to Display:
If ALL of these conditions are TRUE:
Product Collection contains Matched Product Collection

Now "Collection" is a custom attribute that we created (attribute code is collections.) It's a multiselect, with a scope of "Store View". We also imported the nearly 1000 options for that attribute, and over 10,000 attribute-to-product values. When we imported these values, we set the store_id to 1.

I should note that we only have one website (ID: 1) one store group (ID: 1) and one store view (ID: 1) so setting the store_id to 1 in catalog_product_entity_value seemed okay.

We noticed that the subselect that the Target Rule module creates has store_id = 0 in it though, and that no products ever matched based on this collections attribute. It wasn't until we changed all of the values in catalog_product_entity_value to have store_id = 0 that this Target Rule started working.

There isn't even a means to select a store view in the admin because we only have one on the site, and there are thousands of attribute values in catalog_product_entity_value with a store_id of 1, so why must I set this particular attribute to 0 to get it to work?

  • Have you fount a reason of it? – Amasty Jul 30 '14 at 21:20
0

I heard back from Magento, and they told us:

Magento should always have the value for store_id = 0, because it is for admin store.

If the merchant has more than 1 store and wants to set some specific attribute value for this store, Magento will add new record with a value for this attribute and set store_id depending on this store.

That makes sense, and I plan to adjust any and all custom import code accordingly, as I can't be sure what other Magento functions expect this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.