<?php echo get_order_timing_display(); ?> </select> </div></div> <div class="col-md-6"><div class="form-group"> <label for="registration_no">Car Rego. No: <a href="#" data-toggle="tooltip" title="We require a Car Rego number to identify your order at the Slide Thru (Drive Thru).">Why?</a></label> <input type="text" name="rege_no" id="rege_no" value="<?php echo isset($_SESSION['rege_no']) ? $_SESSION['rege_no'] : ''; ?> " class="form-control" autocomplete="off"/> </div></div> <div class="col-md-12"><div class="form-group cart-products" id="cart-products_list"> <?php $cart_details = print_cart(); echo $cart_details['html']; ?> </div></div> </div> <div class="row ordered-item"> <div class="col-md-9 order_left">Sub Total</div> <div class="col-md-3 order_right"><strong><span class="sub_total">$<?php echo $cart_details['sub_total']; ?> </span></strong></div> </div> <!-- <div class="row deliver-item">
function session_cart() { session_start(); global $wpdb, $user_ID; $tbl_cart = $wpdb->prefix . 'cart'; $cart_details = print_cart(); $cart = array('id_user' => $user_ID, 'price' => $cart_details['total'], 'item_count' => $cart_details['product_count'], 'id_session' => session_id()); $wpdb->insert($tbl_cart, $cart); echo 'success'; die; }
$cart .= '<td>' . $show_diskont . '</td>'; $cart .= '<td>' . $in_order . '</td>'; $cart .= '<td>' . $in_stock . '</td>'; $cart .= '<td>' . $price[0] . '</td>'; $cart .= '</tr>'; $total_goods += get_available($in_order, $in_stock); $total_cost += $price[0]; $total_profit += $price[1] - $price[0]; } $cart .= '</table>'; $cart .= $action_profit; $cart .= '<table style="border:1px solid gray;background:lightgray"><tr><td>ИТОГО в заказе:</td><td> - ' . $count . ' наименования,<br/>'; $cart .= '- ' . $total_goods . ' товаров,<br/> - ' . $total_cost . ' сумма к оплате,<br/> - ' . $total_profit . ' сэкономлено на скидках</td></tr></table>'; return $cart; } echo print_cart(); //TODO: get_profit (выгода от добора акционного товара), get_action (получать массив акционного товара и возвращать попадает ли товар под акцию или нет) /* Helpers */ function diskont($diskont, $key = '', $goods) { switch ($diskont) { case 0: return 1; break; case 1: return 0.9; break; case 2: return 0.8; break; case 3: