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


PHP OrderSlip::getOrdersSlip方法代码示例

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


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

示例1: getTemplateVarCreditSlips

 public function getTemplateVarCreditSlips()
 {
     $credit_slips = [];
     $orders_slip = OrderSlip::getOrdersSlip((int) $this->context->cookie->id_customer);
     foreach ($orders_slip as $order_slip) {
         $order = new Order($order_slip['id_order']);
         $credit_slips[$order_slip['id_order_slip']] = $order_slip;
         $credit_slips[$order_slip['id_order_slip']]['credit_slip_number'] = sprintf($this->trans('#%06d', array(), 'Shop.Theme.CustomerAccount'), $order_slip['id_order_slip']);
         $credit_slips[$order_slip['id_order_slip']]['order_number'] = sprintf($this->trans('#%06d', array(), 'Shop.Theme.CustomerAccount'), $order_slip['id_order']);
         $credit_slips[$order_slip['id_order_slip']]['order_reference'] = $order->reference;
         $credit_slips[$order_slip['id_order_slip']]['credit_slip_date'] = Tools::displayDate($order_slip['date_add'], null, false);
         $credit_slips[$order_slip['id_order_slip']]['url'] = $this->context->link->getPageLink('pdf-order-slip', true, null, 'id_order_slip=' . (int) $order_slip['id_order_slip']);
         $credit_slips[$order_slip['id_order_slip']]['order_url_details'] = $this->context->link->getPageLink('order-detail', true, null, 'id_order=' . (int) $order_slip['id_order']);
     }
     return $credit_slips;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:16,代码来源:OrderSlipController.php

示例2: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int) $this->context->cookie->id_customer));
     $this->setTemplate(_PS_THEME_DIR_ . 'order-slip.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:10,代码来源:OrderSlipController.php

示例3: hookPayment


//.........这里部分代码省略.........
     if ($discount == '0') {
         $discount = 'false';
     }
     if ($discount == '1') {
         $discount = 'true';
     }
     $discount_boolean = $discount == 'true' ? 1 : 0;
     $iframe = Configuration::get('PAYLATER_IFRAME');
     if ($iframe == 1) {
         $iframe = 'true';
     }
     $endpoint = $this->url;
     $order_id = $this->context->cart->id;
     //description
     $description = implode(',', $desciption);
     $convert_price = Tools::convertPrice($this->context->cart->getOrderTotal(true, 3), $this->context->currency);
     $amount = number_format($convert_price, 2, '.', '');
     $amount = str_replace('.', '', $amount);
     if (Configuration::get('PAYLATER_ENVIRONMENT') == 1) {
         $key_to_use = Configuration::get('PAYLATER_ACCOUNT_KEY_LIVE');
     } else {
         $key_to_use = Configuration::get('PAYLATER_ACCOUNT_KEY_TEST');
     }
     $widget_type = Configuration::get('PAYLATER_TYPE') == 'false' ? '0' : '1';
     $total_paid = 0;
     $num_prev_orders = 0;
     $sign_up_date = '';
     $num_partial_refunds = 0;
     $amount_refunded = 0;
     $num_full_refunds = 0;
     $super_checkout_enabled = false;
     $onepagecheckoutps_enabled = false;
     $onepagecheckout_enabled = false;
     if (version_compare(_PS_VERSION_, "1.5", "<")) {
         if ($this->context->cookie->logged) {
             $orders = Order::getCustomerOrders($this->context->customer->id);
             foreach ($orders as $o) {
                 $total_paid += $o['total_paid'];
                 $num_prev_orders++;
             }
             $sign_up_date = Tools::substr($this->context->customer->date_add, 0, 10);
             $order_slips = OrderSlip::getOrdersSlip((int) $this->context->cookie->id_customer);
             foreach ($order_slips as $o) {
                 $num_full_refunds++;
                 $amount_refunded += $o['amount'];
             }
         }
     } else {
         //query for paid statuses
         $sql = new DbQuery();
         $sql->select('id_order_state');
         $sql->from('order_state', 'c');
         $sql->where('c.paid = 1');
         $db_paid_statuses = Db::getInstance()->executeS($sql);
         $paid_statuses = [];
         foreach ($db_paid_statuses as $p) {
             $paid_statuses[] = $p['id_order_state'];
         }
         if ($this->context->cookie->logged) {
             $orders = Order::getCustomerOrders($this->context->customer->id);
             foreach ($orders as $o) {
                 if (array_key_exists('id_order_state', $o) && in_array($o['id_order_state'], $paid_statuses)) {
                     $total_paid += $o['total_paid'];
                     $num_prev_orders++;
                 }
             }
             $sign_up_date = Tools::substr($this->context->customer->date_add, 0, 10);
             $order_slips = OrderSlip::getOrdersSlip((int) $this->context->cookie->id_customer);
             foreach ($order_slips as $o) {
                 $sql = new DbQuery();
                 $sql->select('total_paid');
                 $sql->from('orders', 'c');
                 $sql->where('c.id_order = ' . $o['id_order']);
                 $db_total_paid = Db::getInstance()->executeS($sql);
                 if ($db_total_paid[0]['total_paid'] <= $o['amount']) {
                     $num_full_refunds++;
                 } else {
                     $num_partial_refunds++;
                 }
                 $amount_refunded += $o['amount'];
             }
         }
         $super_checkout_enabled = Module::isEnabled('supercheckout');
         $onepagecheckoutps_enabled = Module::isEnabled('onepagecheckoutps');
         $onepagecheckout_enabled = Module::isEnabled('onepagecheckout');
     }
     //d($key_to_use.$account_id.$order_id.$amount.$this->context->currency->iso_code.$url_OK.$url_NOK);
     $text = $key_to_use . $account_id . $order_id . $amount . $this->context->currency->iso_code . $url_OK . $url_NOK . $callback_url . $discount . $cancelled_url;
     $signature = hash('sha512', $text);
     $this->smarty->assign(array('endpoint' => $endpoint, 'account_id' => $account_id, 'currency' => $this->context->currency->iso_code, 'ok_url' => $url_OK, 'nok_url' => $url_NOK, 'cancelled_url' => $cancelled_url, 'order_id' => $order_id, 'amount' => $amount, 'description' => $description, 'items' => $items, 'signature' => $signature, 'customer_name' => $this->context->cookie->logged ? $this->context->cookie->customer_firstname . ' ' . $this->context->cookie->customer_lastname : $customer->firstname . " " . $customer->lastname, 'customer_email' => $this->context->cookie->logged ? $this->context->cookie->email : $customer->email, 'locale' => $this->context->language->iso_code, 'cart_products' => $cart_products, 'street' => $street, 'city' => $city, 'province' => $province, 'zipcode' => $zipcode, 'sstreet' => $sstreet, 'scity' => $scity, 'sprovince' => $sprovince, 'szipcode' => $szipcode, 'phone' => $phone, 'mobile_phone' => $mobile_phone, 'dni' => $dni, 'callback_url' => $callback_url, 'discount' => $discount, 'discount_boolean' => $discount_boolean, 'dob' => $this->context->customer->birthday ? $this->context->customer->birthday : $customer->birthday, 'iframe' => $iframe, 'total_paid' => $total_paid, 'num_prev_orders' => $num_prev_orders, 'sign_up_date' => $sign_up_date, 'amount_refunded' => $amount_refunded, 'num_full_refunds' => $num_full_refunds, 'num_partial_refunds' => $num_partial_refunds, 'version4' => version_compare(_PS_VERSION_, "1.5", "<"), 'version3' => version_compare(_PS_VERSION_, "1.4", "<"), 'content' => "javascript:\$('#paylater_form').submit();"));
     if ($super_checkout_enabled) {
         return $this->display(__FILE__, 'views/templates/front/payment_supercheckout.tpl');
     } elseif ($onepagecheckoutps_enabled || $onepagecheckout_enabled) {
         return $this->display(__FILE__, 'views/templates/front/payment.tpl');
     } elseif ($widget_type) {
         return $this->display(__FILE__, 'views/templates/front/payment_widget.tpl');
     } else {
         return $this->display(__FILE__, 'views/templates/front/payment.tpl');
     }
 }
开发者ID:pagantis,项目名称:pagamastarde-prestashop,代码行数:101,代码来源:paylater.php

示例4: process

 public function process()
 {
     parent::process();
     self::$smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int) self::$cookie->id_customer));
 }
开发者ID:greench,项目名称:prestashop,代码行数:5,代码来源:OrderSlipController.php

示例5: viewDetails


//.........这里部分代码省略.........
						</tr>';
            }
            echo '
					</table></div>';
        }
        echo '
				</div>';
        // Cancel product
        echo '
				<div style="clear:both; height:15px;">&nbsp;</div>
				<div style="float: right; width: 160px;">';
        if ($order->hasBeenDelivered() and Configuration::get('PS_ORDER_RETURN')) {
            echo '
					<input type="checkbox" id="reinjectQuantities" name="reinjectQuantities" class="button" />&nbsp;<label for="reinjectQuantities" style="float:none; font-weight:normal;">' . $this->l('Re-stock products') . '</label><br />';
        }
        if (!$order->hasBeenDelivered() and $order->hasBeenPaid() or $order->hasBeenDelivered() and Configuration::get('PS_ORDER_RETURN')) {
            echo '
					<input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" class="button" onclick="toogleShippingCost(this)" />&nbsp;<label for="generateCreditSlip" style="float:none; font-weight:normal;">' . $this->l('Generate a credit slip') . '</label><br />
					<input type="checkbox" id="generateDiscount" name="generateDiscount" class="button" onclick="toogleShippingCost(this)" />&nbsp;<label for="generateDiscount" style="float:none; font-weight:normal;">' . $this->l('Generate a voucher') . '</label><br />
					<span id="spanShippingBack" style="display:none;"><input type="checkbox" id="shippingBack" name="shippingBack" class="button" />&nbsp;<label for="shippingBack" style="float:none; font-weight:normal;">' . $this->l('Repay shipping costs') . '</label><br /></span>';
        }
        if (!$order->hasBeenDelivered() or $order->hasBeenDelivered() and Configuration::get('PS_ORDER_RETURN')) {
            echo '
					<div style="text-align:center; margin-top:5px;"><input type="submit" name="cancelProduct" value="' . ($order->hasBeenDelivered() ? $this->l('Return products') : ($order->hasBeenPaid() ? $this->l('Refund products') : $this->l('Cancel products'))) . '" class="button" style="margin-top:8px;" /></div>';
        }
        echo '
				</div>';
        echo '
			</fieldset>
		</form>
		<div class="clear" style="height:20px;">&nbsp;</div>';
        /* Display send a message to customer & returns/credit slip*/
        $returns = OrderReturn::getOrdersReturn($order->id_customer, $order->id);
        $slips = OrderSlip::getOrdersSlip($order->id_customer, $order->id);
        echo '
		<div style="float: left">
			<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&token=' . $this->token . '" method="post" onsubmit="if (getE(\'visibility\').checked == true) return confirm(\'' . $this->l('Do you want to send this message to the customer?', __CLASS__, true, false) . '\');">
			<fieldset style="width: 400px;">
				<legend style="cursor: pointer;" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><img src="../img/admin/email_edit.gif" /> ' . $this->l('New message') . '</legend>
				<div id="message_m" style="display: ' . (Tools::getValue('message') ? 'none' : 'block') . '; overflow: auto; width: 400px;">
					<a href="#" onclick="$(\'#message\').slideToggle();$(\'#message_m\').slideToggle();return false"><b>' . $this->l('Click here') . '</b> ' . $this->l('to add a comment or send a message to the customer') . '</a>
				</div>
				<div id="message" style="display: ' . (Tools::getValue('message') ? 'block' : 'none') . '">
					<select name="order_message" id="order_message" onchange="orderOverwriteMessage(this, \'' . $this->l('Do you want to overwrite your existing message?') . '\')">
						<option value="0" selected="selected">-- ' . $this->l('Choose a standard message') . ' --</option>';
        $orderMessages = OrderMessage::getOrderMessages((int) $order->id_lang);
        foreach ($orderMessages as $orderMessage) {
            echo '		<option value="' . htmlentities($orderMessage['message'], ENT_COMPAT, 'UTF-8') . '">' . $orderMessage['name'] . '</option>';
        }
        echo '		</select><br /><br />
					<b>' . $this->l('Display to consumer?') . '</b>
					<input type="radio" name="visibility" id="visibility" value="0" /> ' . $this->l('Yes') . '
					<input type="radio" name="visibility" value="1" checked="checked" /> ' . $this->l('No') . '
					<p id="nbchars" style="display:inline;font-size:10px;color:#666;"></p><br /><br />
					<textarea id="txt_msg" name="message" cols="50" rows="8" onKeyUp="var length = document.getElementById(\'txt_msg\').value.length; if (length > 600) length = \'600+\'; document.getElementById(\'nbchars\').innerHTML = \'' . $this->l('600 chars max') . ' (\' + length + \')\';">' . htmlentities(Tools::getValue('message'), ENT_COMPAT, 'UTF-8') . '</textarea><br /><br />
					<input type="hidden" name="id_order" value="' . (int) $order->id . '" />
					<input type="hidden" name="id_customer" value="' . (int) $order->id_customer . '" />
					<input type="submit" class="button" name="submitMessage" value="' . $this->l('Send') . '" />
				</div>
			</fieldset>
			</form>';
        /* Display list of messages */
        if (sizeof($messages)) {
            echo '
			<br />
			<fieldset style="width: 400px;">
开发者ID:srikanthash09,项目名称:codetestdatld,代码行数:67,代码来源:AdminOrders.php

示例6: dirname

<?php

/* SSL Management */
$useSSL = true;
include dirname(__FILE__) . '/config/config.inc.php';
include dirname(__FILE__) . '/init.php';
if (!$cookie->isLogged()) {
    Tools::redirect('authentication.php?back=history.php');
}
/* Js files call */
$js_files = array(__PS_BASE_URI__ . 'js/jquery/jquery.scrollto.js', _THEME_JS_DIR_ . 'history.js');
$smarty->assign('ordersSlip', OrderSlip::getOrdersSlip(intval($cookie->id_customer)));
include dirname(__FILE__) . '/header.php';
$smarty->display(_PS_THEME_DIR_ . 'order-slip.tpl');
include dirname(__FILE__) . '/footer.php';
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:15,代码来源:order-slip.php


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