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


PHP Hook::orderConfirmation方法代码示例

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


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

示例1: process

 public function process()
 {
     parent::process();
     self::$smarty->assign(array('is_guest' => self::$cookie->is_guest, 'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int) $this->id_order), 'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int) $this->id_order, (int) $this->id_module)));
     if (self::$cookie->is_guest) {
         self::$smarty->assign(array('id_order' => $this->id_order, 'id_order_formatted' => sprintf('#%06d', $this->id_order)));
         /* If guest we clear the cookie for security reason */
         self::$cookie->mylogout();
     }
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:10,代码来源:OrderConfirmationController.php

示例2: process

 public function process()
 {
     parent::process();
     self::$smarty->assign(array('is_guest' => self::$cookie->is_guest, 'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int) $this->id_order), 'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int) $this->id_order, (int) $this->id_module)));
     if (self::$cookie->is_guest) {
         self::$smarty->assign(array('id_order' => $this->id_order, 'id_order_formatted' => sprintf('#%06d', $this->id_order)));
         /* If guest we clear the cookie for security reason */
         self::$cookie->logout();
     } else {
         self::$smarty->assign(array('id_order' => $this->id_order, 'id_order_formatted' => sprintf('#%06d', $this->id_order)));
     }
     //assign order details here
     $order = new Order($this->id_order);
     if (Validate::isLoadedObject($order) and $order->id_customer == self::$cookie->id_customer) {
         $id_order_state = (int) $order->getCurrentState();
         $carrier = new Carrier((int) $order->id_carrier, (int) $order->id_lang);
         $addressInvoice = new Address((int) $order->id_address_invoice);
         $addressDelivery = new Address((int) $order->id_address_delivery);
         //	$stateInvoiceAddress = new State((int)$addressInvoice->id_state);
         $inv_adr_fields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
         $dlv_adr_fields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
         $invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressInvoice, $inv_adr_fields);
         $deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
         if ($order->total_discounts > 0) {
             self::$smarty->assign('total_old', (double) ($order->total_paid - $order->total_discounts));
         }
         self::$smarty->assign('order_total', Tools::ps_round($order->total_paid));
         self::$smarty->assign('order_total_usd', Tools::ps_round(Tools::convertPrice($order->total_paid, self::$cookie->id_currency, false)));
         $products = $order->getProducts();
         $customizedDatas = Product::getAllCustomizedDatas((int) $order->id_cart);
         Product::addCustomizationPrice($products, $customizedDatas);
         $customer = new Customer($order->id_customer);
         $order->customization_fee = Cart::getCustomizationCostStatic((int) $order->id_cart);
         $totalQuantity = 0;
         foreach ($products as $productRow) {
             $totalQuantity += $productRow['product_quantity'];
         }
         if (strpos($order->payment, 'COD') === false) {
             self::$smarty->assign('paymentMethod', 'ONLINE');
         } else {
             self::$smarty->assign('paymentMethod', 'COD');
         }
         $shippingdate = new DateTime($order->expected_shipping_date);
         self::$smarty->assign(array('shipping_date' => $shippingdate->format("F j, Y"), 'shop_name' => strval(Configuration::get('PS_SHOP_NAME')), 'order' => $order, 'return_allowed' => (int) $order->isReturnable(), 'currency' => new Currency($order->id_currency), 'order_state' => (int) $id_order_state, 'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'), 'invoice' => OrderState::invoiceAvailable((int) $id_order_state) and $order->invoice_number, 'order_history' => $order->getHistory((int) self::$cookie->id_lang, false, true), 'products' => $products, 'discounts' => $order->getDiscounts(), 'carrier' => $carrier, 'address_invoice' => $addressInvoice, 'invoiceState' => (Validate::isLoadedObject($addressInvoice) and $addressInvoice->id_state) ? new State((int) $addressInvoice->id_state) : false, 'address_delivery' => $addressDelivery, 'inv_adr_fields' => $inv_adr_fields, 'dlv_adr_fields' => $dlv_adr_fields, 'invoiceAddressFormatedValues' => $invoiceAddressFormatedValues, 'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues, 'deliveryState' => (Validate::isLoadedObject($addressDelivery) and $addressDelivery->id_state) ? new State((int) $addressDelivery->id_state) : false, 'is_guest' => false, 'messages' => Message::getMessagesByOrderId((int) $order->id), 'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_, 'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_, 'use_tax' => Configuration::get('PS_TAX'), 'group_use_tax' => Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC, 'customizedDatas' => $customizedDatas, 'totalQuantity' => $totalQuantity));
         if ($carrier->url and $order->shipping_number) {
             self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
         }
         self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
         Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
         //FB Share
         //$products = $order->getProducts();
         $orderProducts = array();
         $productMaxVal = 0;
         $productMaxId = null;
         foreach ($products as $product) {
             array_push($orderProducts, $product['product_id']);
             if ($product['product_price'] > $productMaxVal) {
                 $productMaxId = $product['product_id'];
                 $productMaxVal = $product['product_price'];
             }
         }
         $productObj = new Product($productMaxId, true, 1);
         self::$smarty->assign('fbShareProductObject', $productObj->getLink());
         self::$smarty->assign('fbShareProductObjectId', $productMaxId);
         self::$smarty->assign('orderProducts', implode(",", $orderProducts));
         self::$cookie->shareProductCode = md5(time() . $productMaxId);
         self::$cookie->write();
         unset($carrier);
         unset($addressInvoice);
         unset($addressDelivery);
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:72,代码来源:OrderConfirmationController.php

示例3: dirname

<?php

/* SSL Management */
$useSSL = true;
include dirname(__FILE__) . '/config/config.inc.php';
include dirname(__FILE__) . '/header.php';
$id_cart = intval(Tools::getValue('id_cart', 0));
$id_module = intval(Tools::getValue('id_module', 0));
$id_order = Order::getOrderByCartId(intval($id_cart));
$secure_key = isset($_GET['key']) ? $_GET['key'] : false;
if (!$id_order or !$id_module or !$secure_key or empty($secure_key)) {
    Tools::redirect('history.php');
}
$order = new Order(intval($id_order));
if (!Validate::isLoadedObject($order) or $order->id_customer != $cookie->id_customer or $secure_key != $order->secure_key) {
    Tools::redirect('history.php');
}
$module = Module::getInstanceById(intval($id_module));
if ($order->payment != $module->displayName) {
    Tools::redirect('history.php');
}
$smarty->assign(array('HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation(intval($id_order)), 'HOOK_PAYMENT_RETURN' => Hook::paymentReturn(intval($id_order), intval($id_module))));
$smarty->display(_PS_THEME_DIR_ . 'order-confirmation.tpl');
include dirname(__FILE__) . '/footer.php';
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:24,代码来源:order-confirmation.php


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