本文整理汇总了PHP中CI::Orders方法的典型用法代码示例。如果您正苦于以下问题:PHP CI::Orders方法的具体用法?PHP CI::Orders怎么用?PHP CI::Orders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI
的用法示例。
在下文中一共展示了CI::Orders方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
//check to see if shipping and payment modules are installed
$data['payment_module_installed'] = (bool) count(\CI::Settings()->get_settings('payment_modules'));
$data['shipping_module_installed'] = (bool) count(\CI::Settings()->get_settings('shipping_modules'));
$data['page_title'] = lang('dashboard');
// get 5 latest orders
$data['orders'] = \CI::Orders()->getOrders(false, 'ordered_on', 'DESC', 5);
// get 5 latest customers
$data['customers'] = \CI::Customers()->get_customers(5);
$this->view('dashboard', $data);
}
示例2: processPayment
function processPayment()
{
$errors = \GC::checkOrder();
if (count($errors) > 0) {
echo json_encode(['errors' => $errors]);
return false;
} else {
$payment = ['order_id' => \GC::getAttribute('id'), 'amount' => \GC::getGrandTotal(), 'status' => 'processed', 'payment_module' => 'Cod', 'description' => lang('charge_on_delivery')];
\CI::Orders()->savePaymentInfo($payment);
$orderId = \GC::submitOrder();
//send the order ID
echo json_encode(['orderId' => $orderId]);
return false;
}
}
示例3: delete
public function delete($id)
{
\CI::Orders()->delete($id);
\CI::session()->set_flashdata('message', lang('message_order_deleted'));
//redirect as to change the url
redirect('admin/orders');
}
示例4: lang
echo lang('totals');
?>
</td>
<td class="text-center">
<?php
echo lang('product_action');
?>
</td>
</tr>
</thead>
<tbody>
<?php
$cartItems = GC::getCartItems();
$options = CI::Orders()->getItemOptions(GC::getCart()->id);
$charges = [];
$charges['giftCards'] = [];
$charges['coupons'] = [];
$charges['tax'] = [];
$charges['shipping'] = [];
$charges['products'] = [];
foreach ($cartItems as $item) {
if ($item->type == 'gift card') {
$charges['giftCards'][] = $item;
continue;
} elseif ($item->type == 'coupon') {
$charges['coupons'][] = $item;
continue;
} elseif ($item->type == 'tax') {
$charges['tax'][] = $item;
示例5: index
public function index($offset = 0)
{
//make sure they're logged in
\CI::Login()->isLoggedIn('my-account');
$data['customer'] = (array) \CI::Customers()->get_customer($this->customer->id);
$data['addresses'] = \CI::Customers()->get_address_list($this->customer->id);
$data['customer_addresses'] = \CI::Customers()->get_address_list($this->customer->id);
// load other page content
//\CI::load()->model('banner_model');
\CI::load()->helper('directory');
\CI::load()->helper('date');
// paginate the orders
\CI::load()->library('pagination');
$config['base_url'] = site_url('my_account');
$config['total_rows'] = \CI::Orders()->countCustomerOrders($this->customer->id);
$config['per_page'] = '15';
$config['first_link'] = 'First';
$config['first_tag_open'] = '<li>';
$config['first_tag_close'] = '</li>';
$config['last_link'] = 'Last';
$config['last_tag_open'] = '<li>';
$config['last_tag_close'] = '</li>';
$config['full_tag_open'] = '<div class="pagination"><ul>';
$config['full_tag_close'] = '</ul></div>';
$config['cur_tag_open'] = '<li class="active"><a href="#">';
$config['cur_tag_close'] = '</a></li>';
$config['num_tag_open'] = '<li>';
$config['num_tag_close'] = '</li>';
$config['prev_link'] = '«';
$config['prev_tag_open'] = '<li>';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = '»';
$config['next_tag_open'] = '<li>';
$config['next_tag_close'] = '</li>';
\CI::pagination()->initialize($config);
$data['orders_pagination'] = \CI::pagination()->create_links();
$data['orders'] = \CI::Orders()->getCustomerOrders($this->customer->id, $offset);
//print_r($offset);
\CI::load()->library('form_validation');
// \CI::form_validation()->set_rules('company', 'lang:address_company', 'trim|max_length[128]');
\CI::form_validation()->set_rules('firstname', 'lang:address_firstname', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('lastname', 'lang:address_lastname', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('email', 'lang:address_email', ['trim', 'required', 'valid_email', 'max_length[128]', ['check_email_callable', function ($str) {
return $this->check_email($str);
}]]);
\CI::form_validation()->set_rules('phone', 'lang:address_phone', 'trim|required|max_length[32]');
\CI::form_validation()->set_rules('email_subscribe', 'lang:account_newsletter_subscribe', 'trim|numeric|max_length[1]');
if (\CI::input()->post('password') != '' || \CI::input()->post('confirm') != '') {
\CI::form_validation()->set_rules('password', 'Password', 'required|min_length[6]|sha1');
\CI::form_validation()->set_rules('confirm', 'Confirm Password', 'required|matches[password]');
} else {
\CI::form_validation()->set_rules('password', 'Password');
\CI::form_validation()->set_rules('confirm', 'Confirm Password');
}
if (\CI::form_validation()->run() == FALSE) {
$this->view('my_account', $data);
} else {
$customer = [];
$customer['id'] = $this->customer->id;
// $customer['company'] = \CI::input()->post('company');
$customer['firstname'] = \CI::input()->post('firstname');
$customer['lastname'] = \CI::input()->post('lastname');
$customer['email'] = \CI::input()->post('email');
$customer['phone'] = \CI::input()->post('phone');
$customer['email_subscribe'] = intval((bool) \CI::input()->post('email_subscribe'));
if (\CI::input()->post('password') != '') {
$customer['password'] = \CI::input()->post('password');
}
\GC::save_customer($this->customer);
\CI::Customers()->save($customer);
\CI::session()->set_flashdata('message', lang('message_account_updated'));
redirect('my-account');
}
}
示例6: combineCart
public function combineCart($customer)
{
//current cart / items
$oldCart = CI::Orders()->getCustomerCart($customer->id);
//get the new cart in place
$this->getCart(true);
//move the options to the new order
CI::Orders()->moveOrderItems($oldCart->id, $this->cart->id);
//delete oldCart if it exists
CI::Orders()->delete($oldCart->id);
$this->repriceItems();
}
示例7: sales
function sales()
{
$data['year'] = \CI::input()->post('year');
$data['orders'] = \CI::Orders()->getGrossMonthlySales($data['year']);
$this->partial('reports/sales', $data);
}
示例8: print_order
function print_order()
{
$order_id = \CI::uri()->segment(3);
$action = \CI::uri()->segment(4);
$data['order'] = \CI::Orders()->getOrder($order_id);
//echo '<pre>';print_r($data);exit;
if (empty($action)) {
$html = \CI::load()->view('print_order_details', $data, true);
\CI::load()->helper('html_to_pdf');
convert2pdf($html, $order_id . '.pdf');
exit;
echo 'aaa';
exit;
} else {
}
}
示例9: orderCompleteEmail
public function orderCompleteEmail($orderNumber)
{
$order = \CI::Orders()->getOrder($orderNumber);
$this->partial('order_summary_email', ['order' => $order]);
}