Index: openacs-4/packages/ecommerce/www/admin/products/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/admin/products/add.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/ecommerce/www/admin/products/add.tcl 13 Jan 2005 13:58:02 -0000 1.5 +++ openacs-4/packages/ecommerce/www/admin/products/add.tcl 13 Aug 2008 11:10:27 -0000 1.6 @@ -14,212 +14,60 @@ ad_require_permission [ad_conn package_id] admin -doc_body_append "[ad_admin_header "Add a Product"] +set title "Add a Product" +set context [list $title] -

Add a Product

+set currency [parameter::get -package_id [ec_id] -parameter Currency] +set multiple_retailers_p [parameter::get -package_id [ec_id] -parameter MultipleRetailersPerProductP -default 0] +set weight_units [parameter::get -package_id [ec_id] -parameter WeightUnits -default lbs] -[ad_context_bar [list "../" "Ecommerce([ec_system_name])"] [list "index" "Products"] "Add Product"] - -
- -All fields are optional except Product Name. -

-" -set multiple_retailers_p [ad_parameter -package_id [ec_id] MultipleRetailersPerProductP ecommerce] - - - -doc_body_append "

- - - - - - - - - - - - - - - -" -if { !$multiple_retailers_p } { - doc_body_append " - - - - " +if { $multiple_retailers_p } { + set stock_status_html [ec_hidden_input stock_status ""] + set price_html [ec_hidden_input price ""] + set shipping_html [ec_hidden_input shipping ""] + set shipping_additional_html [ec_hidden_input shipping_additional ""] } else { - doc_body_append "[ec_hidden_input stock_status ""]\n" -} -doc_body_append " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" -if { !$multiple_retailers_p } { - doc_body_append " - - - - " -} else { - doc_body_append "[ec_hidden_input price ""]\n" -} -doc_body_append " - - - - - - - - - - - - - -" -if { !$multiple_retailers_p } { - doc_body_append " - - - - - - - - - " -} else { - doc_body_append "[ec_hidden_input shipping ""]\n[ec_hidden_input shipping_additional ""]\n" -} -doc_body_append " - - - -
Product Name
SKUIt's not necessary to include a SKU because the system generates its own -internal product_id to uniquely distinguish products.
Product Category[ec_category_widget t]Choose as many categories as you like. The product will -be displayed on the web site in each of the categories you select.
Stock Status[ec_stock_status_widget]
One-Line Description
Additional Descriptive Text

Search Keywords

-

Data from Product's Name, One Line Description, and Other Detailed Description -are automatically included in product searches. -No need to repeat as keywords.

PictureThis picture (.gif or .jpg format) can be as large as you like. A thumbnail will be automatically generated. Note that file uploading doesn't work with Internet Explorer 3.0.
Color ChoicesThis should be a comma-separated list of colors the user is allowed to choose from -when ordering. If there are no choices, leave this blank.
Size ChoicesThis should be a comma-separated list of sizes the user is allowed to choose from -when ordering. If there are no choices, leave this blank.
Style ChoicesThis should be a comma-separated list of styles the user is allowed to choose from -when ordering. If there are no choices, leave this blank.
Email on PurchaseThis should be a comma-separated list of recipients to notify when a purchase is made. If you do not wish email to be sent, leave this blank.
URL where the consumer can get more info on the product
Regular PriceAll prices are in [ad_parameter -package_id [ec_id] Currency ecommerce]. The price should - be written as a decimal number (no special characters like \$). -
Is this product shippable?Yes -   -No -You might choose \"No\" if this product is actually a service.
Should this product be displayed when the user does a search?Yes -   -No -You might choose \"No\" if this product is part of a series.
When does this product become available for purchase?[ad_dateentrywidget available_date]
Shipping PriceThe \"Shipping Price\", \"Shipping Price - Additional\", and \"Weight\" fields - may or may not be applicable, depending on the - shipping rules you have set up for - your ecommerce system.
Shipping Price - Additional per item if ordering more than 1 (leave blank if same as Shipping Price above)
Weight ([ad_parameter -package_id [ec_id] WeightUnits ecommerce])
- -

-" - + set stock_status_html [ec_stock_status_widget] + set price_html "" +} +set available_date_html [ad_dateentrywidget available_date] +set product_category_html [ec_category_widget t] set n_user_classes [db_string num_user_classes_select "select count(*) from ec_user_classes"] if { $n_user_classes > 0 && !$multiple_retailers_p} { - doc_body_append "

Special Prices for User Classes

- -

- - - " - set first_class_p 1 + set user_classes_html "" + db_foreach user_class_select " select user_class_id, user_class_name from ec_user_classes order by user_class_name" { - doc_body_append " - - " + append user_classes_html " + " - if { $first_class_p } { - set first_class_p 0 - doc_body_append "\n" - } - doc_body_append "\n" + } + append user_classes_html "\n" } - doc_body_append "
$user_class_name
$user_class_nameEnter prices (no + if { $first_class_p } { + set first_class_p 0 + append user_classes_html "Enter prices (no special characters like \$) only if you want people in user classes to be charged a different price than the regular price. If you leave user class prices blank, then the users will be charged regular price.
\n" } -if { [db_string num_custom_product_fields_select "select count(*) from ec_custom_product_fields where active_p='t'"] > 0 } { - - doc_body_append "

Custom Fields

- -

- - - " - - db_foreach custom_fields_select " +set n_custom_product_fields [db_string num_custom_product_fields_select "select count(*) from ec_custom_product_fields where active_p='t'"] +if { $n_custom_product_fields > 0 } { + set custom_product_fields_html "" + db_foreach custom_fields_select " select field_identifier, field_name, default_value, column_type from ec_custom_product_fields where active_p='t' order by creation_date" { - doc_body_append "\n" + append custom_product_fields_html "\n" } - doc_body_append "
$field_name[ec_custom_product_field_form_element $field_identifier $column_type $default_value]
$field_name[ec_custom_product_field_form_element $field_identifier $column_type $default_value]
\n" - } -doc_body_append "

- -
-
-[ad_admin_footer] -"