common\Cookie::hasAllowedCookies PHP Method

hasAllowedCookies() public static method

Has the visitor allowed cookies?
public static hasAllowedCookies ( ) : boolean
return boolean
    public static function hasAllowedCookies()
    {
        return self::exists('cookie_bar_agree') && self::get('cookie_bar_agree');
    }

Usage Example

 /**
  * 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);
     }
 }
All Usage Examples Of common\Cookie::hasAllowedCookies