1

Modyfying current slider system to make it a little bit more autonomous as in it's original form I must manually remove code from list if specific products is already gone or promotion is over so I added additional attribute into table "is_slider", "start_date" and "end_date" but my collection does not work. What I've done wrong ?

    $collection = Mage::getModel('cms/block')->getCollection()
      ->addAttributeToSelect('*')
      ->addFieldToFilter('is_slider', '1')
      ->getAllIds()
      ;

Of course this code should select only ids where "is_slider" is true, regardless what date is but it is not important for now.

How to get only those Ids where "is_slider" = true?

OMG I'm blind ...... Yes of course it does work after I changed it from "page" to "block"

1 Answer 1

2

You are using Mage::getModel('cms/page') CMS Pages model.

Use Mage::getModel('cms/block') Static block model.

2
  • Thank you Pankaj, silly me, how could I not see this ? Thank you
    – Rob D. A.
    Commented Feb 22, 2018 at 14:33
  • Glad it worked for you. please accept the answer so that it will helpful for others Commented Feb 22, 2018 at 14:35

Your Answer

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

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