/** * Function to add item to cart. * * @return tempcode The UI */ function add_item_to_cart() { if (is_guest()) { require_code('users_inactive_occasionals'); set_session_id(get_session_id(), true); // Persist guest sessions longer } $title = get_page_title('SHOPPING'); $product_details = get_product_details(); add_to_cart($product_details); log_cart_actions('Added to cart'); $cart_view = build_url(array('page' => '_SELF', 'type' => 'misc'), '_SELF'); return redirect_screen($title, $cart_view, do_lang_tempcode('SUCCESS')); }
<?php include "get.php"; include "update.php"; /* variable */ // Category $all_category = get_all_category(); // Size Group $all_size_group = get_all_size_group(); // Color $all_color_group = get_all_color_group(); /* function database */ if ($_POST["btn-product-detail"] == 'Save Changes' || $_POST["btn-product-detail"] == 'Save Changes & Exit') { insert_product(); } else { $data = get_product_details(); }