当前位置: 首页>>代码示例>>PHP>>正文


PHP vmDebug函数代码示例

本文整理汇总了PHP中vmDebug函数的典型用法代码示例。如果您正苦于以下问题:PHP vmDebug函数的具体用法?PHP vmDebug怎么用?PHP vmDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了vmDebug函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOrderDetails

 public function getOrderDetails()
 {
     $orderModel = VmModel::getModel('orders');
     $orderDetails = 0;
     // If the user is not logged in, we will check the order number and order pass
     if ($orderPass = JRequest::getString('order_pass', false) and $orderNumber = JRequest::getString('order_number', false)) {
         $orderId = $orderModel->getOrderIdByOrderPass($orderNumber, $orderPass);
         if (empty($orderId)) {
             vmDebug('Invalid order_number/password ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
             return 0;
         }
         $orderDetails = $orderModel->getOrder($orderId);
     }
     if ($orderDetails == 0) {
         $_currentUser = JFactory::getUser();
         $cuid = $_currentUser->get('id');
         // If the user is logged in, we will check if the order belongs to him
         $virtuemart_order_id = JRequest::getInt('virtuemart_order_id', 0);
         if (!$virtuemart_order_id) {
             $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(JRequest::getString('order_number'));
         }
         $orderDetails = $orderModel->getOrder($virtuemart_order_id);
         JLoader::register('Permissions', JPATH_VM_ADMINISTRATOR . '/helpers/permissions.php');
         if (!Permissions::getInstance()->check("admin")) {
             if (!empty($orderDetails['details']['BT']->virtuemart_user_id)) {
                 if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                     echo 'view ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                     return;
                 }
             }
         }
     }
     return $orderDetails;
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:34,代码来源:invoice.php

示例2: showPP

 /**
  * @param $product
  * @return bool
  */
 private function showPP($product)
 {
     if (!isset($this->klarna_virtuemart) || !$this->klarna_virtuemart instanceof Klarna_virtuemart) {
         return FALSE;
     }
     if (!VMKLARNA_SHOW_PRODUCTPRICE) {
         return FALSE;
     }
     // the price is in the vendor currency
     // convert price in NLD currency= euro
     $price = KlarnaHandler::convertPrice($product->prices['salesPrice'], $product->product_currency, 'EUR');
     if (strtolower($this->cData['country_code']) == 'nl' && $price > 250) {
         vmDebug('showPP', 'dont show price for NL', $this->cData['country_code'], $price);
         return FALSE;
     }
     if ($price <= $this->cData['min_amount'] and !empty($this->cData['min_amount'])) {
         return FALSE;
     }
     return TRUE;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:24,代码来源:klarna_productprice.php

示例3: plgVmConfirmedOrder


//.........这里部分代码省略.........
         $toCheck = array('last_name', 'first_name', 'middle_name', 'phone_1', 'phone_2', 'fax', 'address_1', 'address_2', 'city', 'virtuemart_state_id', 'virtuemart_country_id', 'zip');
         $bsError = false;
         foreach ($toCheck as $val) {
             if (isset($order['details']['ST']->{$val})) {
                 if ($order['details']['ST']->{$val} != $order['details']['BT']->{$val}) {
                     $bsError = true;
                     $errorVal = $val;
                     break;
                 }
             }
         }
         if ($bsError) {
             $msg = vmText::_('VMPAYMENT_HEIDELPAY_TECHNICAL_ERROR') . "<br />" . vmText::_('VMPAYMENT_HEIDELPAY_BILLSAFE_ERROR') . "<br />";
             $app = JFactory::getApplication();
             $app->redirect('index.php?option=com_virtuemart&view=cart', $msg);
         }
         $params['PAYMENT.CODE'] = "IV.PA";
         $params['ACCOUNT.BRAND'] = "BILLSAFE";
         $params = array_merge($params, $this->getBasketDetails());
     }
     /*
      *  User account information
      */
     $params['ACCOUNT.HOLDER'] = $address->first_name . " " . $address->last_name;
     $params['NAME.GIVEN'] = $address->first_name;
     $params['NAME.FAMILY'] = $address->last_name;
     if (!empty($address->company)) {
         $params['NAME.COMPANY'] = $address->company;
     }
     $params['ADDRESS.STREET'] = $address->address_1;
     isset($address->address_2) ? $params['ADDRESS.STREET'] .= " " . $address->address_2 : '';
     $params['ADDRESS.ZIP'] = $address->zip;
     $params['ADDRESS.CITY'] = $address->city;
     $params['ADDRESS.COUNTRY'] = ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code');
     $params['CONTACT.EMAIL'] = $order['details']['BT']->email;
     $params['CONTACT.IP'] = $_SERVER['REMOTE_ADDR'];
     /*
      * Add debug informations for merchiant support
      */
     $params['SHOP.TYPE'] = 'VirtueMart ' . VmConfig::getInstalledVersion();
     $params['SHOPMODULE.VERSION'] = $this->version;
     $params['CRITERION.PAYMENT_NAME'] = vmText::_('VMPAYMENT_HEIDELPAY_' . $method->HEIDELPAY_PAYMENT_TYPE);
     $params['CRITERION.PAYMENT_NAME'] = strip_tags($params['CRITERION.PAYMENT_NAME']);
     /*
      * Create hash to secure the response
      */
     $params['CRITERION.SECRET'] = $this->createSecretHash($order['details']['BT']->order_number, $method->HEIDELPAY_SECRET);
     /*
      * Set transaction mode
      */
     if ($method->HEIDELPAY_TRANSACTION_MODE == 2) {
         $params['TRANSACTION.MODE'] = "LIVE";
     } elseif ($method->HEIDELPAY_TRANSACTION_MODE == 0) {
         $params['TRANSACTION.MODE'] = "INTEGRATOR_TEST";
     } else {
         $params['TRANSACTION.MODE'] = "CONNECTOR_TEST";
     }
     /*
      * Add response and css path
      */
     $params['FRONTEND.RESPONSE_URL'] = JROUTE::_(JURI::root(), $xhtml = true, $ssl = 0) . 'plugins/vmpayment/heidelpay/heidelpay/heidelpay_response.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . urlencode($order['details']['BT']->order_number) . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id;
     $cssFile = "heidelpay_default.css";
     if (!empty($method->HEIDELPAY_STYLE)) {
         $cssFile = $method->HEIDELPAY_STYLE;
     }
     $params['FRONTEND.CSS_PATH'] = JROUTE::_(JURI::root(), $xhtml = true, $ssl = 0) . 'plugins/vmpayment/heidelpay/heidelpay/' . $cssFile;
     $requestUrl = $method->HEIDELPAY_PAYMENT_URL;
     $params['SECURITY.SENDER'] = $method->HEIDELPAY_SECURITY_SENDER;
     $params['USER.LOGIN'] = $method->HEIDELPAY_USER_LOGIN;
     $params['USER.PWD'] = $method->HEIDELPAY_USER_PW;
     if (substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2) == 'DD') {
         $sepaform = array();
         $sepaform = $this->switchDirectDebitFrom($method->HEIDELPAY_SEPA_FORM);
         $params = array_merge($sepaform, $params);
     }
     /*
      * send request to payment server
      */
     $response = $this->doRequest($requestUrl, $params, $method->HEIDELPAY_DEBUG);
     if ($params['TRANSACTION.MODE'] != "LIVE") {
         vmInfo('VMPAYMENT_HEIDELPAY_PAYMENT_TESTMODE');
     }
     /*
      * On success show iframe or show error information for your customer
      */
     $returnValue = 0;
     if ($response['PROCESSING_RESULT'] == "ACK" || $response['POST_VALIDATION'] == "ACK") {
         $returnValue = 2;
         $html = $this->renderByLayout('displaypayment', array('response' => $response['FRONTEND_REDIRECT_URL']));
     } else {
         $html = vmText::_('VMPAYMENT_HEIDELPAY_TECHNICAL_ERROR') . " <br /> - " . addslashes($response['PROCESSING_RETURN']) . "<br />" . vmText::_('VMPAYMENT_HEIDELPAY_CONTACT_SHOPOWNER');
     }
     /*
      * Show debug information
      */
     if ($method->HEIDELPAY_DEBUG == 1) {
         vmDebug('HEIDELPAY plgVmConfirmedOrder', $params);
     }
     return $this->processConfirmedOrderPaymentResponse($returnValue, $cart, $order, $html, '', '');
 }
开发者ID:cybershocik,项目名称:Darek,代码行数:101,代码来源:heidelpay.php

示例4: plgVmOnUserPaymentCancel

 /**
  * @return bool|null
  */
 function plgVmOnUserPaymentCancel()
 {
     $order_number = vRequest::getString('on', '');
     $virtuemart_paymentmethod_id = vRequest::getInt('pm', '');
     if (empty($order_number) or empty($virtuemart_paymentmethod_id) or !$this->selectedThisByMethodId($virtuemart_paymentmethod_id)) {
         vmdebug('plgVmOnUserPaymentCancel', $order_number, $virtuemart_paymentmethod_id);
         return NULL;
     }
     if (!class_exists('VirtueMartModelOrders')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
     }
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
         return NULL;
     }
     if (!($paymentTable = $this->getDataByOrderId($virtuemart_order_id))) {
         return NULL;
     }
     vmdebug('plgVmOnUserPaymentCancel', 'VMPAYMENT_SOFORT_PAYMENT_CANCELLED');
     VmInfo(vmText::_('VMPAYMENT_SOFORT_PAYMENT_CANCELLED'));
     $session = JFactory::getSession();
     $return_context = $session->getId();
     if (strcmp($paymentTable->sofort_custom, $return_context) === 0) {
         vmDebug('handlePaymentUserCancel');
         $this->handlePaymentUserCancel($virtuemart_order_id);
     } else {
         vmDebug('Return context', $paymentTable->sofort_custom, $return_context);
     }
     return TRUE;
 }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:32,代码来源:sofort.php

示例5: array

    if (!class_exists($_class)) {
        require $basePath . DS . 'controllers' . DS . $_controller . '.php';
    }
} else {
    // try plugins
    JPluginHelper::importPlugin('vmextended');
    $dispatcher = JDispatcher::getInstance();
    $rets = $dispatcher->trigger($trigger, array($_controller));
    foreach ($rets as $ret) {
        if ($ret) {
            return true;
        }
    }
}
if (class_exists($_class)) {
    $controller = new $_class();
    $controller->execute($task);
    //vmTime($_class.' Finished task '.$task,'Start');
    vmRam('End');
    vmRamPeak('Peak');
    /* Redirect if set by the controller */
    $controller->redirect();
} else {
    vmDebug('VirtueMart controller not found: ' . $_class);
    if (tsmConfig::get('handle_404', 1)) {
        $mainframe = Jfactory::getApplication();
        $mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=tsmart', FALSE));
    } else {
        JError::raise(E_ERROR, '404', 'Not found');
    }
}
开发者ID:cuongnd,项目名称:etravelservice,代码行数:31,代码来源:tsmart.php

示例6: convertPrice

 /**
  * @static
  * @param        $price
  * @param string $toCurrency
  * @return float
  */
 static function convertPrice($price, $fromCurrency, $toCurrency = '', $cartPricesCurrency = '')
 {
     if (!(is_int($toCurrency) or is_numeric($toCurrency)) && !empty($toCurrency)) {
         $toCurrency = ShopFunctions::getCurrencyIDByName($toCurrency);
     }
     if ($fromCurrency == $toCurrency) {
         return $price;
     }
     // product prices or total in cart is always in vendor currency
     $priceInNewCurrency = vmPSPlugin::getAmountInCurrency($price, $toCurrency);
     // set back the currency display
     if (empty($cartPricesCurrency)) {
         $cartPricesCurrency = $fromCurrency;
     }
     $cd = CurrencyDisplay::getInstance($cartPricesCurrency);
     vmDebug('convertPrice', $price, $toCurrency, $fromCurrency, $cartPricesCurrency, $priceInNewCurrency);
     return $priceInNewCurrency['value'];
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:24,代码来源:klarnahandler.php

示例7: plgVmOnUserPaymentCancel

 /**
  * @return bool|null
  */
 function plgVmOnUserPaymentCancel()
 {
     $order_number = vRequest::getString('on', '');
     // cancel / abort link must be insterted in the SOFORT BE
     // must be http://mysite.com/index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=-REASON1-
     $virtuemart_paymentmethod_id = vRequest::getInt('pm', '');
     if (empty($order_number) or empty($virtuemart_paymentmethod_id) or !$this->selectedThisByMethodId($virtuemart_paymentmethod_id)) {
         return NULL;
     }
     $error_codes = vRequest::getString('error_codes', '');
     if (!empty($error_codes)) {
         $errors = explode(",", $error_codes);
         foreach ($errors as $error) {
             // TODO
             $lang = JFactory::getLanguage();
             $lang_key = 'VMPAYMENT_SOFORT_IDEAL_ERROR_CODES_' . $error;
             if ($lang->hasKey($lang_key)) {
                 vmInfo(vmText::_($lang_key));
             } else {
                 vmInfo(vmText::sprintf('VMPAYMENT_SOFORT_IDEAL_ERROR_CODES_UNKNOWN_CODE', $error));
             }
         }
         //return false;
     }
     if (!class_exists('VirtueMartModelOrders')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
     }
     if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
         return NULL;
     }
     if (!($paymentTable = $this->getDataByOrderId($virtuemart_order_id))) {
         return NULL;
     }
     if (!($method = $this->getVmPluginMethod($paymentTable->virtuemart_paymentmethod_id))) {
         return NULL;
         // Another method was selected, do nothing
     }
     if (!$this->selectedThisElement($method->payment_element)) {
         //vmdebug('IDEAL plgVmOnPaymentResponseReceived NOT selectedThisElement'  );
         return NULL;
     }
     vmdebug(__CLASS__ . '::' . __FUNCTION__, 'VMPAYMENT_SOFORT_PAYMENT_CANCELLED', $error_codes);
     if (empty($error_codes)) {
         VmInfo(vmText::_('VMPAYMENT_SOFORT_PAYMENT_CANCELLED'));
         $comment = '';
     } else {
         $comment = vmText::_($lang_key);
     }
     $session = JFactory::getSession();
     $return_context = $session->getId();
     vmDebug('handlePaymentUserCancel', $virtuemart_order_id, $paymentTable->sofort_custom, $return_context);
     if (strcmp($paymentTable->sofort_custom, $return_context) === 0) {
         vmDebug('handlePaymentUserCancel', $virtuemart_order_id);
         $this->handlePaymentUserCancel($virtuemart_order_id, $method->status_canceled, $comment);
     } else {
         vmDebug('Return context', $paymentTable->sofort_custom, $return_context);
     }
     return TRUE;
 }
开发者ID:proyectoseb,项目名称:Matrix,代码行数:62,代码来源:sofort_ideal.php

示例8: plgVmOnSelectCheckPayment

	/**
	 * This event is fired after the payment method has been selected. It can be used to store
	 * additional payment info in the cart.
	 *
	 * @author Valérie isaksen
	 *
	 * @param VirtueMartCart $cart: the actual cart
	 * @return null if the payment was not selected, true if the data is valid, error message if the data is not vlaid
	 *
	 */
	public function plgVmOnSelectCheckPayment (VirtueMartCart $cart, &$msg) {

		if (!$this->selectedThisByMethodId ($cart->virtuemart_paymentmethod_id)) {
			return NULL; // Another method was selected, do nothing
		}
		if (!($method = $this->getVmPluginMethod ($cart->virtuemart_paymentmethod_id))) {
			return NULL; // Another method was selected, do nothing
		}
		if (!class_exists ('KlarnaAddr')) {
			require (JPATH_VMKLARNAPLUGIN . DS . 'klarna' . DS . 'api' . DS . 'klarnaaddr.php');
		}

		$session = JFactory::getSession ();
		$sessionKlarna = new stdClass();
		//$post = JRequest::get('post');
		$errors = array();
		$klarnaData_paymentmethod = JRequest::getVar ('klarna_paymentmethod', '');
		if ($klarnaData_paymentmethod == 'klarna_invoice') {
			$sessionKlarna->klarna_option = 'invoice';
		} elseif ($klarnaData_paymentmethod == 'klarna_partPayment') {
			$sessionKlarna->klarna_option = 'part';
		} elseif ($klarnaData_paymentmethod == 'klarna_speccamp') {
			$sessionKlarna->klarna_option = 'spec';
		} else {
			return NULL;

		}

		// Store payment_method_id so we can activate the
		// right payment in case something goes wrong.
		$sessionKlarna->virtuemart_payment_method_id = $cart->virtuemart_paymentmethod_id;
		$sessionKlarna->klarna_paymentmethod = $klarnaData_paymentmethod;
		$country3 = NULL;
		$countryId = 0;
		$this->_getCountryCode ($cart, $country3, $countryId, 'country_3_code');
		// $country2=  strtolower($country2);
		if (empty($country3)) {
			$country3 = "SWE";
			$countryId = ShopFunctions::getCountryIDByName ($country3);
		}

		$cData = KlarnaHandler::countryData ($method, strtoupper ($country3));

		$klarnaData = KlarnaHandler::getDataFromEditPayment ();

		if ($msg = KlarnaHandler::checkDataFromEditPayment ($klarnaData, $cData['country_code_3'])) {
			//vmInfo($msg); // meanwhile the red baloon works
			$session->set ('Klarna', serialize ($sessionKlarna), 'vm');
			return FALSE;
		}

		$klarnaData['country'] = $cData['country_code'];
		$klarnaData['country3'] = $cData['country_code_3'];

		//$country = $cData['country_code']; //KlarnaHandler::convertCountry($method, $country2);
		//$lang = $cData['language_code']; //KlarnaHandler::getLanguageForCountry($method, $country);
		// Get the correct data
		//Removes spaces, tabs, and other delimiters.
		// If it is a swedish customer we use the information from getAddress
		if (strtolower ($cData['country_code']) == "se") {
			$swedish_addresses = KlarnaHandler::getAddresses ($klarnaData['socialNumber'], $cData, $method);
			if (empty($swedish_addresses)) {
				$msg = JText::_ ('VMPAYMENT_KLARNA_ERROR_TITLE_2');
				$msg .= JText::_ ('VMPAYMENT_KLARNA_NO_GETADDRESS');
				$session->set ('Klarna', serialize ($sessionKlarna), 'vm');
				return FALSE;
			}
			//This example only works for GA_GIVEN.
			foreach ($swedish_addresses as $address) {
				if ($address->isCompany) {
					$klarnaData['company_name'] = $address->getCompanyName ();
					$klarnaData['first_name'] = "-";
					$klarnaData['last_name'] = "-";
				} else {
					$klarnaData['first_name'] = $address->getFirstName ();
					$klarnaData['last_name'] = $address->getLastName ();
				}
				$klarnaData['street'] = $address->getStreet ();
				$klarnaData['zip'] = $address->getZipCode ();
				$klarnaData['city'] = $address->getCity ();
				$klarnaData['country'] = $address->getCountryCode ();
				$countryId = $klarnaData['virtuemart_country_id'] = shopFunctions::getCountryIDByName ($klarnaData['country']);
			}
			foreach ($klarnaData as $key => $value) {
				$klarnaData[$key] = mb_convert_encoding ($klarnaData[$key], 'UTF-8', 'ISO-8859-1');
			}
		}
		$address_type = NULL;
		$st = $this->getCartAddress ($cart, $address_type, TRUE);
		vmDebug ('getCartAddress', $st);
//.........这里部分代码省略.........
开发者ID:sergy444,项目名称:joomla,代码行数:101,代码来源:klarna.php

示例9: getMyOrderDetails

 /**
  * This is a proxy function to return an order safely, we may set the getOrder function to private
  * Maybe the right place would be the controller, cause there are JRequests in it. But for a fast solution,
  * still better than to have it 3-4 times in the view.html.php of the views.
  * @author Max Milbers
  *
  * @return array
  */
 public function getMyOrderDetails($orderID = 0, $orderNumber = false, $orderPass = false)
 {
     $_currentUser = JFactory::getUser();
     $cuid = $_currentUser->get('id');
     $orderDetails = false;
     // If the user is not logged in, we will check the order number and order pass
     if (empty($cuid)) {
         $sess = JFactory::getSession();
         $orderNumber = vRequest::getString('order_number', $orderNumber);
         $tries = $sess->get('getOrderDetails.' . $orderNumber, 0);
         if ($tries > 5) {
             vmDebug('Too many tries, Invalid order_number/password ' . vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
             return false;
         }
         // If the user is not logged in, we will check the order number and order pass
         if ($orderPass = vRequest::getString('order_pass', $orderPass)) {
             $orderId = $this->getOrderIdByOrderPass($orderNumber, $orderPass);
             if (empty($orderId)) {
                 echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                 vmdebug('getMyOrderDetails COM_VIRTUEMART_RESTRICTED_ACCESS', $orderNumber, $orderPass, $tries);
                 $tries++;
                 $sess->set('getOrderDetails.' . $orderNumber, $tries);
                 return false;
             }
             $orderDetails = $this->getOrder($orderId);
         }
     } else {
         // If the user is logged in, we will check if the order belongs to him
         $virtuemart_order_id = vRequest::getInt('virtuemart_order_id', $orderID);
         if (!$virtuemart_order_id) {
             $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(vRequest::getString('order_number'));
         }
         $orderDetails = $this->getOrder($virtuemart_order_id);
         $user = JFactory::getUser();
         if (!vmAccess::manager('orders')) {
             if (!isset($orderDetails['details']['BT']->virtuemart_user_id)) {
                 $orderDetails['details']['BT']->virtuemart_user_id = 0;
             }
             if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                 echo vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                 return false;
             }
         }
     }
     return $orderDetails;
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:54,代码来源:orders.php

示例10: plgVmOnSelfCallBE

 /**
  * plgVmOnSelfCallBE ... Called to execute some plugin action in the backend (e.g. set/reset dl counter, show statistics etc.)
  */
 function plgVmOnSelfCallBE($type, $name, &$output)
 {
     if ($name != $this->_name || $type != 'vmshopper') {
         return false;
     }
     vmDebug('plgVmOnSelfCallBE');
     $user = JFactory::getUser();
     $authorized = ($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart') or $user->authorise('vm.orders', 'com_virtuemart'));
     $json = array();
     $json['authorized'] = $authorized;
     if (!$authorized) {
         return FALSE;
     }
     $action = vRequest::getCmd('action');
     $counter = vRequest::getString('counter');
     $nrtype = vRequest::getInt('nrtype');
     $json['action'] = $action;
     $json['success'] = 0;
     // default: unsuccessfull
     switch ($action) {
         case "deleteCounter":
             $json['success'] = $this->_deleteCounter($nrtype, $counter);
             break;
         case "addCounter":
             $value = vRequest::getInt('value', 0);
             if ($this->_counterExists($nrtype, $counter)) {
                 $json['error'] = JText::sprintf('PLG_ORDERNUMBER_COUNTERLIST_EXISTS', $counter);
                 $json['success'] = false;
             } else {
                 $json['success'] = $this->_addCounter($nrtype, $counter, $value);
                 // Return the table row for the new counter in the JSON:
                 $pluginpath = '/plugins/vmshopper/ordernumber/ordernumber/';
                 $displayfmt = $counter == "" ? JText::_('PLG_ORDERNUMBER_COUNTERLIST_GLOBAL') : $counter;
                 $html = array();
                 $html[] = "<tr class='counter_row counter_type_{$nrtype}'>";
                 $html[] = "  <td class='counter_format'>" . (string) $displayfmt . "</td>";
                 $html[] = "  <td class='counter_value'>" . (string) $value . "</td>";
                 $html[] = "  <td class='counter_buttons'><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-edit.png' class='vmordernumber-counter-editbtn vmordernumber-btn' onClick='ajaxEditCounter(this, {$nrtype}, " . json_encode($counter) . ", {$value})' /><img src='" . JURI::root(true) . $pluginpath . "assets/images/icon-16-delete.png' class='vmordernumber-counter-deletebtn vmordernumber-btn' onClick='ajaxDeleteCounter(this, {$nrtype}, " . json_encode($counter) . ", {$value})' /></td>";
                 $html[] = "</tr>";
                 $json['newrow'] = implode("\n", $html);
             }
             break;
         case "setCounter":
             $value = vRequest::getInt('value');
             $json['success'] = $this->_setCounter($nrtype, $counter, $value);
             break;
     }
     // Also return all messages (in HTML format!):
     // Since we are in a JSON document, we have to temporarily switch the type to HTML
     // to make sure the html renderer is actually used
     $document = JFactory::getDocument();
     $previoustype = $document->getType();
     $document->setType('html');
     $msgrenderer = $document->loadRenderer('message');
     $json['messages'] = $msgrenderer->render('Message');
     $document->setType($previoustype);
     // WORKAROUND for broken (i.e. duplicate) content-disposition headers in Joomla 2.x:
     // We request everything in raw and here send the headers for JSON and return
     // the raw output in json format
     $document = JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     JResponse::setHeader('Content-Disposition', 'attachment;filename="ordernumber.json"');
     $output = json_encode($json);
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:67,代码来源:ordernumber.php

示例11: getOrderDetails

 public function getOrderDetails()
 {
     $orderModel = VmModel::getModel('orders');
     $orderDetails = 0;
     // If the user is not logged in, we will check the order number and order pass
     if ($orderPass = vRequest::getString('order_pass', false) and $orderNumber = vRequest::getString('order_number', false)) {
         $orderId = $orderModel->getOrderIdByOrderPass($orderNumber, $orderPass);
         if (empty($orderId)) {
             vmDebug('Invalid order_number/password ' . vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
             return 0;
         }
         $orderDetails = $orderModel->getOrder($orderId);
     }
     if ($orderDetails == 0) {
         $_currentUser = JFactory::getUser();
         $cuid = $_currentUser->get('id');
         // If the user is logged in, we will check if the order belongs to him
         $virtuemart_order_id = vRequest::getInt('virtuemart_order_id', 0);
         if (!$virtuemart_order_id) {
             $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(vRequest::getString('order_number'));
         }
         $orderDetails = $orderModel->getOrder($virtuemart_order_id);
         $user = JFactory::getUser();
         if ($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart')) {
             if (!empty($orderDetails['details']['BT']->virtuemart_user_id)) {
                 if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) {
                     echo 'view ' . vmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS');
                     return;
                 }
             }
         }
     }
     return $orderDetails;
 }
开发者ID:cybershocik,项目名称:Darek,代码行数:34,代码来源:invoice.php

示例12: convertPrice

 /**
  * @static
  * @param        $price
  * @param string $toCurrency
  * @return float
  */
 static function convertPrice($price, $cartPricesCurrency, $toCurrency = '')
 {
     if (!(is_int($toCurrency) or is_numeric($toCurrency)) && !empty($toCurrency)) {
         $toCurrency = ShopFunctions::getCurrencyIDByName($toCurrency);
     }
     if ($cartPricesCurrency == $toCurrency) {
         return $price;
     }
     $currencyToConvert = CurrencyDisplay::getInstance($toCurrency);
     // product prices or total in cart is always in vendor currency
     $priceInNewCurrency = round($currencyToConvert->convertCurrencyTo($toCurrency, $price, FALSE), 2);
     // set back the currency display
     $cd = CurrencyDisplay::getInstance($cartPricesCurrency);
     vmDebug('convertPrice', $price, $cartPricesCurrency, $toCurrency, $priceInNewCurrency);
     return $priceInNewCurrency;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:22,代码来源:klarnahandler.php


注:本文中的vmDebug函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。