/**
* Get the data
*/
private function getData()
{
// get cookie
$this->orderId = Cookie::get('order_id');
// check if cookies are available
$this->cookiesEnabled = Cookie::hasAllowedCookies();
// check if cookies exists
if ($this->orderId || $this->cookiesEnabled == true) {
// get the products
$this->products = FrontendCatalogModel::getProductsByOrder($this->orderId);
// count amount of products in shopping cart
$this->amountOfProducts = count($this->products);
// total price
$this->totalPrice = '0';
// calculate total amount
foreach ($this->products as &$product) {
// calculate total
$subtotal = (int) $product['subtotal_price'];
$this->totalPrice = (int) $this->totalPrice;
$this->totalPrice = $this->totalPrice + $subtotal;
}
$this->totalPriceArr['total'] = $this->totalPrice;
// insert total price in db
FrontendCatalogModel::updateOrder($this->totalPriceArr, $this->orderId);
}
}