本文整理汇总了PHP中vmInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP vmInfo函数的具体用法?PHP vmInfo怎么用?PHP vmInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vmInfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: displayErrors
function displayErrors($errors)
{
foreach ($errors as $error) {
vmError(vmText::sprintf('VMPAYMENT_SOFORT_ERROR_FROM', $error['message'], $error['field'], $error['code']));
vmInfo(vmText::sprintf('VMPAYMENT_SOFORT_ERROR_FROM', $error['message'], $error['field'], $error['code']));
if ($error['message'] == 401) {
vmdebug('check you payment parameters: custom_id, project_id, api key');
}
}
}
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:10,代码来源:sofort.php
示例2: onCheckoutCheckDataPayment
function onCheckoutCheckDataPayment(VirtueMartCart $cart)
{
static $displayInfoMsg = true;
if ($cart->BT) {
if (empty($cart->BT['phone_1']) and empty($cart->BT['phone_2']) and $displayInfoMsg) {
vmInfo(vmText::sprintf('VMPAYMENT_KLIKANDPAY_SUBSCRIBE_TEL_REQUIRED', JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscheckout&addrtype=BT')));
$return = false;
}
}
$displayInfoMsg = false;
return $return;
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:12,代码来源:recurring.php
示例3: checkManufacturer
function checkManufacturer($categoryId = 0)
{
if ($categoryId > 0) {
$db = JFactory::getDBO();
$q = 'SELECT count(*)' . ' FROM #__virtuemart_manufacturers' . ' WHERE virtuemart_manufacturercategories_id = ' . $categoryId;
$db->setQuery($q);
$mCount = $db->loadResult();
if ($mCount > 0) {
vmInfo('COM_VIRTUEMART_REMOVE_IN_USE');
return false;
}
}
return true;
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:14,代码来源:manufacturercategories.php
示例4: getNewStatus
function getNewStatus($method)
{
vmInfo(JText::_('Paga+Tarde: Pedido en estado "Pending"'));
if (isset($method->status_pending) and $method->status_pending != "") {
return $method->status_pending;
} else {
// $StatutWhiteList = array('P','C','X','R','S','N');
return 'P';
//PENDING
//return 'X'; //CANCELLED
//return 'R'; //REFUNDED
//return 'C'; //CONFIRMED
}
}
开发者ID:pagantis,项目名称:pagamastarde-virtuemart,代码行数:14,代码来源:pagamastarde.php
示例5: plgVmConfirmedOrder
/**
* @param $cart
* @param $order
* @return bool|null
*/
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
$session = JFactory::getSession();
$return_context = $session->getId();
$this->_debug = $method->debug;
$this->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
$address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
if (!class_exists('TableVendors')) {
require JPATH_VM_ADMINISTRATOR . DS . 'tables' . DS . 'vendors.php';
}
$vendorModel = VmModel::getModel('Vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$vendorModel->addImages($vendor, 1);
$this->getPaymentCurrency($method);
$email_currency = $this->getEmailCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
if ($totalInPaymentCurrency <= 0) {
vmInfo(JText::_('VMPAYMENT_PAYPAL_PAYMENT_AMOUNT_INCORRECT'));
return FALSE;
}
$merchant_email = $this->_getMerchantEmail($method);
if (empty($merchant_email)) {
vmInfo(JText::_('VMPAYMENT_PAYPAL_MERCHANT_EMAIL_NOT_SET'));
return FALSE;
}
$quantity = 0;
foreach ($cart->products as $key => $product) {
$quantity = $quantity + $product->quantity;
}
$post_variables = array('cmd' => '_ext-enter', 'redirect_cmd' => '_xclick', 'upload' => '1', 'business' => $merchant_email, 'receiver_email' => $merchant_email, 'order_number' => $order['details']['BT']->order_number, "invoice" => $order['details']['BT']->order_number, 'custom' => $return_context, 'item_name' => JText::_('VMPAYMENT_PAYPAL_ORDER_NUMBER') . ': ' . $order['details']['BT']->order_number, "amount" => $totalInPaymentCurrency, "currency_code" => $currency_code_3, "address_override" => isset($method->address_override) ? $method->address_override : 0, "first_name" => $address->first_name, "last_name" => $address->last_name, "address1" => $address->address_1, "address2" => isset($address->address_2) ? $address->address_2 : '', "zip" => $address->zip, "city" => $address->city, "state" => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID($address->virtuemart_state_id, 'state_2_code') : '', "country" => ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code'), "email" => $order['details']['BT']->email, "night_phone_b" => $address->phone_1, "return" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid'), false), "notify_url" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component', false), "cancel_return" => substr(JURI::root(false, ''), 0, -1) . JROUTE::_('index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt('Itemid'), false), "ipn_test" => $method->debug, "rm" => '2', "bn" => "VirtueMart_Cart_PPA", "image_url" => JURI::root() . $vendor->images[0]->file_url, "no_shipping" => isset($method->no_shipping) ? $method->no_shipping : 0, "no_note" => "1");
/*
$i = 1;
foreach ($cart->products as $key => $product) {
$post_variables["item_name_" . $i] = substr(strip_tags($product->product_name), 0, 127);
$post_variables["item_number_" . $i] = $i;
$post_variables["amount_" . $i] = $cart->pricesUnformatted[$key]['salesPrice'];
$post_variables["quantity_" . $i] = $product->quantity;
$i++;
}
if ($cart->pricesUnformatted ['shipmentValue']) {
$post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_SHIPMENT_PRICE');
$post_variables["item_number_" . $i] = $i;
$post_variables["amount_" . $i] = $cart->pricesUnformatted ['shipmentValue'];
$post_variables["quantity_" . $i] = 1;
$i++;
}
if ($cart->pricesUnformatted ['paymentValue']) {
$post_variables["item_name_" . $i] = JText::_('VMPAYMENT_PAYPAL_PAYMENT_PRICE');
$post_variables["item_number_" . $i] = $i;
$post_variables["amount_" . $i] = $cart->pricesUnformatted ['paymentValue'];
$post_variables["quantity_" . $i] = 1;
$i++;
}
if (!empty($order->cart->coupon)) {
$post_variables["discount_amount_cart"] = $cart->pricesUnformatted['discountAmount'];
}
*/
// Prepare data that should be stored in the database
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['payment_name'] = $this->renderPluginName($method, $order);
$dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
$dbValues['paypal_custom'] = $return_context;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $method->payment_currency;
$dbValues['email_currency'] = $email_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency;
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
$url = $this->_getPaypalUrlHttps($method);
// add spin image
$html = '<html><head><title>Redirection</title></head><body><div style="margin: auto; text-align: center;">';
$html .= '<form action="' . "https://" . $url . '" method="post" name="vm_paypal_form" accept-charset="UTF-8">';
$html .= '<input type="submit" value="' . JText::_('VMPAYMENT_PAYPAL_REDIRECT_MESSAGE') . '" />';
$html .= '<input type="hidden" name="charset" value="utf-8">';
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
}
//.........这里部分代码省略.........
开发者ID:SeventF,项目名称:ikea.com,代码行数:101,代码来源:paypal.php
示例6: checkPathCreateFolders
public function checkPathCreateFolders($path)
{
$elements = explode(DS, $path);
$examine = JPATH_ROOT;
foreach ($elements as $piece) {
$examine = $examine . DS . $piece;
if (!JFolder::exists($examine)) {
JFolder::create($examine);
vmInfo('create folder for resized image ' . $examine);
}
}
}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:12,代码来源:image.php
示例7: updatestatus
/**
* Update an order status
*
* @author Max Milbers
*/
public function updatestatus()
{
$app = Jfactory::getApplication();
$lastTask = vRequest::getCmd('last_task');
/* Load the view object */
$view = $this->getView('orders', 'html');
if (!$this->getPermOrderStatus()) {
vmInfo('Restricted');
$view->display();
return true;
}
/* Update the statuses */
$model = VmModel::getModel('orders');
if ($lastTask == 'updatestatus') {
// single order is in POST but we need an array
$order = array();
$virtuemart_order_id = vRequest::getInt('virtuemart_order_id');
$order[$virtuemart_order_id] = vRequest::getRequest();
$result = $model->updateOrderStatus($order);
} else {
$result = $model->updateOrderStatus();
}
$msg = '';
if ($result['updated'] > 0) {
$msg = vmText::sprintf('COM_VIRTUEMART_ORDER_UPDATED_SUCCESSFULLY', $result['updated']);
} else {
if ($result['error'] == 0) {
$msg .= vmText::_('COM_VIRTUEMART_ORDER_NOT_UPDATED');
}
}
if ($result['error'] > 0) {
$msg .= vmText::sprintf('COM_VIRTUEMART_ORDER_NOT_UPDATED_SUCCESSFULLY', $result['error'], $result['total']);
}
if ('updatestatus' == $lastTask) {
$app->redirect('index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $virtuemart_order_id, $msg);
} else {
$app->redirect('index.php?option=com_virtuemart&view=orders', $msg);
}
}
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:44,代码来源:orders.php
示例8: updateStoredCards
/**
* Delete a stored card
* To remove a card from the RealVault system
*/
function updateStoredCards($card_ids)
{
$user = JFactory::getUser();
$db = JFactory::getDBO();
foreach ($card_ids as $card_id) {
JLoader::import('joomla.plugin.helper');
JPluginHelper::importPlugin('vmpayment');
$app = JFactory::getApplication();
$storedCC = $this->getStoredCCInfo($card_id);
$updatedCCname = vRequest::getString('cc_name_' . $card_id);
$updatedYear = vRequest::getInt('cc_expire_year_' . $card_id);
$updatedMonth = vRequest::getInt('cc_expire_month_' . $card_id);
$expDate = $this->explodeExpDate($storedCC['realex_hpp_api_saved_pmt_expdate']);
if ($storedCC['realex_hpp_api_saved_pmt_name'] == $updatedCCname and $expDate['yy'] == $updatedYear and $expDate['mm'] == $updatedMonth) {
continue;
} else {
$storedCC['realex_hpp_api_saved_pmt_name'] = $updatedCCname;
$storedCC['realex_hpp_api_saved_pmt_expdate'] = $updatedMonth . $updatedYear;
}
$success = false;
// the trigger will send the card-cancel-card to Releax
$app->triggerEvent('plgVmOnRealexUpdateStoredCard', array('realex_hpp_api', $storedCC, &$success));
if ($success) {
$query = 'UPDATE `' . $this->_tablename . '` SET `realex_hpp_api_saved_pmt_name`="' . $storedCC['realex_hpp_api_saved_pmt_name'] . '" , `realex_hpp_api_saved_pmt_expdate`="' . $storedCC['realex_hpp_api_saved_pmt_expdate'] . '" WHERE `id`=' . $card_id . ' AND `virtuemart_user_id`=' . $storedCC['virtuemart_user_id'];
$db->setQuery($query);
$db->query();
vmInfo(vmText::sprintf('VMUSERFIELD_REALEX_HPP_API_CARD_UPDATED', $storedCC['realex_hpp_api_saved_pmt_name'], $storedCC['realex_hpp_api_saved_pmt_digits'], $updatedMonth, $updatedYear));
} else {
$vendorId = 1;
$vendor_link = JRoute::_('index.php?option=com_virtuemart&view=vendor&layout=contact&virtuemart_vendor_id=' . $vendorId);
vmInfo(vmText::sprintf('VMUSERFIELD_REALEX_HPP_API_CARD_NOT_UPDATED', $storedCC['realex_hpp_api_saved_pmt_name'], $storedCC['realex_hpp_api_saved_pmt_digits'], $updatedMonth, $updatedYear, $vendor_link));
}
}
}
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:38,代码来源:realex_hpp_api.php
示例9: loadCountListContinue
function loadCountListContinue($q, $startLimit, $maxItems, $msg)
{
$continue = true;
$this->_db->setQuery($q);
if (!$this->_db->execute()) {
vmError($msg . ' db error ' . $this->_db->getErrorMsg());
vmError($msg . ' db error ' . $this->_db->getQuery());
$entries = array();
$continue = false;
} else {
$entries = $this->_db->loadAssocList();
$count = count($entries);
vmInfo($msg . ' found ' . $count . ' vm1 entries for migration ');
$startLimit += $maxItems;
if ($count < $maxItems) {
$continue = false;
}
}
return array($entries, $startLimit, $continue);
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:20,代码来源:tableupdater.php
示例10: plgVmConfirmedOrder
/**
* @param $cart
* @param $order
* @return bool|null
*/
function plgVmConfirmedOrder ($cart, $order) {
if (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL; // Another method was selected, do nothing
}
if (!$this->selectedThisElement ($method->payment_element)) {
return FALSE;
}
$session = JFactory::getSession ();
$return_context = $session->getId ();
$this->_debug = $method->debug;
$this->logInfo ('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
if (!class_exists ('VirtueMartModelOrders')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php');
}
if (!class_exists ('VirtueMartModelCurrency')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php');
}
$address = ((isset($order['details']['ST'])) ? $order['details']['ST'] : $order['details']['BT']);
if (!class_exists ('TableVendors')) {
require(JPATH_VM_ADMINISTRATOR . DS . 'table' . DS . 'vendors.php');
}
$vendorModel = VmModel::getModel ('Vendor');
$vendorModel->setId (1);
$vendor = $vendorModel->getVendor ();
$vendorModel->addImages ($vendor, 1);
$this->getPaymentCurrency ($method);
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db = JFactory::getDBO ();
$db->setQuery ($q);
$currency_code_3 = $db->loadResult ();
$paymentCurrency = CurrencyDisplay::getInstance ($method->payment_currency);
$totalInPaymentCurrency = round ($paymentCurrency->convertCurrencyTo ($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
$cd = CurrencyDisplay::getInstance ($cart->pricesCurrency);
if ($totalInPaymentCurrency <= 0) {
vmInfo (JText::_ ('VMPAYMENT_PAYPAL_PAYMENT_AMOUNT_INCORRECT'));
return FALSE;
}
$merchant_email = $this->_getMerchantEmail ($method);
if (empty($merchant_email)) {
vmInfo (JText::_ ('VMPAYMENT_PAYPAL_MERCHANT_EMAIL_NOT_SET'));
return FALSE;
}
$post_variables = Array(
'cmd' => '_ext-enter',
'redirect_cmd' => '_xclick',
'upload' => '1', //Indicates the use of third-party shopping cart
'business' => $merchant_email, //Email address or account ID of the payment recipient (i.e., the merchant).
'receiver_email' => $merchant_email, //Primary email address of the payment recipient (i.e., the merchant
'order_number' => $order['details']['BT']->order_number,
"invoice" => $order['details']['BT']->order_number,
'custom' => $return_context,
'item_name' => JText::_ ('VMPAYMENT_PAYPAL_ORDER_NUMBER') . ': ' . $order['details']['BT']->order_number,
"amount" => $totalInPaymentCurrency,
"currency_code" => $currency_code_3,
/*
* 1 – L'adresse spécifiée dans les variables pré-remplies remplace l'adresse de livraison enregistrée auprès de PayPal.
* Le payeur voit l'adresse qui est transmise mais ne peut pas la modifier.
* Aucune adresse n'est affichée si l'adresse n'est pas valable
* (par exemple si des champs requis, tel que le pays, sont manquants) ou pas incluse.
* Valeurs autorisées : 0, 1. Valeur par défaut : 0
*/
"address_override" => isset($method->address_override) ? $method->address_override : 0, // 0 ?? Paypal does not allow your country of residence to ship to the country you wish to
"first_name" => $address->first_name,
"last_name" => $address->last_name,
"address1" => $address->address_1,
"address2" => isset($address->address_2) ? $address->address_2 : '',
"zip" => $address->zip,
"city" => $address->city,
"state" => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id) : '',
"country" => ShopFunctions::getCountryByID ($address->virtuemart_country_id, 'country_2_code'),
"email" => $order['details']['BT']->email,
"night_phone_b" => $address->phone_1,
"return" => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),
// Keep this line, needed when testing
//"return" => JROUTE::_(JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),
"notify_url" => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component'),
"cancel_return" => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),
//"undefined_quantity" => "0",
"ipn_test" => $method->debug,
"rm" => '2', // the buyer’s browser is redirected to the return URL by using the POST method, and all payment variables are included
//"pal" => "NRUBJXESJTY24",
"image_url" => JURI::root () . $vendor->images[0]->file_url,
"no_shipping" => isset($method->no_shipping) ? $method->no_shipping : 0,
"no_note" => "1");
/*
$i = 1;
foreach ($cart->products as $key => $product) {
//.........这里部分代码省略.........
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:101,代码来源:paypal.php
示例11: check
//.........这里部分代码省略.........
return false;
}
}
foreach ($this->_obkeys as $obkeys => $error) {
if (empty($this->{$obkeys})) {
if (empty($error)) {
$error = 'Serious error cant save ' . $this->_tbl . ' without ' . $obkeys;
} else {
// $error = get_class($this).' '.JText::_($error);
$error = get_class($this) . ' ' . $error;
}
$this->setError($error);
vmError($error);
return false;
}
}
if ($this->_unique) {
if (empty($this->_db)) {
$this->_db = JFactory::getDBO();
}
foreach ($this->_unique_name as $obkeys => $error) {
if (empty($this->{$obkeys})) {
// vmError(JText::sprintf('COM_VIRTUEMART_NON_UNIQUE_KEY',$this->$obkeys));
$this->setError($error);
vmError('Non unique ' . $this->_unique_name . ' ' . $error);
return false;
} else {
$valid = $this->checkCreateUnique($this->_tbl, $obkeys);
if (!$valid) {
return false;
}
}
}
}
if (isset($this->virtuemart_vendor_id)) {
$multix = Vmconfig::get('multix', 'none');
//Lets check if the user is admin or the mainvendor
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
$virtuemart_vendor_id = false;
if ($multix == 'none' and get_class($this) !== 'TableVmusers') {
$this->virtuemart_vendor_id = 1;
} else {
$loggedVendorId = Permissions::getInstance()->isSuperVendor();
$admin = Permissions::getInstance()->check('admin');
$tbl_key = $this->_tbl_key;
if (get_class($this) !== 'TableVmusers') {
$q = 'SELECT `virtuemart_vendor_id` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`=' . $this->{$tbl_key};
$this->_db->setQuery($q);
$virtuemart_vendor_id = $this->_db->loadResult();
} else {
$q = 'SELECT `virtuemart_vendor_id`,`user_is_vendor` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`=' . $this->{$tbl_key};
$this->_db->setQuery($q);
$vmuser = $this->_db->loadRow();
if ($vmuser and count($vmuser) === 2) {
$virtuemart_vendor_id = $vmuser[0];
$user_is_vendor = $vmuser[1];
if ($multix == 'none') {
if (empty($user_is_vendor)) {
$this->virtuemart_vendor_id = 0;
} else {
$this->virtuemart_vendor_id = 1;
}
return true;
} else {
if (!$admin) {
$this->virtuemart_vendor_id = $loggedVendorId;
return true;
}
}
}
}
if (!$admin and !empty($virtuemart_vendor_id) and !empty($loggedVendorId) and $loggedVendorId != $virtuemart_vendor_id) {
//vmWarn('COM_VIRTUEMART_NOT_SAME_VENDOR',$loggedVendorId,$virtuemart_vendor_id
//vmWarn('Stop try to hack this store, you got logged');
vmdebug('Hacking attempt stopped, logged vendor ' . $loggedVendorId . ' but data belongs to ' . $virtuemart_vendor_id);
return false;
} else {
if (!$admin) {
if ($virtuemart_vendor_id) {
$this->virtuemart_vendor_id = $virtuemart_vendor_id;
vmdebug('Non admin is storing using loaded vendor_id');
} else {
//No id is stored, even users are allowed to use for the storage and vendorId, no change
}
} else {
if (!empty($virtuemart_vendor_id) and $loggedVendorId != $virtuemart_vendor_id) {
vmInfo('Admin with vendor id ' . $loggedVendorId . ' is using for storing vendor id ' . $this->virtuemart_vendor_id);
vmdebug('Admin with vendor id ' . $loggedVendorId . ' is using for storing vendor id ' . $this->virtuemart_vendor_id);
$this->virtuemart_vendor_id = $virtuemart_vendor_id;
}
}
}
}
//tables to consider for multivendor
//if(get_class($this)!== 'TableOrders' and get_class($this)!== 'TableInvoices' and get_class($this)!== 'TableOrder_items'){
}
return true;
}
开发者ID:Gskflute,项目名称:joomla25,代码行数:101,代码来源:vmtable.php
示例12: getCartAddress
function getCartAddress($cart, &$type, $STsameAsBT = true)
{
if (VMKLARNA_SHIPTO_SAME_AS_BILLTO) {
$st = $cart->BT;
$type = 'BT';
if ($STsameAsBT and $cart->ST and !$cart->STsameAsBT) {
vmInfo(JText::_('VMPAYMENT_KLARNA_SHIPTO_SAME_AS_BILLTO'));
$cart->STsameAsBT = 1;
$cart->setCartIntoSession();
}
} elseif ($cart->BT == 0 or empty($cart->BT)) {
$st = $cart->BT;
$type = 'BT';
} else {
$st = $cart->ST;
$type = 'ST';
}
return $st;
}
开发者ID:joselapria,项目名称:virtuemart,代码行数:19,代码来源:klarna.php
示例13: checkShipmentMethodsConfigured
private function checkShipmentMethodsConfigured()
{
//For the selection of the shipment method we need the total amount to pay.
$shipmentModel = VmModel::getModel('Shipmentmethod');
$shipments = $shipmentModel->getShipments();
if (empty($shipments)) {
$text = '';
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (Permissions::getInstance()->check("admin,storeadmin")) {
$uri = JFactory::getURI();
$link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=shipmentmethod';
$text = JText::sprintf('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED_LINK', '<a href="' . $link . '">' . $link . '</a>');
}
vmInfo('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED', $text);
$tmp = 0;
$this->assignRef('found_shipment_method', $tmp);
return false;
}
return true;
}
开发者ID:Gskflute,项目名称:joomla25,代码行数:22,代码来源:view.html.php
示例14: readConfigFile
/**
*
* @author Oscar van Eijk
* @author Max Milbers
*/
function readConfigFile($returnDangerousTools)
{
$_datafile = JPATH_VM_ADMINISTRATOR . DS . 'virtuemart.cfg';
if (!file_exists($_datafile)) {
if (file_exists(JPATH_VM_ADMINISTRATOR . DS . 'virtuemart_defaults.cfg-dist')) {
if (!class_exists('JFile')) {
require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'file.php';
}
JFile::copy('virtuemart_defaults.cfg-dist', 'virtuemart.cfg', JPATH_VM_ADMINISTRATOR);
} else {
JError::raiseWarning(500, 'The data file with the default configuration could not be found. You must configure the shop manually.');
return FALSE;
}
} else {
vmInfo('Taking config from file');
}
$_section = '[CONFIG]';
$_data = fopen($_datafile, 'r');
$_configData = array();
$_switch = FALSE;
while ($_line = fgets($_data)) {
$_line = trim($_line);
if (strpos($_line, '#') === 0) {
continue;
// Commentline
}
if ($_line == '') {
continue;
// Empty line
}
if (strpos($_line, '[') === 0) {
// New section, check if it's what we want
if (strtoupper($_line) == $_section) {
$_switch = TRUE;
// Ok, right section
} else {
$_switch = FALSE;
}
continue;
}
if (!$_switch) {
continue;
// Outside a section or inside the wrong one.
}
if (strpos($_line, '=') !== FALSE) {
$pair = explode('=', $_line);
if (isset($pair[1])) {
if (strpos($pair[1], 'array:') !== FALSE) {
$pair[1] = substr($pair[1], 6);
$pair[1] = explode('|', $pair[1]);
}
// if($pair[0]!=='offline_message' && $pair[0]!=='dateformat'){
if ($pair[0] !== 'offline_message') {
$_line = $pair[0] . '=' . serialize($pair[1]);
} else {
$_line = $pair[0] . '=' . base64_encode(serialize($pair[1]));
}
if ($returnDangerousTools && $pair[0] == 'dangeroustools') {
vmdebug('dangeroustools' . $pair[1]);
if ($pair[1] == "0") {
return FALSE;
} else {
return TRUE;
}
}
} else {
$_line = $pair[0] . '=';
}
$_configData[] = $_line;
}
}
fclose($_data);
if (!$_configData) {
return FALSE;
// Nothing to do
} else {
return $_configData;
}
}
开发者ID:romuland,项目名称:khparts,代码行数:84,代码来源:config.php
示例15: display
//.........这里部分代码省略.........
$imgAmount = VmConfig::get('prodimg_browse', 1);
$productModel->addImages($this->products, $imgAmount);
if ($this->products) {
$currency = CurrencyDisplay::getInstance();
$this->assignRef('currency', $currency);
$display_stock = VmConfig::get('display_stock', 1);
$showCustoms = VmConfig::get('show_pcustoms', 1);
if ($display_stock or $showCustoms) {
if (!$showCustoms) {
foreach ($this->products as $i => $productItem) {
$productItem->stock = $productModel->getStockIndicator($productItem);
}
} else {
shopFunctionsF::sortLoadProductCustomsStockInd($this->products, $productModel);
}
}
// add javascript for price and cart, need even for quantity buttons, so we need it almost anywhere
vmJsApi::jPrice();
}
// Add feed links
if ($this->showproducts and $this->products && VmConfig::get('feed_cat_published', 0) == 1) {
$link = '&format=feed&limitstart=';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$document->addHeadLink(JRoute::_($link . '&type=rss', FALSE), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link . '&type=atom', FALSE), 'alternate', 'rel', $attribs);
}
$user = JFactory::getUser();
$this->showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());
}
//No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
if (!empty($this->categoryId) and $this->categoryId !== -1 and (empty($category->slug) or !$category->published)) {
if (empty($category->slug)) {
vmInfo(vmText::_('COM_VIRTUEMART_CAT_NOT_FOUND'));
} else {
if ($category->virtuemart_id !== 0 and !$category->published) {
vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL', $category->category_name, $this->categoryId);
}
}
//Fallback
$categoryLink = '';
if ($category->category_parent_id) {
$categoryLink = '&view=category&virtuemart_category_id=' . $category->category_parent_id;
} else {
$last_category_id = shopFunctionsF::getLastVisitedCategoryId();
if (!$last_category_id or $this->categoryId == $last_category_id) {
$last_category_id = vRequest::getInt('virtuemart_category_id', false);
}
if ($last_category_id and $this->categoryId != $last_category_id) {
$categoryLink = '&view=category&virtuemart_category_id=' . $last_category_id;
}
}
if (VmConfig::get('handle_404', 1)) {
$app->redirect(JRoute::_('index.php?option=com_virtuemart' . $categoryLink . '&error=404', FALSE));
} else {
JError::raise(E_ERROR, '404', 'Not found');
}
return;
}
shopFunctionsF::setLastVisitedCategoryId($this->categoryId);
shopFunctionsF::setLastVisitedManuId($virtuemart_manufacturer_id);
// Add the category name to the pathway
if ($category->parents) {
foreach ($category->parents as $c) {
$pathway->addItem(strip_tags(vmText::_($c->category_name)), JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $c->virtuemart_category_id, FALSE));
}
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:67,代码来源:view.html.php
示例16: plgVmOnPaymentResponseReceived
function plgVmOnPaymentResponseReceived(&$html)
{
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
if (!class_exists('VirtueMartModelOrders')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
}
$virtuemart_paymentmethod_id = JRequest::getInt('pm', 0);
$order_number = JRequest::getString('on', 0);
if (!($method = $this->getVmPluginMethod($virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return NULL;
}
if (!($virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber($order_number))) {
return NULL;
}
$db = JFactory::getDBO();
$_q = 'SELECT * FROM `' . $this->_tablename . '` ' . 'WHERE `virtuemart_order_id` = ' . $virtuemart_order_id;
$db->setQuery($_q);
if (!($paymentData = $db->loadObject())) {
// JError::raiseWarning(500, $db->getErrorMsg());
}
vmdebug('HEIDELPAY paymentdata', $paymentData);
if ($paymentData->processing_result == "NOK") {
vmError('VMPAYMENT_HEIDELPAY_PAYMENT_FAILED', 'VMPAYMENT_HEIDELPAY_PAYMENT_FAILED');
vmError(" - " . $paymentData->comment, " - " . $paymentData->comment);
} else {
vmInfo('VMPAYMENT_HEIDELPAY_PAYMENT_SUCESS');
$html = "<h3>" . vmText::sprintf('VMPAYMENT_HEIDELPAY_ORDER_NR') . ': ' . $order_number . " </h3>";
$tmpkom = preg_replace("/\\(-/", '<a href="', $paymentData->comment);
$tmpkom = preg_replace('/-\\)/', '" target="_blank">Barcode runterladen</a>', $tmpkom);
$html .= $tmpkom;
//delete basket only on success
$cart = VirtueMartCart::getCart();
$cart->emptyCart();
}
// if payment is in test mode
if ($paymentData->transaction_mode != "LIVE") {
vmInfo('VMPAYMENT_HEIDELPAY_PAYMENT_TESTMODE');
}
$orgSecret = $this->createSecretHash($order_number, $method->HEIDELPAY_SECRET);
$order['comments'] = "";
if ($virtuemart_order_id && $paymentData->created_on == '0000-00-00 00:00:00') {
$order['customer_notified'] = 0;
$order['order_status'] = $this->getStatus($method, $paymentData->processing_result);
$modelOrder = VmModel::getModel('orders');
$orderitems = $modelOrder->getOrder($virtuemart_order_id);
$nb_history = count($orderitems['history']);
if ($orderitems['history'][$nb_history - 1]->order_status_code != $order['order_status']) {
if ($method->HEIDELPAY_CONFIRM_EMAIL == 1 or $method->HEIDELPAY_CONFIRM_EMAIL == 2 and $paymentData->processing_result == "ACK") {
$order['customer_notified'] = 1;
$order['comments'] = vmText::sprintf('VMPAYMENT_HEIDELPAY_EMAIL_SENT') . "<br />";
}
$order['comments'] .= $paymentData->comment;
/*
* Verify Payment response
*/
if ($orgSecret != $paymentData->secret_hash) {
$order['customer_notified'] = 0;
$order['comments'] = "Hash verification error, suspecting manipulation. IP: " . $paymentData->response_ip;
$order['order_status'] = '';
}
$modelOrder->updateStatusForOneOrder($virtuemart_order_id, $order, TRUE);
}
$dbu = JFactory::getDBO();
$_u = "UPDATE `" . $this->_tablename . "` " . "SET `created_on` = NOW() WHERE `virtuemart_order_id` = " . (int) $virtuemart_order_id;
$dbu->setQuery($_u);
$result = $dbu->execute();
}
return TRUE;
}
开发者ID:cybershocik,项目名称:Darek,代码行数:78,代码来源:heidelpay.php
示例17: checkoutData
private function checkoutData($redirect = true)
{
$this->_redirect = $redirect;
$this->_inCheckOut = true;
$this->tosAccepted = JRequest::getInt('tosAccepted', $this->tosAccepted);
$this->STsameAsBT = JRequest::getInt('STsameAsBT', $this->STsameAsBT);
$this->customer_comment = JRequest::getVar('customer_comment', $this->customer_comment);
$this->order_language = JRequest::getVar('order_language', $this->order_language);
// no HTML TAGS but permit all alphabet
$value = preg_replace('@<[\\/\\!]*?[^<>]*?>@si', '', $this->customer_comment);
//remove all html tags
$value = (string) preg_replace('#on[a-z](.+?)\\)#si', '', $value);
//replace start of script onclick() onload()...
$value = trim(str_replace('"', ' ', $value), "'");
$this->customer_comment = (string) preg_replace('#^\'#si', '', $value);
//replace ' at start
$this->cartData = $this->prepareCartData();
$this->prepareCartPrice();
if (empty($this->tosAccepted)) {
$userFieldsModel = VmModel::getModel('Userfields');
//$required = $userFieldsModel->getIfRequired('agreed');
$agreed = $userFieldsModel->getUserfield('agreed', 'name');
//vmdebug('my new getUserfieldbyName',$agreed->default,$agreed->required);
if (!empty($agreed->required) and empty($agreed->default) and !empty($this->BT)) {
$redirectMsg = null;
// JText::_('COM_VIRTUEMART_CART_PLEASE_ACCEPT_TOS');
vmInfo('COM_VIR
|
请发表评论