I have a problem getting the collection, I have two shops and each one have their sku prepended the shop code like EN_1234 FR_3513. I tried to get the collection like always:
$productCollection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('entity_id') ->addAttributeToFilter('sku', array('like' => $shop.'%'));
But from a time to now it only works for one shop, EN. I saw the query and it's getting their data from
catalog_product_flat_1 where all the products are from EN, but the products of FR are in
I tried to reindex by console and with the admin, but nothing. What can I do?
$shop = 'EN' or $shop = 'FR'
I see part of the problem is because I'm calling a script I have in the root of magento, If I use this same function inside the model all works.