----------- File: web_store.cgi Subroutine: display_products_for_sale Our frontpage has the same layout as our Product pages; it includes two links (text and graphic) that allow the customer to view their cart. If I viewed the cart from the frontpage and then clicked on "Continue Shopping", I got a "document contained no data" error because $page was null. I added a line to this routine to display the frontpage if $page is null. # If the store is HTML-based and there is no current # keyword however, the script simply displays the page as # requested with display_page which will be discussed # shortly. if ($page eq "") { &output_frontpage; exit; } &display_page("$sc_html_product_directory_path/$page", "Display Products for Sale", __FILE__, __LINE__); } ----------- File: web_store.cgi Subroutine: add_to_the_cart Because some of our product pages have multiple items on them, I wanted to allow customers to submit quantities of zero. I changed the following part of the routine, as indicated by arrows, to allow that. Quantities of zero are not added to the cart. if (($item =~ /^item-/i || $item =~ /^option/i) && --> $form_data{$item} ne "" && --> $form_data{$item} ne "0") { # Comments... $item =~ s/^item-//i; if ($item =~ /^option/i) { push (@options, $item); } # Comments... else { --> # if (($form_data{"item-$item"} =~ /\D/) || --> # ($form_data{"item-$item"} == 0)) --> if (($form_data{"item-$item"} =~ /\D/)) { &bad_order_note; } else { $quantity = $form_data{"item-$item"}; push (@items_ordered_with_options, "$quantity\|$item\|"); } } } # End of if ($item ne "$variable" && $form_data{$item} ne "") } #End of foreach $item (@items_ordered) ----------- File: web_store.cgi Subroutine: display_price On a 640x480 resolution screen, the prices in the last column of a cart table were displaying on two lines. I added a non-breaking space to this routine to prevent that. (Since we only us U.S. dollars, we put the money symbol in front of the price. You could make the same modification to the "else" part of this routine, too.) if ($sc_money_symbol_placement eq "front") { $format_price = "$sc_money_symbol"." "."$price"; }