Block function how to set data:

public function getSocialCounts(){

    $_helper = Mage::helper('vgodfollowers');
    
    $socialCounts = array();
    $socialCounts['facebook_likes'] = $_helper->getFacebookLikes();
    $socialCounts['youtube_subscribers'] = $_helper->getYoutubeSubscribers();
    $socialCounts['youtube_channel_views'] = $_helper->getYoutubeChannelViews();
    $socialCounts['instagram_followers'] = $_helper->getInstagramFollowers();
    $socialCounts['hash_tag_vgod_posts'] = $_helper->getHashTagVgodPost();
    $socialCounts['twitter_followers'] = $_helper->getTwitterFollowers();
    $socialCounts['total_followers'] = $_helper->getTotalFollowersCount();
    $socialCounts['total_followers_last_week'] = $_helper->getLastWeekTotalFollowersCount();
    $socialCounts['last_updated_date'] = $_helper->getLastUpdatedDate();
    
    $socialCountsObj = new Varien_Object();
    $socialCountsObj->setData($socialCounts);
    return $socialCountsObj;
}

Block .phtml file how to get data

<?php $socialCountData = $this->getSocialCounts(); ?>
<?php echo number_format($socialCountData->getFacebookLikes()); ?>

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *