Пример #1
0
 /**
  * get_cart_total function.
  *
  * @access public
  * @return void
  */
 public function get_cart_total()
 {
     $total = array();
     if (is_array($this->cart_items) && !empty($this->cart_items)) {
         foreach ($this->cart_items as $cart_item) {
             $type = new Product_Type($cart_item->product_type);
             $ingredient = new Ingredient();
             $ingredients = $ingredient->load_product_ingredients($cart_item->product_id);
             $product = new Product($cart_item->product_id);
             $total[] = $product->get_product_total_price($product, $ingredients);
         }
     }
     return array_sum($total);
 }