Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 9 Aug 2008 10:30:03 -0000 1.27
+++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 9 Aug 2008 11:44:20 -0000 1.28
@@ -1,5 +1,5 @@
ad_library {
- Definitions for the ecommerce module
+ Main definitions for the ecommerce module
Note: Other ecommerce procedures can be found in ecommerce-*.tcl
@cvs-id $Id$
@@ -734,7 +734,7 @@
# total cost
# little security check
-
+ set includes_DisplayPriceOfZeroAs_item 0
set correct_user_id [db_string correct_user_id "
select user_id as correct_user_id
from ec_orders
@@ -765,13 +765,16 @@
db_foreach order_details_select "
select i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice,
- p.product_name, p.one_line_description, p.product_id, count(*) as quantity
+ p.product_name, p.one_line_description, p.product_id, p.sku, count(*) as quantity
from ec_items i, ec_products p
where i.order_id = :order_id
and i.product_id = p.product_id
group by p.product_name, p.one_line_description, p.product_id, i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice" {
set option_list [list]
+ if { $price_charged == 0 } {
+ set includes_DisplayPriceOfZeroAs_item 1
+ }
if { ![empty_string_p $color_choice] } {
lappend option_list "Color: $color_choice"
}
@@ -786,7 +789,7 @@
set options "$options; "
}
- append items_ul "
Quantity $quantity: $product_name; $options$price_name: [ec_pretty_price $price_charged [ad_parameter -package_id [ec_id] Currency ecommerce]]"
+ append items_ul "Quantity $quantity: Stock No $sku, $product_name; $options$price_name: [ec_pretty_price $price_charged [ad_parameter -package_id [ec_id] Currency ecommerce]]"
if { $show_item_detail_p == "t" } {
append items_ul "
[ec_shipment_summary_sub $product_id $color_choice $size_choice $style_choice $price_charged $price_name $order_id]"
@@ -819,13 +822,18 @@
+"
+if { $includes_DisplayPriceOfZeroAs_item == 1 } {
+ # add comment here about meaning of items flagged with parameter DisplayPriceOfZeroAs
+ append to_return "
"
+}
-
+append to_return "
Ship via: $shipping_method_to_print
$price_summary
"
+
return $to_return
}
@@ -834,19 +842,23 @@
# (a) it's only used once, and
# (b) it's extremely simple
-ad_proc ec_item_summary_in_confirmed_order { order_id {ul_p "f"}} { item summary in confirmed order } {
-
+ad_proc ec_item_summary_in_confirmed_order {
+ order_id
+ {ul_p "f"}
+} {
+ item summary in confirmed order
+} {
set item_list [list]
db_foreach item_summary_info_select {
select i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice,
- p.product_name, p.one_line_description, p.product_id,
+ p.product_name, p.one_line_description, p.product_id, p.sku,
count(*) as quantity
from ec_items i,
ec_products p
where i.order_id = :order_id
and i.product_id = p.product_id
- group by p.product_name, p.one_line_description, p.product_id,
+ group by p.sku, p.product_name, p.one_line_description, p.product_id,
i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice
} {
@@ -864,8 +876,14 @@
if { ![empty_string_p $options] } {
set options "$options; "
}
+ if {![info exists sku]} {
+ set sku " -"
+ } else {
+ append sku " -"
+ }
- lappend item_list "Quantity $quantity: $product_name; $options$price_name: [ec_pretty_price $price_charged]"
+ lappend item_list "Quantity $quantity: $sku $product_name; $options$price_name: [ec_pretty_price $price_charged]"
+ set sku ""
}
if { $ul_p == "f" } {
return [join $item_list "\n"]
@@ -988,18 +1006,18 @@
set lowest_price_description [lindex $lowest_price_and_price_name 1]
if {![string equal "" $lowest_price_description]} {
set price_line "
-
+
- $lowest_price_description: | "
+ $lowest_price_description: | "
} else {
set price_line "
-
-
- Our Price: | "
+
+
+ Our Price: | "
}
append price_line "
-
- [ec_pretty_price $lowest_price $currency]
+ |
+ [ec_pretty_price $lowest_price $currency]
|
"
@@ -1149,10 +1167,13 @@
"
for { set counter 0 } { $counter < 5 } { incr counter } {
- set product_id [set product_$counter]
- if { ![empty_string_p $product_id] } {
- append to_return "[db_string product_name_select {select product_name from ec_products where product_id = :product_id}]\n"
- }
+ set product_id [set product_$counter]
+ if { ![empty_string_p $product_id] } {
+ set item_name [db_string product_name_select {select product_name from ec_products where product_id = :product_id and present_p = 't'} -default ""]
+ if { ![empty_string_p $item_name] } {
+ append to_return "${item_name}"
+ }
+ }
}
append to_return "
Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql 28 Aug 2003 09:41:53 -0000 1.7
+++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.xql 9 Aug 2008 11:44:20 -0000 1.8
@@ -57,7 +57,7 @@
select product_name
from ec_products
- where product_id = :product_id
+ where product_id = :product_id and present_p = 't'
@@ -235,21 +235,21 @@
- select i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice, p.product_name, p.one_line_description, p.product_id, count(*) as quantity
+ select i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice, p.product_name, p.one_line_description, p.product_id, p.sku, count(*) as quantity
from ec_items i, ec_products p
where i.order_id = :order_id
and i.product_id = p.product_id
- group by p.product_name, p.one_line_description, p.product_id, i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice
+ group by p.product_name, p.one_line_description, p.product_id, p.sku, i.price_name, i.price_charged, i.color_choice, i.size_choice, i.style_choice
- select i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice, p.product_name, p.one_line_description, p.product_id, count(*) as quantity
+ select i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice, p.sku, p.product_name, p.one_line_description, p.product_id, count(*) as quantity
from ec_items i, ec_products p
where i.order_id = :order_id
and i.product_id = p.product_id
- group by p.product_name, p.one_line_description, p.product_id, i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice
+ group by p.sku, p.product_name, p.one_line_description, p.product_id, i.price_charged, i.price_name, i.color_choice, i.size_choice, i.style_choice
@@ -293,18 +293,10 @@
select product_name
from ec_products
- where product_id = :product_id
+ where product_id = :product_id and present_p = 't'
-
-
- select product_name
- from ec_products
- where product_id = :product_id
-
-
-
select s.shipment_date, s.carrier, s.tracking_number, s.shipment_id, s.shippable_p, count(*) as n_items