本文整理汇总了PHP中Model_Order::add_VAT方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Order::add_VAT方法的具体用法?PHP Model_Order::add_VAT怎么用?PHP Model_Order::add_VAT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Order
的用法示例。
在下文中一共展示了Model_Order::add_VAT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
//adds VAT to the amount
$order->add_VAT();
//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'));
}
}
示例2: 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();
//adds VAT to the amount
$order->add_VAT();
//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'));
}
}