예제 #1
0
 public static function gettsmartRssFeed()
 {
     if (empty(self::$vmFeeds)) {
         try {
             self::$vmFeeds = self::getCPsRssFeed("http://tsmart.net/news/list-all-news?format=feed&type=rss", 5, 240);
         } catch (Exception $e) {
             echo 'Where not able to parse news feed';
         }
     }
     return self::$vmFeeds;
 }
예제 #2
0
 public function feed()
 {
     if (!class_exists('vmRSS')) {
         require VMPATH_ADMIN . '/helpers/vmrss.php';
     }
     $this->virtuemartFeed = vmRSS::getVirtueMartRssFeed();
     $this->extensionsFeed = vmRSS::getExtensionsRssFeed();
     $document = JFactory::getDocument();
     $headData = $document->getHeadData();
     $headData['scripts'] = array();
     $document->setHeadData($headData);
     ob_clean();
     ob_start();
     include VMPATH_SITE . DS . 'views' . DS . 'virtuemart' . DS . 'tmpl' . DS . 'feed.php';
     echo ob_get_clean();
     jExit();
 }
예제 #3
0
	function display($tpl = null) {

		if (!class_exists('VmImage'))
			require(VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php');
		VmConfig::loadJLang('com_virtuemart_orders',TRUE);

		$model = VmModel::getModel('virtuemart');

		$nbrCustomers = $model->getTotalCustomers();
		$this->nbrCustomers=$nbrCustomers;

		$nbrActiveProducts = $model->getTotalActiveProducts();
		$this->nbrActiveProducts= $nbrActiveProducts;
		$nbrInActiveProducts = $model->getTotalInActiveProducts();
		$this->nbrInActiveProducts= $nbrInActiveProducts;
		$nbrFeaturedProducts = $model->getTotalFeaturedProducts();
		$this->nbrFeaturedProducts= $nbrFeaturedProducts;

		$ordersByStatus = $model->getTotalOrdersByStatus();
		$this->ordersByStatus= $ordersByStatus;

		$recentOrders = $model->getRecentOrders();
			if(!class_exists('CurrencyDisplay'))require(VMPATH_ADMIN.DS.'helpers'.DS.'currencydisplay.php');

			/* Apply currency This must be done per order since it's vendor specific */
			$_currencies = array(); // Save the currency data during this loop for performance reasons
			foreach ($recentOrders as $virtuemart_order_id => $order) {

				//This is really interesting for multi-X, but I avoid to support it now already, lets stay it in the code
				if (!array_key_exists('v'.$order->virtuemart_vendor_id, $_currencies)) {
					$_currencies['v'.$order->virtuemart_vendor_id] = CurrencyDisplay::getInstance('',$order->virtuemart_vendor_id);
				}
				$order->order_total = $_currencies['v'.$order->virtuemart_vendor_id]->priceDisplay($order->order_total);
			}
		$this->recentOrders= $recentOrders;
		$recentCustomers = $model->getRecentCustomers();
		$this->recentCustomers=$recentCustomers;

		if (!class_exists('vmRSS')) require(VMPATH_ADMIN.'/helpers/vmrss.php');

		$this->extensionsFeed = vmRSS::getExtensionsRssFeed();

		$virtuemartFeed = vmRSS::getVirtueMartRssFeed();
		$this->virtuemartFeed=$virtuemartFeed;

		if(JFactory::getApplication()->isSite()){
			$bar = JToolBar::getInstance('toolbar');
			$bar->appendButton('Link', 'back', 'COM_VIRTUEMART_LEAVE', 'index.php?option=com_virtuemart&manage=0');
		}

		if($this->manager('report')){
			vmSetStartTime('report');
			$reportModel		= VmModel::getModel('report');
			vRequest::setvar('task','');
			$myCurrencyDisplay = CurrencyDisplay::getInstance();
			$revenueBasic = $reportModel->getRevenue(60,true);
			$this->report = $revenueBasic['report'];

			vmJsApi::addJScript( "jsapi","//google.com/jsapi",false,false,'' );
			vmJsApi::addJScript('vm.stats_chart',$revenueBasic['js'],false);
			vmTime('Created report','report');
		}

		parent::display($tpl);
	}
예제 #4
0
	static public function getVirtueMartRssFeed() {
 		if (empty(self::$vmFeeds)) {
			self::$vmFeeds =  self::getCPsRssFeed("http://virtuemart.net/news/list-all-news?format=feed&type=rss", 5);
		}
		return self::$vmFeeds;
	}