process collection after load collection

$  categoryid = 43;  $  layer = Mage::getModel("catalog/layer");  $  category = Mage::getModel("catalog/category")->load($  categoryid);  $  layer->setCurrentCategory($  category);  $  attributes = $  layer     ->getFilterableAttributes()     ->addDisplayInAdvancedSearchFilter()     ;  Mage::log($  attributes->getSelect());  foreach ($  attributes as $  attribute) {     echo $  attribute->getAttributeCode(). " ". $  attribute->getStoreLabel() ."<br/>"; } 

I want tho filters attributes which is used in layered navigation and used in advance search. When I print query the result query working fine but print the attribute filter they give only getFilterableAttributes.

The getFilterableAttributes method class Mage_Catalog_Model_Layer load collection first then I use addDisplayInAdvancedSearchFilter cause will effect after load collection.

I want to know is there any method load collection after loading the method. Any one face these kind of problem then please help how it works.

In class Mage_Catalog_Model_Layer method getFilterableAttributes have following code.

public function getFilterableAttributes()     {         $  setIds = $  this->_getSetIds();         if (!$  setIds) {             return array();         }         /** @var $  collection Mage_Catalog_Model_Resource_Product_Attribute_Collection */         $  collection = Mage::getResourceModel('catalog/product_attribute_collection');         $  collection             ->setItemObjectClass('catalog/resource_eav_attribute')             ->setAttributeSetFilter($  setIds)             ->addStoreLabel(Mage::app()->getStore()->getId())             ->setOrder('position', 'ASC');         $  collection = $  this->_prepareAttributeCollection($  collection);         $  collection->load();          return $  collection;     } 

When I add $ collection->addDisplayInAdvancedSearchFilter() before $ collection->load() but its wokring fine. Like This.

public function getFilterableAttributes()     {         $  setIds = $  this->_getSetIds();         if (!$  setIds) {             return array();         }         /** @var $  collection Mage_Catalog_Model_Resource_Product_Attribute_Collection */         $  collection = Mage::getResourceModel('catalog/product_attribute_collection');         $  collection             ->setItemObjectClass('catalog/resource_eav_attribute')             ->setAttributeSetFilter($  setIds)             ->addStoreLabel(Mage::app()->getStore()->getId())             ->setOrder('position', 'ASC');         $  collection = $  this->_prepareAttributeCollection($  collection);         $  collection = $  this->addDisplayInAdvancedSearchFilter();         $  collection->load();          return $  collection;     } 

Its work fine.

I don’t want to rewrite Mage_Catalog_Model_Layer Model.

Thanks

How to trigger some custom c# code when a new site collection is created? Feature Stapling, delegated control?

I am using sp 2013. I have some custom code which is adding some webpart to the welcome page. I would like to execute this code for each new site collection depending on a template (mysites). Someone told me you can do that with a feature stapling or delegated control. Can someone tell me if it is possible with delegated control or feature stappling? And maybe how to implement this?

Cannot Drag and Drop Document Set from one Document Library to Another in another Site Collection

I have a Document Set in a O365 Groups Team Site collection that I would like to drag and drop to another document library in a Hub Site that the Groups site is associated with – via Windows Explorer / Finder.

This partly works in Finder, however the Document Set is converted to a Folder – on Windows Explorer I cannot get it to work at all.

Is this even possible? how can I allow users to move a document set from one library to another?

This is in SharePoint Online.

Thanks,

Magento 2: Get Product Collection by Dropdown Value

How do you get a collection of products based on the drop down attribute value instead of the id?

.... protected $  collectionFactory;  public function __construct(     ...     \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $  collectionFactory ) {     ...     $  this->collectionFactory = $  collectionFactory; }  protected function checkProducts() {         $  product = $  this->collectionFactory->create()     ->addAttributeToSelect('*')     ->addFieldToFilter('new_product_status', ['eq' => 254]) // filter by value instead of id here     ->setPageSize(1)     ->getFirstItem();   } ... 

Probability of a random collection of subsets being a cover

Consider the set $ [n]=\{1,2,\ldots,n\}$ . Suppose for each set $ A\subseteq [n]$ I have a $ p_A \in [0,1]$ . I now create a random collection $ \mathcal{W}\subseteq\mathcal{P}([n])$ of subsets of $ [n]$ by including each $ A$ with probability $ p_A$ , independently. What is the probability that their union covers $ [n]$ , that is, that $ $ \bigcup_{W\in\mathcal{W}} W = [n]$ $

This seems like a problem that absolutely has been considered before — it’s easy to state and seems natural — and the answer should “just” be some suitably symmetric multivariate polynomial. Unfortunately, I can’t figure it out on my own, and my google-fu hasn’t availed me either.