 |
| Gazebos and Other Garden Structure Designs
|
| Janet & Richard Strombeck |
|
|
 |
| Getting the Very Best From Your Router
|
| Pat Warner |
|
|
 |
| Glueing and Clamping |
| Nick Engler |
|
|
 |
| The Glue Book |
| William Tandy Young |
|
|
 |
| Good Wood Finishes |
| Albert Jackson & David Day |
|
|
 |
| Good Wood Handbook |
| Albert Jackson & David Day |
|
|
 |
| The Great All-American Wooden Toy Book |
| Norman Marshall |
|
|
 |
| Great Little Things to Make on a Small Lathe
|
| David Regester |
|
|
 |
| Great Wood Finishes |
| Jeff Jewitt |
|
|
 |
| Gustav Stickley- His Craft |
| Patricia Bartinique |
|
|
| Barnes
& Noble.com |
| Rockler
eld (@sc_cart_display_fields) { print qq!
| $cart_font_style $field |
\n!; } # We'll also add on table headers for Quantity and
# Subtotal. } #######################################################################
# display_cart_table Subroutine # #######################################################################
# The job of display_cart_table is to display the current
# contents of the user's cart for several diffferent # types
of screens which all display the cart in some form # or
another. The subroutine takes one argumnet, the # reason
that the cart is being displayed, and is called # with the
following syntax: # # &display_cart_table("reason"); # #
There are really only five values that # $reason_to_display_cart
should be equal to: # # 1. "" (View/Modify Cart Screen)
# 2. "changequantity" (Change Quantity Form) # 3. "delete"
(Delete Item Form) # 4. "orderform" (Order Form) # 5. "process
order" (Order Form Process Confirmation) # # Notice that
this corresponds closely to the list in # cart_table_header
because the goal of this subroutine is # to fill in the
actual cells of the table created by # cart_table_header
sub display_cart_table { # Working variables are initialized
and defined as local # to this subroutine. Don't mess with
these definitions. local($reason_to_display_cart) = @_;
local(@cart_fields); local($cart_id_number); local($quantity);
local($unformatted_subtotal); local($subtotal); local($unformatted_grand_total);
local($grand_total); local($price); local($text_of_cart);
local($total_quantity) = 0; local($total_measured_quantity)
= 0; local($display_index); local($counter); local($hidden_field_name);
local($hidden_field_value); local($display_counter); local($product_id,
@db_row); # Next the script determines which type of cart
display it # is being asked to produce. It uses pattern
matching to # look for key phrases in the ($reason_to_display_cart
# defined as an incoming argument. Whatever the case, the
# subroutine calls cart_table_header to begin outputting
# the HTML cart display. if ($reason_to_display_cart =~
/change*quantity/i) { &cart_table_header("New Quantity");
} elsif ($reason_to_display_cart =~ /delete/i) { &cart_table_header("Delete
Item"); } else { &cart_table_header(""); } # Next, the client's
cart is read line by line (file open # errors handled by
file_open_error as usual). open (CART, "$sc_cart_path")
|| &file_open_error("$sc_cart_path", "display_cart_contents",
__FILE__, __LINE__); while () { # Since every line
in the cart will be displayed as a cell # in an HTML table,
we begin by outputting an opening #
tag. print "
"; # Next, the current line has it's final newline charcater
# chopped off. chop; # Then, the script splits the row in
the client's cart # and grabs the unique product ID number,
the unique cart # id number, and the quantity. We will use
those values # while processing the cart. @cart_fields =
split (/\|/, $_); $cart_row_number = pop(@cart_fields);
push (@cart_fields, $cart_row_number); $quantity = $cart_fields[0];
$product_id = $cart_fields[1]; # Next we will need to begin
to distinguish between types # of displays we are being
asked for because each type of # display is slightly different.
For example, if we are # being asked to display a cart for
the delete item # form, we will need to add a checkbox before
each item so # that the customer can select which items
to delete. If, # on the other hand, we are being asked for
modify the # quantity of an item form, we need to add a
text field # instead, so that the customer can enter a new
quantity. # # The first case we will handle is if we are
being asked # to display the cart as part of order processing.
if (($reason_to_display_cart =~ /orderform/i) && ($sc_order_check_db
=~ /yes/i)) { # If we are displaying the cart for order
# processing AND we are checking the # database to make
sure that the product being # ordered is OK, then we need
to load the # database libraries if they have not been #
required already. if (!($sc_db_lib_was_loaded =~ /yes/i))
{ &require_supporting_libraries (__FILE__, __LINE__, "$sc_db_lib_path");
} # Then, we call the check_db_with_product_id # in the
database library. If it returns # false, then we output
a footer # complaining about the problem and # exit the
program. if (!(&check_db_with_product_id($product_id,*db_row)))
{ print qq~
| |
|
I'm sorry, Product ID: $product_id
was not found in the database. Your order cannot be
processed without this validation. Please contact
the site administrator.
|
|
|