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


PHP order::updateStatus方法代码示例

本文整理汇总了PHP中order::updateStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP order::updateStatus方法的具体用法?PHP order::updateStatus怎么用?PHP order::updateStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在order的用法示例。


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

示例1: adminSendCoupon

 function adminSendCoupon($pParamHash)
 {
     global $gBitUser, $gBitCustomer, $gCommerceSystem, $gBitSystem, $currencies;
     require_once BITCOMMERCE_PKG_PATH . 'admin/' . DIR_WS_LANGUAGES . $gBitCustomer->getLanguage() . '/gv_mail.php';
     require_once BITCOMMERCE_PKG_PATH . 'admin/' . DIR_WS_LANGUAGES . $gBitCustomer->getLanguage() . '/email_extras.php';
     $ret = FALSE;
     if (!empty($pParamHash['email_to']) && !empty($pParamHash['amount'])) {
         $this->StartTrans();
         if (empty($pParamHash['from'])) {
             $pParamHash['from'] = EMAIL_FROM;
         }
         $adminNote = !empty($pParamHash['admin_note']) ? $pParamHash['admin_note'] : NULL;
         $from = zen_db_prepare_input($pParamHash['from']);
         if (empty($pParamHash['subject'])) {
             $pParamHash['subject'] = $gBitSystem->getConfig('site_title') . ' ' . tra("Gift Certificate");
         }
         $subject = zen_db_prepare_input($pParamHash['subject']);
         $mailSentTo = $pParamHash['email_to'];
         $id1 = $this->generateCouponCode($pParamHash['email_to']);
         if (empty($pParamHash['message'])) {
             $pParamHash['message'] = trim(stripslashes(strip_tags(TEXT_GV_ANNOUNCE)));
         }
         $message = zen_db_prepare_input($pParamHash['message']);
         $html_msg['GV_MESSAGE'] = $message;
         $message .= "\n\n" . TEXT_GV_WORTH . $currencies->format($pParamHash['amount']) . "\n\n";
         $message .= TEXT_TO_REDEEM;
         $message .= TEXT_WHICH_IS . ' ' . $id1 . ' ' . TEXT_IN_CASE . "\n\n";
         $html_msg['GV_AMOUNT'] = $currencies->format($pParamHash['amount']);
         $html_msg['GV_CODE'] = $id1;
         $html_msg['GV_WORTH'] = TEXT_GV_WORTH . $currencies->format($pParamHash['amount']) . '<br />';
         $html_msg['GV_REDEEM'] = TEXT_TO_REDEEM . TEXT_WHICH_IS . ' <strong>' . $id1 . '</strong> ' . TEXT_IN_CASE . '<p>' . TEXT_OR_VISIT . '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . STORE_NAME . '</a>' . TEXT_ENTER_CODE . '</p>';
         if (0 && $gCommerceSystem->isConfigActive('SEARCH_ENGINE_FRIENDLY_URLS')) {
             // TODO Fix
             $html_msg['GV_CODE_URL'] = HTTP_SERVER . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/' . $id1;
             $html_msg['GV_CODE_LINK'] = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'index.php/gv_redeem/gv_no/' . $id1 . '">' . TEXT_CLICK_TO_REDEEM . '</a>';
         } else {
             $html_msg['GV_CODE_URL'] = HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no=' . $id1;
             $html_msg['GV_CODE_LINK'] = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . 'index.php?main_page=gv_redeem&gv_no=' . $id1 . '">' . TEXT_CLICK_TO_REDEEM . '</a>';
         }
         $message .= $html_msg['GV_CODE_URL'] . "\n\n" . TEXT_OR_VISIT . HTTP_SERVER . DIR_WS_CATALOG . TEXT_ENTER_CODE . "\n\n";
         $html_msg['EMAIL_MESSAGE_HTML'] = !empty($pParamHash['message_html']) ? zen_db_prepare_input($pParamHash['message_html']) : '';
         $html_msg['EMAIL_FIRST_NAME'] = '';
         // unknown, since only an email address was supplied
         $html_msg['EMAIL_LAST_NAME'] = '';
         // unknown, since only an email address was supplied
         // disclaimer
         $message .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n";
         // Now create the coupon main entry
         $this->mDb->query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created, admin_note) values ( ?, 'G', ?, now(), ?)", array($id1, $pParamHash['amount'], $adminNote));
         $insert_id = zen_db_insert_id(TABLE_COUPONS, 'coupon_id');
         $this->mDb->query("INSERT INTO " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ( ?, '0', ?, ?, now() )", array($insert_id, $gBitUser->getDisplayName(), $pParamHash['email_to']));
         // Send the emails
         zen_mail('', $pParamHash['email_to'], $subject, $message, $from, $from, $html_msg, 'gv_mail');
         if (SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_STATUS == '1' and SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO != '') {
             zen_mail('', SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO, SEND_EXTRA_DISCOUNT_COUPON_ADMIN_EMAILS_TO_SUBJECT . ' ' . $subject, $message, $from, $from, $html_msg, 'gv_mail_extra');
         }
         if (!empty($pParamHash['oID'])) {
             $order = new order($pParamHash['oID']);
             $status['comments'] = 'A $' . $pParamHash['amount'] . ' Gift Certificate ( ' . $id1 . ' ) was emailed to ' . $pParamHash['email_to'] . ' in relation to order ' . $pParamHash['oID'] . '';
             $order->updateStatus($status);
         }
         $ret = TRUE;
         $this->CompleteTrans();
     }
     return $ret;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:66,代码来源:CommerceVoucher.php

示例2: amazon_process_order


//.........这里部分代码省略.........
                            //							{$itemTax->getCurrencyCode()}
                            $order->contents[$productsKey]['tax'] = $itemTax->getAmount();
                        }
                        if ($shippingPrice = $azi->getShippingPrice()) {
                            //							{$itemTax->getCurrencyCode()}
                            $order->info['shipping_cost'] = $shippingPrice->getAmount();
                        }
                        if (empty($attrString)) {
                            $attrString = $gCommerceSystem->getConfig('MODULE_PAYMENT_AMAZONMWS_DEFAULT_ATTRIBUTES');
                        }
                        // stock up the attributes
                        if ($attrString && ($attrs = explode(',', $attrString))) {
                            foreach ($attrs as $optionValueId) {
                                $optionId = $order->mDb->getOne("SELECT cpa.`products_options_id` FROM " . TABLE_PRODUCTS_ATTRIBUTES . " cpa WHERE cpa.`products_options_values_id`=?", array($optionValueId));
                                $order->contents[$productsKey]['attributes'][$optionId . '_' . $optionValueId] = $optionValueId;
                            }
                        }
                        if (!empty($order->contents[$productsKey]['attributes'])) {
                            $attributes = $order->contents[$productsKey]['attributes'];
                            $order->contents[$productsKey]['attributes'] = array();
                            $subindex = 0;
                            foreach ($attributes as $option => $value) {
                                $optionValues = zen_get_option_value(zen_get_options_id($option), (int) $value);
                                // Determine if attribute is a text attribute and change products array if it is.
                                if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID) {
                                    $attr_value = $order->contents[$productsKey]['attributes_values'][$option];
                                } else {
                                    $attr_value = $optionValues['products_options_values_name'];
                                }
                                $order->contents[$productsKey]['attributes'][$subindex] = array('option' => $optionValues['products_options_name'], 'value' => $attr_value, 'option_id' => $option, 'value_id' => $value, 'prefix' => $optionValues['price_prefix'], 'price' => $optionValues['options_values_price']);
                                $subindex++;
                            }
                        }
                        $shown_price = zen_add_tax($order->contents[$productsKey]['final_price'], $order->contents[$productsKey]['tax']) * $order->contents[$productsKey]['products_quantity'] + zen_add_tax($order->contents[$productsKey]['onetime_charges'], $order->contents[$productsKey]['tax']);
                        $order->subtotal += $shown_price;
                        $products_tax = $order->contents[$productsKey]['tax'];
                        $products_tax_description = $order->contents[$productsKey]['tax_description'];
                        if (DISPLAY_PRICE_WITH_TAX == 'true') {
                            $order->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
                            if (isset($order->info['tax_groups']["{$products_tax_description}"])) {
                                $order->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
                            } else {
                                $order->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
                            }
                        } else {
                            $order->info['tax'] += $products_tax / 100 * $shown_price;
                            if (isset($order->info['tax_groups']["{$products_tax_description}"])) {
                                $order->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
                            } else {
                                $order->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
                            }
                        }
                        $order->info['tax'] = zen_round($order->info['tax'], 2);
                        if ($azi->isSetShippingPrice()) {
                            $shippingPrice = $azi->getShippingPrice();
                            $shipping['cost'] += $shippingPrice->getAmount();
                        }
                    }
                    foreach (array('cc_type', 'cc_owner', 'cc_number', 'cc_expires', 'coupon_code') as $key) {
                        $order->info[$key] = NULL;
                    }
                    $order->info['shipping_method'] = $shipping['title'];
                    $order->info['shipping_method_code'] = $shipping['code'];
                    $order->info['shipping_module_code'] = $shipping['id'];
                    $order->info['payment_module_code'] = 'amazonmws';
                    $order->info['payment_method'] = 'Amazon Order';
                    $_SESSION['sendto'] = NULL;
                    $_SESSION['shipping'] = $shipping;
                    unset($_SESSION['cot_gv']);
                    require_once DIR_FS_CLASSES . 'order_total.php';
                    global $order_total_modules;
                    $order_total_modules = new order_total();
                    $order_totals = $order_total_modules->pre_confirmation_check();
                    require_once DIR_WS_MODULES . 'payment/amazonmws.php';
                    $amazon = new amazonmws($azOrder->getAmazonOrderId());
                    $amazonOutput = $amazon->process();
                    $order_totals = $order_total_modules->process();
                    array_splice($order_totals, count($order_totals) - 1, 0, array($amazonOutput));
                    if ($ordersId = $order->create($order_totals, 2)) {
                        $order->create_add_products($ordersId);
                        $ret = $ordersId;
                        $order->updateStatus(array('status' => MODULE_PAYMENT_AMAZONMWS_INITIAL_ORDER_STATUS_ID));
                    }
                }
                chdir($oldCwd);
            }
        }
    } catch (MarketplaceWebServiceOrders_Exception $ex) {
        echo "Caught Exception: " . $ex->getMessage() . "\n";
        echo "Response Status Code: " . $ex->getStatusCode() . "\n";
        echo "Error Code: " . $ex->getErrorCode() . "\n";
        echo "Error Type: " . $ex->getErrorType() . "\n";
        echo "Request ID: " . $ex->getRequestId() . "\n";
        echo "XML: " . $ex->getXML() . "\n";
    }
    $gBitUser = $holdUser;
    $gBitCustomer = new CommerceCustomer($gBitUser->mUserId);
    $_SESSION['customer_id'] = $gBitUser->mUserId;
    return $ret;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:101,代码来源:amazonmws_setup_inc.php


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