本文整理汇总了PHP中fn_get_order_info函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_order_info函数的具体用法?PHP fn_get_order_info怎么用?PHP fn_get_order_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_order_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fn_mve_place_order
function fn_mve_place_order(&$order_id, &$action, &$__order_status, &$cart)
{
$order_info = fn_get_order_info($order_id);
if ($order_info['is_parent_order'] != 'Y' && !empty($order_info['company_id'])) {
// Check if the order already placed
$payout_id = db_get_field('SELECT payout_id FROM ?:vendor_payouts WHERE order_id = ?i', $order_id);
$company_data = fn_get_company_data($order_info['company_id']);
$company_data['commission'] = $order_info['total'] > 0 ? $company_data['commission'] : 0;
$company_data['commission_type'] = isset($company_data['commission_type']) ? $company_data['commission_type'] : '';
$commission_amount = 0;
if ($company_data['commission_type'] == 'P') {
//Calculate commission amount and check if we need to include shipping cost
$commission_amount = ($order_info['total'] - (Registry::get('settings.Vendors.include_shipping') == 'N' ? $order_info['shipping_cost'] : 0)) * $company_data['commission'] / 100;
} else {
$commission_amount = $company_data['commission'];
}
//Check if we need to take payment surcharge from vendor
if (Registry::get('settings.Vendors.include_payment_surcharge') == 'Y') {
$commission_amount += $order_info['payment_surcharge'];
}
$_data = array('company_id' => $order_info['company_id'], 'order_id' => $order_id, 'payout_date' => TIME, 'start_date' => TIME, 'end_date' => TIME, 'commission' => $company_data['commission'], 'commission_type' => $company_data['commission_type'], 'order_amount' => $order_info['total'], 'commission_amount' => $commission_amount);
fn_set_hook('mve_place_order', $order_info, $company_data, $action, $__order_status, $cart, $_data);
if ($commission_amount > $order_info['total']) {
$commission_amount = $order_info['total'];
}
if (empty($payout_id)) {
db_query('INSERT INTO ?:vendor_payouts ?e', $_data);
} else {
db_query('UPDATE ?:vendor_payouts SET ?u WHERE payout_id = ?i', $_data, $payout_id);
}
}
}
示例2: updateBill
function updateBill($param)
{
if (!is_object($param)) {
return false;
}
$order_info = fn_get_order_info($param->txn, false, true, true, true);
$temp = '';
if (!empty($order_info['payment_method']['processor_params']['passwd']) && !empty($order_info['payment_method']['processor_params']['login'])) {
$txn = fn_convert_encoding('utf-8', 'windows-1251', $param->txn);
$password = fn_convert_encoding('utf-8', 'windows-1251', $order_info['payment_method']['processor_params']['passwd']);
$crc = strtoupper(md5($txn . strtoupper(md5($password))));
if ($param->login == $order_info['payment_method']['processor_params']['login'] && $param->password == $crc) {
$pp_response = array();
$status = 'qiwi_order_status_' . $param->status;
if ($param->status == 60) {
$pp_response['order_status'] = 'P';
} elseif ($param->status >= 50 && $param->status < 60) {
$pp_response['order_status'] = 'O';
} else {
$pp_response['order_status'] = 'F';
}
$pp_response['reason_text'] = __($status);
fn_finish_payment($param->txn, $pp_response);
$temp = new Response();
$temp->updateBillResult = 0;
}
}
return $temp;
}
示例3: modePayment
function modePayment()
{
$rid = $_REQUEST['order_id'];
$orderId = $_SESSION['pw_order_id'];
$iframe = '';
$matchOrder = $rid == $orderId;
$orderInfo = fn_get_order_info($orderId);
if ($matchOrder && $orderInfo) {
// Prepare Widget
$iframe = fn_paymentwall_generateWidget($orderInfo, fn_paymentwall_getPaymentConfigs($orderInfo['payment_id']));
}
fn_add_breadcrumb('Paymentwall Payment', '#', true);
Tygh::$app['view']->assign('params', array('matchOrder' => $matchOrder, 'orderId' => $orderId, 'baseUrl' => fn_url(), 'iframe' => $iframe));
}
示例4: index
public function index($id = 0, $params = array())
{
if (!empty($id)) {
$data = fn_get_order_info($id, false, false);
if (empty($data)) {
$status = Response::STATUS_NOT_FOUND;
} else {
$status = Response::STATUS_OK;
}
} else {
$items_per_page = $this->safeGet($params, 'items_per_page', Registry::get('settings.Appearance.admin_orders_per_page'));
list($data, $params) = fn_get_orders($params, $items_per_page);
$data = array('orders' => $data, 'params' => $params);
$status = Response::STATUS_OK;
}
return array('status' => $status, 'data' => $data);
}
示例5: update
public function update($id, $params)
{
$data = array();
$valid_params = true;
$status = Response::STATUS_BAD_REQUEST;
unset($params['shipment_id']);
list($shipments, ) = fn_get_shipments_info(array('shipment_id' => $id));
$shipment_data = reset($shipments);
$order_info = fn_get_order_info($shipment_data['order_id'], false, true, true);
if (Settings::instance()->getValue('use_shipments', '', $order_info['company_id']) == 'Y') {
$data['message'] = __('api_shipments_not_allow_update');
$valid_params = false;
}
if ($valid_params) {
$shipment_id = fn_update_shipment($params, $id);
if ($shipment_id) {
$status = Response::STATUS_OK;
$data = array('shipment_id' => $shipment_id);
}
}
return array('status' => $status, 'data' => $data);
}
示例6: fn_sms_notifications_place_order
function fn_sms_notifications_place_order($order_id, $action, $fake1, $cart)
{
if ($action !== 'save' && Registry::get('addons.sms_notifications.sms_new_order_placed') == 'Y') {
Registry::get('view')->assign('order_id', $order_id);
Registry::get('view')->assign('total', $cart['total']);
$send_info = Registry::get('addons.sms_notifications.sms_send_payment_info');
$send_email = Registry::get('addons.sms_notifications.sms_send_customer_email');
$send_min_amount = Registry::get('addons.sms_notifications.sms_send_min_amout');
$shippings = Registry::get('addons.sms_notifications.sms_send_shipping');
if (!is_array($shippings)) {
$shippings = array();
}
Registry::get('view')->assign('send_info', $send_info == 'Y' ? true : false);
Registry::get('view')->assign('send_email', $send_email == 'Y' ? true : false);
Registry::get('view')->assign('send_min_amount', $send_min_amount == 'Y' ? true : false);
$order = fn_get_order_info($order_id);
Registry::get('view')->assign('order_email', $order['email']);
Registry::get('view')->assign('order_payment_info', $order['payment_method']['payment']);
if (count($shippings)) {
$in_shipping = false;
if (!empty($order['shipping'])) {
foreach ($order['shipping'] as $id => $data) {
if ($shippings[$id] == 'Y') {
$in_shipping = true;
break;
}
}
}
} else {
$in_shipping = true;
}
if ($in_shipping && $order['subtotal'] > doubleval($send_min_amount)) {
$body = Registry::get('view')->display('addons/sms_notifications/views/sms/components/order_sms.tpl', false);
fn_send_sms_notification($body);
}
}
}
示例7: die
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Http;
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'frame' && !empty(Tygh::$app['session']['cmpi']['acs_url'])) {
fn_create_payment_form(Tygh::$app['session']['cmpi']['acs_url'], Tygh::$app['session']['cmpi']['frame_data'], 'Card Issuer', false, 'post', false);
exit;
} elseif ($mode == 'bank' && !empty(Tygh::$app['session']['cmpi']['order_id'])) {
$order_info = fn_get_order_info(Tygh::$app['session']['cmpi']['order_id']);
$processor_data = fn_get_processor_data($order_info['payment_method']['payment_id']);
$payment_name = str_replace('.php', '', $processor_data['processor_script']);
Tygh::$app['session']['cmpi']['pares'] = !empty($_REQUEST['PaRes']) ? $_REQUEST['PaRes'] : '';
$sess = Tygh::$app['session']->getName() . '=' . Tygh::$app['session']->getID();
$src = fn_url("payment_notification.auth?payment={$payment_name}&{$sess}", AREA, 'current');
$msg = __('text_cc_processor_connection', array('[processor]' => '3-D Secure server'));
fn_create_payment_form($src, array(), '3-D Secure', false, 'get', false, 'parent');
exit;
} elseif ($mode == 'auth' && !empty(Tygh::$app['session']['cmpi']['order_id'])) {
$view = Tygh::$app['view'];
$view->assign('order_action', __('placing_order'));
$view->display('views/orders/components/placing_order.tpl');
fn_flush();
fn_cmpi_authenticate();
if (Tygh::$app['session']['cmpi']['signature'] == 'Y' && in_array(Tygh::$app['session']['cmpi']['pares'], array('Y', 'A', 'U'))) {
示例8: fn_promotions_calculate_order_discount
/**
* Calculate order discount for sub orders (used in MVE)
*
* @param string $type discount type
* @param array $bonus Array with promotion data
* @param int $bonus_id Bonus ID
* @param array $cart Array with cart data
* @return float calculated discount value
*/
function fn_promotions_calculate_order_discount($bonus, $bonus_id, $cart)
{
$type = $bonus['discount_bonus'];
$price = $cart['subtotal'];
$value = $bonus['discount_value'];
static $parent_orders = array();
// this calculations are actual only for the fixed (absolute) amount
if ($type == 'to_fixed' || $type == 'by_fixed') {
// if it is parent or usual order
if (empty($cart['parent_order_id'])) {
// calculate usual discount
$discount = fn_promotions_calculate_discount($type, $price, $value);
// save order discount for future calculations of suborders
$discount = fn_format_price($discount);
$session_orders_discount =& $_SESSION['orders_discount'][$bonus['promotion_id'] . '_' . $bonus_id];
$session_orders_discount['parent_order_discount'] = $discount;
$session_orders_discount['suborders_discount'] = 0;
} else {
// this is sub order
$parent_order_id = $cart['parent_order_id'];
// get parent order subtotal info
if (!isset($parent_orders[$parent_order_id]['subtotal'])) {
$parent_order_info = fn_get_order_info($parent_order_id);
$parent_orders[$parent_order_id]['subtotal'] = $parent_order_info['subtotal'];
}
if (!empty($parent_orders[$parent_order_id]['subtotal'])) {
// calculate the share of the full discount
$value = $value * $price / $parent_orders[$parent_order_id]['subtotal'];
}
$discount = fn_promotions_calculate_discount($type, $price, $value);
$discount = fn_format_price($discount);
$session_orders_discount =& $_SESSION['orders_discount'][$bonus['promotion_id'] . '_' . $bonus_id];
$parent_order_discount = !empty($session_orders_discount['parent_order_discount']) ? $session_orders_discount['parent_order_discount'] : 0;
$suborders_discount = !empty($session_orders_discount['suborders_discount']) ? $session_orders_discount['suborders_discount'] : 0;
// check that total suborders discount is less than parent_order_discount
// or this is last sub order, so we have to distract discount, to avoid the extra cents
$new_suborders_discount = $suborders_discount + $discount;
if ($new_suborders_discount > $parent_order_discount || !empty($cart['companies']) && end($cart['companies']) == $cart['company_id']) {
$discount = $parent_order_discount - (!empty($session_orders_discount['suborders_discount']) ? $session_orders_discount['suborders_discount'] : 0);
if ($discount < 0) {
$discount = 0;
}
}
$session_orders_discount['suborders_discount'] = $suborders_discount + $discount;
}
} else {
$discount = fn_promotions_calculate_discount($type, $price, $value);
}
return $discount;
}
示例9: action
190 - Payment success
490 - Payment failure
491 - Validation error
492 - Technical error
690 - Payment rejected
790 - Waiting for user input
791 - Waiting for processor
792 - Waiting on consumer action (e.g.: initiate money transfer)
793 - Payment on hold (e.g. waiting for sufficient balance)
890 - Cancelled by consumer
891 - Cancelled by merchant
*/
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'notify') {
$pp_response = array();
$order_info = fn_get_order_info($_REQUEST['brq_invoicenumber']);
$processor_data = fn_get_payment_method_data($order_info['payment_id']);
$pp_response["transaction_id"] = $_REQUEST['brq_transactions'];
$pp_response["reason_text"] = urldecode($_REQUEST['brq_statusmessage']);
$_REQUEST['brq_websitekey'] = $processor_data['processor_params']['merchant_id'];
$_signature = fn_buckaroo_calculate_signature($_REQUEST, $processor_data["processor_params"]["merchant_key"]);
if (in_array($_REQUEST['brq_statuscode'], array('190')) && $_REQUEST['brq_signature'] == $_signature) {
$pp_response['order_status'] = 'P';
} elseif (in_array($_REQUEST['brq_statuscode'], array('791', '492'))) {
$pp_response['order_status'] = 'O';
// still waiting for the response
} else {
$pp_response['order_status'] = 'F';
}
fn_finish_payment($_REQUEST['brq_invoicenumber'], $pp_response, false);
$route = $order_info['repaid'] ? 'repay' : 'route';
示例10: die
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Http;
use Tygh\Registry;
use Tygh\Session;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'frame' && !empty($_SESSION['cmpi']['acs_url'])) {
fn_create_payment_form($_SESSION['cmpi']['acs_url'], $_SESSION['cmpi']['frame_data'], 'Card Issuer', false, 'post', false);
exit;
} elseif ($mode == 'bank' && !empty($_SESSION['cmpi']['order_id'])) {
$order_info = fn_get_order_info($_SESSION['cmpi']['order_id']);
$processor_data = fn_get_processor_data($order_info['payment_method']['payment_id']);
$payment_name = str_replace('.php', '', $processor_data['processor_script']);
$_SESSION['cmpi']['pares'] = !empty($_REQUEST['PaRes']) ? $_REQUEST['PaRes'] : '';
$sess = Session::getName() . '=' . Session::getId();
$src = fn_url("payment_notification.auth?payment={$payment_name}&{$sess}", AREA, 'current');
$msg = __('text_cc_processor_connection', array('[processor]' => '3-D Secure server'));
fn_create_payment_form($src, array(), '3-D Secure', false, 'get', false, 'parent');
exit;
} elseif ($mode == 'auth' && !empty($_SESSION['cmpi']['order_id'])) {
$view = Tygh::$app['view'];
$view->assign('order_action', __('placing_order'));
$view->display('views/orders/components/placing_order.tpl');
fn_flush();
fn_cmpi_authenticate();
if ($_SESSION['cmpi']['signature'] == 'Y' && in_array($_SESSION['cmpi']['pares'], array('Y', 'A', 'U'))) {
示例11: fn_print_order_packing_slips
function fn_print_order_packing_slips($order_ids, $pdf = false, $lang_code = CART_LANGUAGE)
{
$view = Registry::get('view');
$html = array();
if (!is_array($order_ids)) {
$order_ids = array($order_ids);
}
foreach ($order_ids as $order_id) {
$order_info = fn_get_order_info($order_id, false, true, false, true);
if (empty($order_info)) {
continue;
}
$view->assign('order_info', $order_info);
if ($pdf == true) {
fn_disable_live_editor_mode();
$html[] = $view->displayMail('orders/print_packing_slip.tpl', false, 'A', $order_info['company_id'], $lang_code);
} else {
$view->displayMail('orders/print_packing_slip.tpl', true, 'A', $order_info['company_id'], $lang_code);
}
if ($order_id != end($order_ids)) {
echo "<div style='page-break-before: always;'> </div>";
}
}
if ($pdf == true) {
Pdf::render($html, __('packing_slip') . '-' . implode('-', $order_ids));
}
return true;
}
示例12: header
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($mode == 'export_profiles') {
header('Content-type: text/csv');
header('Content-disposition: attachment; filename=shop-customers' . date('Ymd') . '.txt');
foreach ($_REQUEST['user_ids'] as $k => $v) {
$users[$k] = fn_get_user_info($v);
}
$view->assign('users', $users);
$view->display('addons/myob/views/users/components/export_to_myob.tpl');
exit;
}
if ($mode == 'export_orders') {
header('Content-type: text/csv');
header('Content-disposition: attachment; filename=shop-orders' . date('Ymd') . '.txt');
foreach ($_REQUEST['order_ids'] as $k => $v) {
$orders[$k] = fn_get_order_info($v);
$orders[$k]['order_date'] = date('j/n/Y', $orders[$k]['timestamp']);
$orders[$k]['paid_amount'] = 0;
//TODO: Update this!
foreach ($orders[$k]['items'] as $ik => $iv) {
$option_desc = "";
$desc_count = 0;
if (!empty($orders[$k]['items'][$ik]['product_options'])) {
foreach ($orders[$k]['items'][$ik]['product_options'] as $option_key => $option_value) {
if ($desc_count > 0) {
$option_desc .= ", ";
} else {
$option_desc = ' (';
}
$option_desc .= $option_value['option_name'] . ' = ' . $option_value['variant_name'];
$desc_count++;
示例13: die
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
use Tygh\Registry;
use Tygh\Http;
use Tygh\Shippings\RusSdek;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$params = $_REQUEST;
$order_info = fn_get_order_info($params['order_id'], false, true, true, true);
if ($mode == 'sdek_order_delivery') {
if (empty($params['add_sdek_info'])) {
return false;
}
foreach ($params['add_sdek_info'] as $shipment_id => $sdek_info) {
list($_shipments, $search) = fn_get_shipments_info(array('order_id' => $params['order_id'], 'advanced_info' => true, 'shipment_id' => $shipment_id));
$shipment = reset($_shipments);
$params_shipping = array('shipping_id' => $shipment['shipping_id'], 'Date' => date("Y-m-d", $shipment['shipment_timestamp']));
$data_auth = RusSdek::dataAuth($params_shipping);
if (empty($data_auth)) {
continue;
}
$order_for_sdek = $sdek_info['Order'];
$lastname = "";
if (!empty($order_info['lastname'])) {
示例14: fn_exim_1c_export_orders
function fn_exim_1c_export_orders($company_id, $lang_code)
{
$cml = fn_get_cml_tag_names();
$params = array('company_name' => true, 'place' => 'exim_1c', 'company_id' => $company_id);
$statuses = Registry::get('addons.rus_exim_1c.exim_1c_order_statuses');
if (!empty($statuses)) {
foreach ($statuses as $key => $status) {
if (!empty($status)) {
$params['status'][] = $key;
}
}
}
list($orders, $search) = fn_get_orders($params);
header("Content-type: text/xml; charset=utf-8");
fn_echo("");
$xml = new XMLWriter();
$xml->openMemory();
$xml->startDocument();
$xml->startElement($cml['commerce_information']);
foreach ($orders as $k => $data) {
$order_data = fn_get_order_info($data['order_id']);
$xml = fn_exim_1c_echo_order_xml($xml, $order_data, $lang_code);
}
$xml->endElement();
fn_echo($xml->outputMemory());
}
示例15: fn_get_packing_info
function fn_get_packing_info($shipment_id)
{
$params['advanced_info'] = true;
$params['shipment_id'] = $shipment_id;
list($shipment, $search, $total) = fn_get_shipments_info($params);
if (!empty($shipment)) {
$shipment = array_pop($shipment);
$order_info = fn_get_order_info($shipment['order_id'], false, true, true);
$shippings = db_get_array("SELECT a.shipping_id, a.min_weight, a.max_weight, a.position, a.status, b.shipping, b.delivery_time, a.usergroup_ids FROM ?:shippings as a LEFT JOIN ?:shipping_descriptions as b ON a.shipping_id = b.shipping_id AND b.lang_code = ?s ORDER BY a.position", DESCR_SL);
$_products = db_get_array("SELECT item_id, SUM(amount) AS amount FROM ?:shipment_items WHERE order_id = ?i GROUP BY item_id", $shipment['order_id']);
$shipped_products = array();
if (!empty($_products)) {
foreach ($_products as $_product) {
$shipped_products[$_product['item_id']] = $_product['amount'];
}
}
foreach ($order_info['items'] as $k => $oi) {
if (isset($shipped_products[$k])) {
$order_info['items'][$k]['shipment_amount'] = $oi['amount'] - $shipped_products[$k];
} else {
$order_info['items'][$k]['shipment_amount'] = $order_info['items'][$k]['amount'];
}
if (isset($shipment['items'][$k])) {
$order_info['items'][$k]['amount'] = $shipment['items'][$k];
} else {
$order_info['items'][$k]['amount'] = 0;
}
}
} else {
$shipment = $order_info = array();
}
return array($shipment, $order_info);
}