public function displayCartInvoice($user) { $html = file_get_contents('ushop/html/invoice.html', true); $cart = $this->retrieveCart(); $user_info = $this->getUserInfo($user); $params = array('CART' => $cart->displayCart(), 'USER_INFO' => $user_info['info'], 'USER_CDA' => $user_info['cda'], 'USER_EMAIL' => $user_info['email'], 'MERCHANT_DETAILS' => $this->getMerchantInfo()); $html = Uthando::templateParser($html, $params, '{', '}'); $html = preg_replace("/<th>(.*?)<\\/th>/s", "", $html); $remove = array('delete_item', 'item_quantity_input'); if (!$this->invoice['display_top']) { $remove[] = 'top'; } if (!$this->invoice['display_bottom']) { $remove[] = "bottom"; } foreach ($remove as $value) { $html = UShop_Utility::removeSection($html, $value); } return $html; }
public function displayCart() { global $uthando; $cb = file_get_contents('ushop/html/cart_body.html', true); $ci = file_get_contents('ushop/html/cart_items.html', true); if (!$uthando->ushop->checkout['vat_state']) { $ci = UShop_Utility::removeSection($ci, 'vat'); } if (!$uthando->ushop->checkout['vat_state']) { $cb = UShop_Utility::removeSection($cb, 'vat'); } $params = array('COLSPAN' => $uthando->ushop->checkout['vat_state'] == 1 ? 3 : 2, 'CART_ITEMS' => null); $items = $this->calculateCartItems(); if (is_array($items)) { foreach ($items as $item) { $tr = Uthando::templateParser($ci, $item, '{', '}'); $params['CART_ITEMS'] .= $tr; } if (isset($_SESSION['CountryCode'])) { $this->calculatePostage(); } else { $this->cart['postCost'] = 0; $this->cart['postTax'] = 0; $cb = UShop_Utility::removeSection($cb, 'postage'); } $params = array_merge($params, $this->getCartTotals()); $html = Uthando::templateParser($cb, $params, '{', '}'); } else { $html = $items; } return $html; }