$versions{'agora_setup.pl'} = '06.6.00.0000';
$sc_userfields_available = '5';
$sc_database_version = '5 User';

$sc_agoracat_client_string = 'AgoraCart Route 66';

$sc_browser_header = "Content-type: text/html\n\n";
$sc_completed_orders_are_enabled = 'yes';
#######################################################################
#                AgoraCart CORE SYTEM definitions                        #
#######################################################################

# Setup the directory definitions first
$sc_data_file_dir = './data66';
$sc_data_file_dir_simple = 'data66';
$sc_html_dir = './view66';
$sc_html_dir_for_URL = 'view66';
$sc_sys_dir = './system66';
$sc_user_conf_dir = './user_config66';

$sc_lang_dir = './language';

$sc_lib_dir = "$sc_sys_dir/library";
$sc_plugin_lib_dir = "$sc_sys_dir/plug_ins";
$sc_sysview_dir = "$sc_sys_dir/view";
$sc_syscart_dir = "$sc_sys_dir/cart";
$sc_checkout_lib_dir = "$sc_sys_dir/checkout";
$sc_shiplib_dir ="$sc_sys_dir/shipping";
$sc_paygates_dir = "$sc_sys_dir/payment_gateways";
$sc_syscheckout_dir = "$sc_sys_dir/checkout";

$sc_add_on_modules_dir = "$sc_sys_dir/plug_ins";

$sc_templates_dir = "$sc_html_dir/templates";
$sc_viewer_assets_dir_URL = "$sc_html_dir_for_URL/assets";
$sc_hedfut_templates_dir = "$sc_templates_dir/headers_footers";
$sc_hedfut_template_manifest = 'template_manifest.inc';
$sc_cartPlates_dir = "$sc_templates_dir/view_cart_contents/$sc_cssframework_dir_for_URL";
$sc_product_layouts_dir = "$sc_templates_dir/productPages/$sc_cssframework_dir_for_URL";
$sc_product_layouts_dir_standard = "$sc_templates_dir/productPages/$sc_cssframework_dir_for_URL";
$sc_cartverifyplates_dir = "$sc_templates_dir/verify_order_pages/$sc_lang_path/$sc_cssframework_dir_for_URL";
$sc_thankyouplates_dir = "$sc_templates_dir/thankyou_pages/$sc_lang_path/$sc_cssframework_dir_for_URL";
$sc_emailPlates_dir = "$sc_templates_dir/cart_emails/$sc_lang_path";
$sc_orderViewing_dir = "$sc_templates_dir/order_viewing/$sc_lang_path/$sc_cssframework_dir_for_URL";
$sc_store_HTML_includes = "$sc_sysview_dir/agora_misc_html_code.inc";
$sc_store_HTML_framework = "$sc_sysview_dir/agora_html_framework.pl";

$sc_admin_dir = "$sc_user_conf_dir/cart";
$sc_userlog_settings = "$sc_admin_dir/agora_userlog_lib.pl";
$sc_userpay_conf_dir = "$sc_user_conf_dir/payment_gateways";

$sc_display_orderform_path = "$sc_syscheckout_dir/display_order_form.pl";

$sc_user_carts_directory_path = './shopping_sessions';
$sc_api_pending_cart_dir_path = $sc_user_carts_directory_path . '/api_pending';
$sc_database_sql_option_lib = 'agora_db_mysql_lib.pl';
$sc_empty_cart_footer_file = 'empty_cart_footer.inc';
$sc_full_cart_footer_file = 'cart_footer.inc';
$ppinc_root_name = 'productPage';
$ppinc_root_name_orig = 'productPage';
$sc_iso_3166_2_countries = "$sc_data_file_dir" . '/iso-3166-2_country_names_and_codes.pl';


if ( $sc_database_lib eq $sc_database_sql_option_lib ) {
   $sc_order_lib_path = "$sc_checkout_lib_dir/agora_order_mySQL_lib.pl";
}
else {
  $sc_html_setup_file_path = "$sc_sysview_dir/page_display_store.pl";
  $sc_order_lib_path = "$sc_checkout_lib_dir/agora_order_lib.pl";
}

$sc_db_lib_path = "$sc_lib_dir/$sc_database_lib";
$sc_pgp_lib_path = "$sc_lib_dir/pgp-lib.pl";
$sc_mail_lib_path = "$sc_lib_dir/mail-lib.pl";
$sc_smtp_mail_lib_path = "$sc_lib_dir/mail-smtp.pl";
$sc_ship_lib_path = "$sc_shiplib_dir/shipping_lib.pl";

$sc_data_file_path = "$sc_data_file_dir/db/data.file";
$shipfilename = "$sc_data_file_dir/db/shipping_dimensions.file";
$sc_cat_desc_data_path = "$sc_data_file_dir/db/product_category_metadata.file";

$sc_options_directory_path = "$sc_html_dir/product_option_files/$sc_lang_path/$sc_cssframework_dir_for_URL";
$sc_generic_directory_path = "$sc_html_dir/files";
$sc_html_product_directory_path = "$sc_html_dir/staticHTML_pages_product/$sc_lang_path";
$sc_form_dir_path = "$sc_html_dir/order_forms/$sc_lang_path/$sc_cssframework_dir_for_URL";
#$sc_html_order_form_path = "$sc_form_dir_path/$sc_gateway_name-orderform.html";
$error_page = "$sc_html_dir/error.html";
$sc_store_front_path = "$sc_html_dir/homepage/$sc_lang_path/storehomepage.html";
$sc_store_menu_pages_path = "$sc_html_dir/staticHTML_pages_cartlink/$sc_lang_path";

$sc_logs_dir = "$sc_data_file_dir/log_files";
$sc_logs_dir_simple = "$sc_data_file_dir_simple/log_files";
$sc_error_log_path = "$sc_logs_dir/error.log";
$sc_access_log_path = "$sc_logs_dir/access.log";
$sc_order_log_directory_path = "$sc_logs_dir/order_logs";
$sc_pending_api_orders_log_path = $sc_logs_dir . '/pending_orders.log';
$sc_avalara_log_path = "$sc_logs_dir/avalara.log";
$sc_ppipn_log_path = "$sc_data_file_dir/ppipn_logs";

$sc_period_for_cart_delete_check = '28000'; # default: 8 hours
$sc_delete_cart_time_keeper_path = "$sc_admin_dir/delete_carts_time_keeper.pl";

$sc_grep = 'grep';
$sc_main_script_url = 'agora.cgi';
$sc_picserve_url = 'picserve.cgi';
$sc_secpicserver_url = 'picserve.cgi';

if ($sc_stepone_order_script_url eq '') { #set default value
  $sc_stepone_order_script_url = $sc_store_url;
 }
$sc_debug_mode = 'no';
$sc_debug_track_cartid = 'no';
$sc_cookie_days = 60; # browser cookie lifetime, not cart lifetime.  set to -1 if you wish cookies to expire when browser is closed.

$sc_allow_location_redirect = 'yes'; # helpful for cookies
$sc_test_for_store_cart_change_repeats = 1; # test for reloaded pages

# widespread use in store, especially special features parsed via HTML pages as well as product option files.
$sc_use_agorascript = 'yes';

# if this var is "" then it won't process multiple instances of the
# same product id number on a single web page.
$sc_web_pid_sep_char = '~~';

# special manager control variables
$mc_allow_multiple_options = 'yes';

#######################################################################
#                Database Definition Variables                        #
#######################################################################

$sc_db_flatfile_caching_ok = 'yes';
$VF_DEF{"PRODUCT"} = 'db';

# If you need more fields, put them before 'options' field,
# options must be last!

$db[ 0]='product_id';
$db[ 1]='product';
$db[ 2]='price';
$db[ 3]='name';
$db[ 4]='image';
$db[ 5]='description';
$db[ 6]='shipping';
$db[ 7]='user1';
$db[ 8]='user2';
$db[ 9]='user3';
$db[10]='user4';
$db[11]="user5";
$db[12]="SpecialPrice";
$db[13]="NetProfit";
$db[14]="WholesalePricing";
$db[15]="Inventory";
$db[16]="IsTaxable";
$db[17]="TaxTypeID";
$db[18]="SpecialTaxRateAdjust";
$db[19]="ShipRateAdjust";
$db[20]="options";

{ my $inx=-1;
  my $txt;
  foreach $txt (@db) {
    $inx++;
    $db{$txt}=$inx;
   }
}

@sc_db_display_fields = ('Product');

@sc_db_index_for_display = ($db{'image'},
                            $db{'name'},
                            $db{'description'},
                            $db{'options'},
                            $db{'price'},
                            $db{'shipping'},
                            $db{'user1'},
                            $db{'user2'},
                            $db{'user3'},
                            $db{'user4'},
                            $db{"user5"},
                            $db{"SpecialPrice"},
                            $db{"NetProfit"},
                            $db{"WholesalePricing"},
                            $db{"Inventory"},
                            $db{"IsTaxable"},
                            $db{"TaxTypeID"},
                            $db{"SpecialTaxRateAdjust"},
                            $db{"ShipRateAdjust"} );


@sc_db_index_for_defining_item_id =
($db{'product_id'},
 $db{'product'},
 $db{'price'},
 $db{'name'},
 $db{'image'},
 $db{'shipping'});

$sc_db_index_of_product_id = $db{'product_id'};
$sc_db_index_of_product = $db{'category'};

# These two can be changed if need be, they are used to get the db price
# for verification when adding to the cart.
# could use a virtual field
$sc_db_price_field_name  = 'price';
$sc_db_index_of_price  = $db{$sc_db_price_field_name};

@sc_db_query_criteria = ("product_id|0|=|string",
                         "p_id|0|=|string",
                         "product|1|=|string",
                         "user1|$db{'user1'}|=|string",
                         "user2|$db{'user2'}|=|string",
                         "user3|$db{'user3'}|=|string",
                         "user4|$db{'user4'}|=|string",
                         "user5|$db{'user5'}|=|string",
                         "user6|$db{'user6'}|=|string",
                         "user7|$db{'user7'}|=|string",
                         "user8|$db{'user8'}|=|string",
                         "user9|$db{'user9'}|=|string",
                         "user10|$db{'user10'}|=|string",
                         "keywords|0,1,3,5,9,10|=|string",
                         "lopr|2|<=|number",
                         "hipr|2|>=|number",
                         "query_price_low_range|2|<=|number",
                         "query_price_high_range|2|>=|number");

#######################################################################
#                    Cart Definition Variables                        #
#######################################################################
# The cart associative array is defined via the following steps:
#
# 1. The 0th field is ALWAYS the quantity of the purchased item
#
# 2. The subsequent fields are the same fields defined
#    in the @sc_db_index_for_defining_item_id variable.
#    This is done because whatever is defined in this array,
#    becomes the part of the product defined in the user's cart.
#
#
# 3. The field before the next to last field is ALWAYS the
#    "options" that have been selected by the user.  If you are
#     not using options, this field still needs to be here. It will
#     just be used as an empty place marker.
#
# 4. The next to last field is ALWAYS the price
#    after options have been calculated in with the normal price.
#
# 5. The last field is ALWAYS a computer generated
#    unique identifier to distinguish cart line items from
#    each other.


$sc_opt_sep_marker = '{';
$VF_DEF{'CART'} = 'cart';

$cart[ 0]='quantity';
$cart[ 1]='product_id';
$cart[ 2]='product'; # category
$cart[ 3]='price';
$cart[ 4]='name';
$cart[ 5]='image';
$cart[ 6]='shipping';
$cart[ 7]='shipping_calc_flag';
$cart[ 8]='options_ids';
$cart[ 9]='user1';
$cart[10]='user2';
$cart[11]='user3';
$cart[12]='user4';
$cart[13]='user5';
$cart[14]='user6';
$cart[15]='options';
$cart[16]='price_after_options';
$cart[17]='unique_cart_line_id';
#
{ my $inx=-1;
  my $txt;
  foreach $txt (@cart) {
    $inx++;
    $cart{$txt}=$inx;
   }
}

# old-style vitual fields ...
# Virtual Cart Fields are all the negated value of position in data.file
$cart{'db_description'}      = -5;
$cart{'db_price'}            = -2;
$cart{'db_shipping'}         = -6;
$cart{'db_user1'}            = -7;
$cart{'db_user2'}            = -8;
$cart{'db_user3'}            = -9;
$cart{'db_user4'}            = -10;
$cart{'db_user5'}            = -11;

###
# new-style virtual fields, perl code, first char is *
###
$cart{"email_options"}  = '* $ans=cart_email_options(&vf_eval("options"));';

$sc_opt_web_strip_part_number = 'yes';
$sc_opt_email_leading_spaces = 15;
#########
$sc_cart_index_of_price = $cart{'price'};
$sc_cart_index_of_image = $cart{'image'};
$sc_cart_index_of_price_after_options = $cart{'price_after_options'};

# this will show the index of another column of our choice
# to measure -- such as weight or volume if we are selling
# something where the weight or volume affects the shipping
# or discount logic.

$sc_cart_index_of_measured_value = $cart{'shipping'};
$sc_cart_index_of_item_id = $cart{'product_id'};
$sc_cart_index_of_quantity = $cart{'quantity'};

# The following will generate hidden fields with
# the contents of the cart inside of them.
$sc_order_with_hidden_fields = 'yes';

# increasing numerical value (1,2,3) if its 0,
# then it never gets calculated at this stage

$sc_max_final_values_loops = 3; # hard coded to do a min of 3 anyway!

if ($sc_calculate_shipping_loop eq "" ||
    $sc_calculate_shipping_loop < 0   ||
    $sc_calculate_shipping_loop > 3   ) {
  $sc_calculate_shipping_loop = 3;  # set the loop value to default
 }

if ($sc_use_SBW =~ /yes/i) { # need ZIP before we can determine
 $sc_calculate_shipping_at_display_form = 0;
} else { #we can display, value is actual ship price
 $sc_calculate_shipping_at_display_form = $sc_calculate_shipping_loop; #3
}

$sc_calculate_shipping_at_process_form = $sc_calculate_shipping_loop; #3

$sc_calculate_sales_tax_at_display_form = 3;
$sc_calculate_sales_tax_at_process_form = 3;

$sc_calculate_PSTsales_tax_at_display_form = 3;
$sc_calculate_PSTsales_tax_at_process_form = 3;

$sc_calculate_extra_tax1_at_display_form = 3;
$sc_calculate_extra_tax1_at_process_form = 3;

$sc_calculate_extra_tax2_at_display_form = 3;
$sc_calculate_extra_tax2_at_process_form = 3;

$sc_calculate_extra_tax3_at_display_form = 3;
$sc_calculate_extra_tax3_at_process_form = 3;
#

# This may be used in Custom Shipping Logic, can be reset there
# to anything else if needs be
@sc_order_form_shipping_related_fields = ('Ecom_ShipTo_Method');

# Discount logic is the same as shipping logic except
# that whatever value is calculated for the discount will
# be subtracted rather than added to the grand total.

@sc_order_form_discount_related_fields = ('Ecom_Discount');

# The following variables tell the ordering part of the script how
# to calculate shipping, discount, and sales tax and in what order.
#
# The values are numerical (1,2,3) or 0 if we do not want to process
# anything.
#
# Variables that we do not calculate at a given time are given
# a value of ZERO (0) to show they never enter into
# the calculation.
#
# Otherwise, they are given an ORDER NUMBER 1, 2, or 3 to show
# in what order they are calculated.

if ($sc_calculate_discount_loop eq '' ||
    $sc_calculate_discount_loop < 0   ||
    $sc_calculate_discount_loop > 3   ) {
  $sc_calculate_discount_loop = 3;  # set the loop value to default
 }

$sc_calculate_discount_at_display_form = $sc_calculate_discount_loop;
$sc_calculate_discount_at_process_form = $sc_calculate_discount_loop;

$sc_pgp_temp_file_path = "$sc_user_carts_directory_path";

#######################################################################
#                     Store Option Variables                          #
#######################################################################
$sc_repeat_fake_it = 'yes'; # attempt to answer well on reload of "cart change"

# For Static HTML pages, if telling them item added ok, used sneak in msg.
# use the [[item_ordered_msg]] token for dynamic pages. Can enable if needed though:
$sc_allow_sneak_in_message = 'no';

$sc_shall_i_log_errors = 'yes';
$sc_shall_i_email_if_error = 'yes';
$sc_shall_i_let_client_know_item_added = 'yes';
#######################################################################
#                    HTML Search Variables                            #
#######################################################################
@sc_unwanted_files = ('*.cgi');

#######################################################################
#                  Miscellaneous Variables                            #
#######################################################################
$sc_processing_order = 'no'; # init this
@acceptable_file_extensions_to_display = ('.html', '.htm');
@sc_sales_tax_form_values = ("$sc_sales_tax_state");

# added by Mister Ed April 2006.
# limits the characters accepted from order forms.
# silently truncates at the max size
$sc_max_char_length = 2500;

#########################################################################
1;
