Ejemplo n.º 1
0
 protected function generateMscIdOption()
 {
     $list = oseMscPublic::getList();
     $result = array();
     if (!empty($list)) {
         $cart = oseMscPublic::getCart();
         $options = array();
         $msc = oseRegistry::call('msc');
         foreach ($list as $key => $entry) {
             $msc_id = oseObject::getValue($entry, 'id');
             $node = $msc->getInfo($msc_id, 'obj');
             $paymentInfos = $msc->getExtInfo($msc_id, 'payment');
             $osePaymentCurrency = $cart->get('currency');
             $option = oseMscPublic::generatePriceOption($node, $paymentInfos, $osePaymentCurrency);
             $options = array_merge($options, $option);
         }
         $mscList = array('total' => count($list), 'results' => $list);
         $mscOptions = array('total' => count($options), 'results' => $options);
         $result = array();
         $result['mscList'] = $mscList;
         $result['mscOptions'] = $mscOptions;
     } else {
         $result['mscList'] = array();
         $result['mscOptions'] = array();
     }
     return $result;
 }
Ejemplo n.º 2
0
	private static function getAllOptions()
	{
		$list = oseMscPublic::getList();

		$options = array();

		$msc = oseRegistry::call('msc');
		foreach($list as $key => $entry)
		{
			$msc_id = oseObject::getValue($entry,'id',0);

			$node = $msc->getInfo($msc_id,'obj');
			$paymentInfos = $msc->getExtInfo($msc_id,'payment');
			
			$cart = oseMscPublic::getCart();

	    	$osePaymentCurrency = $cart->get('currency');

	    	$items = $cart->get('items');

			$option = oseMscPublic::generatePriceOption($node,$paymentInfos,$osePaymentCurrency);
			$paymentAdvInfos = $msc->getExtInfo($msc_id,'paymentAdv');
			foreach ( $option as $key => $obj )
			{
				$visible = self::checkVisibility($msc_id, $obj['id'], $paymentAdvInfos);

				if ($visible != true)
				{ 		
					unset($option[$key]);
				}
			}		
			$options = array_merge($options,$option);
		}

		$combo = array();
    	$combo['total'] = count($options);
    	$combo['results'] = $options;

    	$combo = oseJson::encode($combo);
		oseExit($combo);
	}
Ejemplo n.º 3
0
	function getAllOptions() {
		$list = oseMscPublic::getList();
		$options = array();
		$msc = oseRegistry::call('msc');
		foreach ($list as $key => $entry) {
			$msc_id = oseObject::getValue($entry, 'id');
			$node = $msc->getInfo($msc_id, 'obj');
			$paymentInfos = $msc->getExtInfo($msc_id, 'payment');
			$cart = oseMscPublic::getCart();
			$osePaymentCurrency = $cart->get('currency');
			$option = oseMscPublic::generatePriceOption($node, $paymentInfos, $osePaymentCurrency);
			$options = array_merge($options, $option);
		}
		return $options;
	}
Ejemplo n.º 4
0
	protected function generateMscIdOptionJS() {
		$list = oseMscPublic::getList();
		$cart = oseMscPublic::getCart();
		$selectedMsc = oseMscAddon::runAction('register.msc.getSelectedMsc', array());
		$options = array();
		$msc = oseRegistry::call('msc');
		foreach ($list as $key => $entry) {
			$msc_id = oseObject::getValue($entry, 'id');
			$node = $msc->getInfo($msc_id, 'obj');
			$paymentInfos = $msc->getExtInfo($msc_id, 'payment');
			$osePaymentCurrency = $cart->get('currency');
			$option = oseMscPublic::generatePriceOption($node, $paymentInfos, $osePaymentCurrency);
			$options = array_merge($options, $option);
		}
		$currency = oseMscPublic::getCurrency();
		$mscList = array('total' => count($list), 'results' => $list);
		$mscOptions = array('total' => count($options), 'results' => $options);
		$currency = array('total' => count($currency), 'results' => $currency);
		$output = "var getMscList = function()	{return " . oseJson::encode($mscList) . "};";
		$output .= "\r\n";
		$output .= "var getMscOption = function()	{return " . oseJson::encode($mscOptions) . "};";
		return $output;
	}