public function getCart() { $this->onExecuteBefore('getCart'); $Itemid = KSSystem::getShopItemid(); if (!empty($this->order_id)) { $cart = KSMOrders::getOrder($this->order_id); $this->setDefaultCartValues($cart); $cart->items = KSMOrders::getOrderItems($this->order_id); for ($k = 0; $k < count($cart->items); $k++) { $cart->items[$k]->del_link = JRoute::_('index.php?option=com_ksenmart&view=cart&task=cart.update_cart&item_id=' . $cart->items[$k]->id . '&count=0&Itemid=' . $Itemid); $cart->total_prds += $cart->items[$k]->count; $cart->products_sum += $cart->items[$k]->count * $cart->items[$k]->price; } } else { $this->setDefaultCartValues($cart); } $cart->products_sum_val = KSMPrice::showPriceWithTransform($cart->products_sum); $cart->total_sum = $cart->products_sum; $cart->total_sum_val = KSMPrice::showPriceWithTransform($cart->total_sum); $this->onExecuteAfter('getCart', array(&$cart)); return $cart; }
/** * KsenMartModelProfile::getOrder() * * @param integer $order_id * @return */ public function getOrder($order_id = 0) { $this->onExecuteBefore('getOrder', array(&$order_id)); if ($order_id == 0) { $order_id = JRequest::getVar('id', 0); } $user = KSUsers::getUser(); $order = KSMOrders::getOrder($order_id); $order->shipping_title = $this->getShippingTitle($order->shipping_id); if (empty($order->email)) { $order->email = $user->email; } if (empty($order->name)) { $order->name = $user->name; } if (empty($order->phone)) { $order->phone = $user->phone; } if (!empty($order)) { $order->items = KSMOrders::getOrderItems($order_id); } $this->onExecuteAfter('getOrder', array(&$order)); return $order; }