# Copyright (c) 2001-2005 bivio Software, Inc. All rights reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: cart.bview,v 2.2 2009/08/12 17:49:27 moeller Exp $ # # Shopping cart # view_parent('menu'); view_put(header_title => 'Cart'); view_put(menu_heading => 'Shopping Cart:'); view_put(menu_content => If( ['Model.CartItemList', '->get_result_set_size'], vs_simple_form('CartItemListForm', [ Grid([[ Table('CartItemListForm', [ ['remove', { column_widget => ImageFormButton({ image => 'remove', field => 'remove', alt => 'Remove Item From Shopping Cart', }), }], 'Item.item_id', ['item_name', { wf_list_link => { query => 'THIS_CHILD_LIST', task => 'ITEM_DETAIL', }, }], 'in_stock', 'CartItem.unit_price', ['CartItem.quantity', { size => 4, }], 'total_cost', ], { cellpadding => 2, cellspacing => 2, footer_row_widgets => [ vs_blank_cell(), String('Total:', 'table_heading'), vs_blank_cell()->put(column_span => 4), TableSummaryCell({ field => 'total_cost', string_font => 'table_heading', }), ], }), vs_blank_cell(), ImageFormButton({ image => 'update_cart', field => 'update_cart', alt => 'Update', }), ]]), vs_blank_cell(), ImageFormButton({ image => 'checkout', field => 'ok_button', alt => 'Proceed to Checkout', }), ], 1), # Else String('Your shopping cart is empty.', 'page_text'), ));