Index: openacs-4/packages/ecommerce/www/product.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/product.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/ecommerce/www/product.tcl 19 Oct 2008 10:23:27 -0000 1.14 +++ openacs-4/packages/ecommerce/www/product.tcl 12 Feb 2009 06:40:42 -0000 1.15 @@ -15,7 +15,7 @@ @revision-date April 2002 } { - product_id:integer + {product_id 1} offer_code:optional comments_sort_by:optional usca_p:optional @@ -90,6 +90,19 @@ return } +if { [parameter::get -parameter CacheProductAsFile -default 0] && $current_url eq "[ec_url]product" } { + ns_log Notice "ecommerce/www/product.tcl: current_url = $current_url" + set site_url [ecds_product_path_from_id $product_id] + if { [string length $site_url] > 0 } { + ad_returnredirect "[ec_insecure_location][ec_url]${site_url}" + ad_script_abort + } +} + +if { [info exists url] && [string length $url] > 0 } { + set url "Original product data at: $url (opens in new window)." +} + # Finishing up the kludge from a few lines back set product_id $product_id_temp @@ -201,4 +214,4 @@ # TODO should memoize this set product_code [template::adp_compile -string $template] set product_code_output [template::adp_eval product_code] -db_release_unused_handles \ No newline at end of file +db_release_unused_handles