0

I'm looking for for a way to modify CMS pages that are available in one store and aren't available in another store. First problem is that I cannot filter cms pages the usual way:

$collection = Mage::getModel('cms/page')->getCollection()
   ->addStoreFilter($oneStore)
   ->addFilter('store', array('nin' => $anotherStore->getId()), 'public');

Collection matches pages available for all store views ignoring 'not in' filter.

Edit: Following code gets stores that have relation with $oneStore but still it doesn't check if they have relation with $anotherStore:

$collection = Mage::getModel('cms/page')->getCollection()
   ->addStoreFilter($oneStore, false);
$collection->load();

1 Answer 1

0

try just

$collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter($oneStore);

without ->addFilter('store', array('nin' => $anotherStore->getId()), 'public');

1
  • Same result, incorrect answer
    – Luke
    Feb 8, 2017 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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