$q = !empty($custom_price) ? " AND custom_price = '$custom_price'" : ''; if ($row = Database::get_assoc("SELECT * FROM e_cart_items WHERE cart_id='$cart_id' AND item_id='$id' {$q}")) { $amount = $row['amount'] + $amount; } if ($result = $this->cart_update($id, $amount, $msg, $custom_price)) { Repository::$frontend->cart_added = $id; $msg = t('Prekë ádëta á krepðelá.'); } return $result; } public function has_coupon() { $ret = false; $cart_id = $this->_get_cart_id(); if (!empty($cart_id)) { $products = Database::get_assoc_all(" SELECT p.* FROM e_products AS p LEFT JOIN e_product_items AS pi ON (pi.product_id = p.id) LEFT JOIN e_cart_items AS ci ON (ci.item_id = pi.id) WHERE ci.cart_id = $cart_id "); foreach ($products as $product) { if (!empty($product['coupon'])) { $ret = true; break; } } } return $ret; } public function apply_percent_discount(&$cart, $percent, $name, $sum_up = false, $keys = false) { if ($keys === false) { $keys = array_keys($cart['cart_items']); } $discount = 0; foreach ($keys as $k) { $cart_item = &$cart['cart_items'][$k]; $old_price = $sum_up ? $cart_item['price'] : $cart_item['old_price']; $new_price = round($old_price * ((100 - $percent) / 100), 6); if ($new_price < $cart_item['price']) { $cart_item['price'] = round($new_price, 2); $new_sum = $new_price * $cart_item['amount']; $discount += ($cart_item['sum'] - $new_sum); $cart_item['sum'] = round($new_sum, 2); } } if ($discount > 0) { $cart['discounts'][] = array( 'name' => $name, 'sum' => -$discount, ); } return $discount; } public function calc_subtotal($form) { $subtotal = $this->calc_sum($form) - (@$form['giftcards_sum'] ?: 0); if ($subtotal < 0) { $subtotal = 0; } return $subtotal; } public function calc_total($form) { $total = $this->calc_sum($form) + (@$form['delivery']['price'] ?: 0) - (@$form['giftcards_sum'] ?: 0) + $form['deposit_fee']; if ($total < 0) { $total = 0; } return $total; } public function apply_discounts(&$form) { $form['discounts'] = array(); // suma be nuolaidø $form['old_sum'] = $this->calc_old_sum($form); // jau taikomos nuolaidos $form['discount_sum'] = -$this->calc_discount_sum($form); // kiti nuolaidø kodai $this->get_e('vouchers')->use_vouchers($form); // tarpinë suma $form['subtotal'] = $this->calc_sum($form); // bendra suma $form['sum'] = $this->calc_total($form); if (FrontendHelper::is_b2b_project()) { $vatRate = 0.21; $form['vat_sum'] = round($form['sum'] * $vatRate, 2); $form['total_with_vat'] = round($form['sum'] + $form['vat_sum'], 2); } } } Katalogas

Katalogas (14549)

Virtuvės ir baro prekės

Platus prekių katalogas restoranams, kavinėms ir verslui – nuo virtuvės įrangos iki vienkartinių indų, pakavimo sprendimų ir šventinių prekių. Atraskite kokybiškus produktus profesionaliam ir kasdieniam naudojimui vienoje vietoje.


Filtrai Norų sąrašas Meniu 0 0 €
Į viršų