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


PHP Model_Order::check_pricing方法代码示例

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


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

示例1: action_checkout

 /**
  * pay!
  */
 public function action_checkout()
 {
     if (!Auth::instance()->logged_in()) {
         $this->redirect(Route::get('oc-panel')->uri());
     }
     $user = Auth::instance()->get_user();
     //resend confirmation email
     if (is_numeric($id_order = $this->request->param('id'))) {
         $order = new Model_Order($id_order);
         if ($order->loaded() and $order->id_user == $user->id_user and $order->status == Model_Order::STATUS_CREATED) {
             //verify the coupon and check order against user information, if its different update order info and maybe price!
             $order->check_pricing();
             $this->template->title = __('Checkout');
             Breadcrumbs::add(Breadcrumb::factory()->set_title($this->template->title));
             $this->template->content = View::factory('pages/product/checkout', array('order' => $order, 'user' => $user, 'product' => $order->product));
         } else {
             Alert::set(Alert::WARNING, __('Order not found or already paid'));
             $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
         }
     } else {
         Alert::set(Alert::ERROR, __('Order not found'));
         $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
     }
 }
开发者ID:alirezadamash,项目名称:open-eshop,代码行数:27,代码来源:product.php

示例2: action_checkoutfree

 /**
  * confirms a checkout when its a free order
  * @return [type] [description]
  */
 public function action_checkoutfree()
 {
     $order = new Model_Order($this->request->param('id'));
     if ($order->loaded()) {
         //if paid...no way jose
         if ($order->status != Model_Order::STATUS_CREATED) {
             Alert::set(Alert::INFO, __('This order was already paid.'));
             $this->redirect(Route::url('default'));
         }
         //checks coupons or amount of featured days
         $order->check_pricing();
         //he needs to pay...little prick
         if ($order->amount > 0) {
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         } else {
             $order->confirm_payment('cash');
             $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
         }
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
开发者ID:nick-catanchin-ie,项目名称:openclassifieds2,代码行数:27,代码来源:ad.php

示例3: action_checkout

 /**
  * pay an invoice, renders the paymenthods button, anyone with an ID of an order can pay it, we do not have control
  * @return [type] [description]
  */
 public function action_checkout()
 {
     $order = new Model_Order($this->request->param('id'));
     if ($order->loaded()) {
         //hack jquery paymill
         Paymill::jquery();
         //if paid...no way jose
         if ($order->status != Model_Order::STATUS_CREATED) {
             Alert::set(Alert::INFO, __('This order was already paid.'));
             $this->redirect(Route::url('default'));
         }
         //checks coupons or amount of featured days
         $order->check_pricing();
         //template header
         $this->template->title = __('Checkout') . ' ' . Model_Order::product_desc($order->id_product);
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
         Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Pricing'))->set_url(Route::url('pricing')));
         Breadcrumbs::add(Breadcrumb::factory()->set_title($this->template->title));
         Controller::$full_width = TRUE;
         $this->template->bind('content', $content);
         $this->template->content = View::factory('pages/ad/checkout', array('order' => $order));
     } else {
         //throw 404
         throw HTTP_Exception::factory(404, __('Page not found'));
     }
 }
开发者ID:johnulist,项目名称:openclassifieds2,代码行数:30,代码来源:plan.php


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