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


PHP Data::getBasketAmount方法代码示例

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


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

示例1: updateShopOrderTotals

 /**
  * Update the shop order totals for the give order id
  *
  * @param int $orderId
  */
 public static function updateShopOrderTotals($orderId)
 {
     $order = new order($orderId);
     $total = Data::getRevertedLocalePrice(Data::getBasketAmount($order, $orderId), $order);
     $sql = "UPDATE orders_total SET value = " . (double) $total . " WHERE class = 'ot_total' AND orders_id = '" . tep_db_input($orderId) . "'";
     tep_db_query($sql);
     $tax = Data::getRevertedLocalePrice(Data::getTotalTaxAmount($orderId), $order);
     $sql = "UPDATE orders_total SET value = " . (double) $tax . " WHERE class = 'ot_tax' AND orders_id = '" . tep_db_input($orderId) . "'";
     tep_db_query($sql);
     $subtotal = Data::getRevertedLocalePrice(Data::getSubtotal($orderId), $order);
     $sql = "UPDATE orders_total SET value = " . (double) $subtotal . " WHERE class = 'ot_subtotal' and orders_id = '" . tep_db_input($orderId) . "'";
     tep_db_query($sql);
     $classes = array('ot_total', 'ot_tax', 'ot_subtotal');
     foreach ($classes as $class) {
         $sql = "SELECT value from orders_total WHERE orders_id = '" . tep_db_input($orderId) . "' and class = '{$class}'";
         $query = tep_db_query($sql);
         $entry = tep_db_fetch_array($query);
         $text = Data::getFormattedPrice($entry['value'], $order->info['language'], $order);
         if ($class == 'ot_total') {
             $text = "<b>" . Data::getFormattedPrice(Data::getLocalePrice($entry['value'], $order), $order->info['language'], $order) . "</b>";
         }
         $sql = "UPDATE orders_total SET text = '{$text}' WHERE orders_id = '" . tep_db_input($orderId) . "' and class = '{$class}'";
         tep_db_query($sql);
     }
 }
开发者ID:ratepay,项目名称:oscommerce-module,代码行数:30,代码来源:Db.php

示例2: die

 * @license   GPLv2
 */
/**
 * RatePAY order template, displays the deliver/cancel, refund, credit and histroy panel
 */
require_once 'includes/application_top.php';
require_once '../includes/languages/' . $_SESSION['language'] . '/admin/modules/payment/ratepay.php';
require_once '../includes/classes/ratepay/helpers/Data.php';
require_once '../includes/classes/ratepay/helpers/Db.php';
require_once '../includes/classes/ratepay/helpers/Session.php';
require_once '../includes/classes/ratepay/helpers/Globals.php';
require_once 'includes/classes/order.php';
$orderId = Globals::hasParam('oID') ? Globals::getParam('oID') : die('Missing param: "oID"');
$order = new order($orderId);
$lang = $_SESSION['language'];
$basketAmount = Data::getBasketAmount($order, $orderId);
require DIR_WS_INCLUDES . 'template_top.php';
?>
<script language="javascript" src="<?php 
echo DIR_WS_CATALOG . 'templates/javascript/ratepay_order.js';
?>
"></script>
<style>
    .piRpRight
    {
        text-align:right;
    }
</style>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
    <tr>
        <td width="100%" valign="top" class="boxCenter">
开发者ID:ratepay,项目名称:oscommerce-module,代码行数:31,代码来源:ratepay_order.php

示例3: getBasketInfoModel

 /**
  * Retrieve a basketInfo model, filled with the items and basket data
  * 
  * @param order $order
  * @param int $orderId
  * @param array $post
  * @return BasketInfo
  */
 public static function getBasketInfoModel(order $order, $orderId = null, array $post = array())
 {
     $basketInfo = new BasketInfo();
     $basketInfo->setAmount(Data::getBasketAmount($order, $orderId, $post))->setCurrency($order->info['currency'])->setItems(self::getItems($order, $post, $orderId));
     return $basketInfo;
 }
开发者ID:ratepay,项目名称:oscommerce-module,代码行数:14,代码来源:RequestMapper.php

示例4: pre_confirmation_check

 /**
  * Is called after checkout_payment.php is confirmed,
  * checks if all needed customer data available or 
  * redirect the customer to the checkout_payment.php
  * with a error message otherwise the user get to the
  * ratepay terms page
  * 
  * @global order $order
  */
 public function pre_confirmation_check()
 {
     global $order;
     if (!$this->isInfoVisited()) {
         if ($this->_isPhoneNeeded()) {
             if (Globals::hasPostEntry($this->code . '_phone') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_phone'))) {
                 $phone = Globals::getPostEntry($this->code . '_phone');
                 if ($this->_isPhoneValid($phone)) {
                     Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_telephone', $phone);
                     $order->customer['telephone'] = $phone;
                 } else {
                     $this->error['PHONE'] = 'INVALID';
                 }
             } else {
                 $this->error['PHONE'] = 'MISSING';
             }
         }
         if ($this->_isDobNeeded()) {
             if (Globals::hasPostEntry($this->code . '_birthdate') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_birthdate'))) {
                 $dob = Globals::getPostEntry($this->code . '_birthdate');
                 if (!$this->_isDobValid($dob)) {
                     $this->error['DOB'] = 'INVALID';
                 } elseif (!$this->_isAdult($dob)) {
                     $this->error['DOB'] = 'YOUNGER';
                 } else {
                     $dobArr = explode('.', $dob);
                     $dateStr = $dobArr[2] . "-" . $dobArr[1] . "-" . $dobArr[0] . " 00:00:00";
                     Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_dob', $dateStr);
                 }
             } else {
                 $this->error['DOB'] = 'MISSING';
             }
         }
         if ($this->_isCompanyNeeded()) {
             if (Globals::hasPostEntry($this->code . '_company') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_company'))) {
                 $company = Globals::getPostEntry($this->code . '_company');
                 $order->customer['company'] = $company;
                 $order->billing['company'] = $company;
                 $dbInput = tep_db_input(Db::getXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_default_address_id'));
                 tep_db_query("UPDATE " . TABLE_ADDRESS_BOOK . " " . "SET entry_company = '" . tep_db_prepare_input($company) . "' " . "WHERE address_book_id = '" . $dbInput . "'");
             } else {
                 $this->error['VATID'] = 'MISSING';
             }
         }
         if ($this->_isVatIdNeeded()) {
             if (Globals::hasPostEntry($this->code . '_vatid') && !Data::betterEmpty(Globals::getPostEntry($this->code . '_vatid'))) {
                 Db::setXtCustomerEntry(Session::getSessionEntry('customer_id'), 'customers_vat_id', Globals::getPostEntry($this->code . '_vatid'));
             } else {
                 $this->error['VATID'] = 'MISSING';
             }
         }
         if (empty($this->error)) {
             $this->setInfoVisited(true);
             Session::setRpSessionEntry('basketAmount', Data::getBasketAmount($order));
             //$url = tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL');
             $url = tep_href_link($this->_getNextStepPayment(), '', 'SSL');
         } else {
             $this->error = urlencode($this->_getErrorString($this->error));
             $url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $this->error, 'SSL');
         }
         tep_redirect($url);
     }
 }
开发者ID:ratepay,项目名称:oscommerce-module,代码行数:72,代码来源:ratepay_abstract.php


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