Skip to content

a base module targeted at devs to implement tracking of various statistics

License

Notifications You must be signed in to change notification settings

Cotya/Magento_StatisticsBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Cotya_StatisticsBase

a base module targeted at devs to implement tracking of various statistics over time

Example usage

    $now = strtotime('now');
    $numberOfActiveProducts = 0;
    
    $collection =  Mage::getModel('catalog/product')->getCollection();
    $collection->addAttributeToSelect('status');
    
    foreach( $collection as $product ){
        if($product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED){
            $numberOfActiveProducts++;
        }
    }

    $entry = Mage::getModel('cotya_statisticsbase/entry');
    $entry->setType('my_example/number_of_active_products');
    $entry->setWhen($now);
    $entry->setValue($numberOfActiveProducts);
    $entry->save();

About

a base module targeted at devs to implement tracking of various statistics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages