$versions{'cart_display-ext_lib.pl'} = '06.6.00.0000';

# Contains all sub routines (functions) for the sore manager layout and dislay settings manager.

#######################################################################
#
# AgoraCart and all associated files, except where noted, are
# Copyright 2001 to Present jointly by K-Factor Technologies, Inc.
# and by C E Mayo (aka Mister Ed) at AgoraCart.com & K-Factor.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This copyright notice may not be removed or altered in any way.
#
#######################################################################

{
    local ($modname) = 'cart_display';
    register_extension( $modname, 'Cart Display Settings',
        $versions{$modname} );

    add_merchtools_settings_choice(
        'Cart Display',
        'Cart Contents - Displays/Emails',
        'change_cart_screen'
    );

    register_menu(
        'ConfigCART', 'write_cart_display_settings',
        $modname, 'Write Cart Display Settings'
    );

    register_menu(
        'change_cart_screen', 'display_cart_settings_screen',
        $modname, 'Display Cart Display Settings'
    );

}

#######################################################################

sub write_cart_display_settings {

    local ( $my_message, $my_ans );
    local ($other_cart_settings) = q{};
    local ($my_cols)  = q{};
    local ($my_str)     = q{};
    local ($myset)      = q{};
    local ($cart_settings) = "$mgr_user_settings_path";

$myset .= "\@sc_cart_index_for_display = ( \n";
$my_str  = "$in{'col_0_heading'}|";
$my_cols = "$in{'col_0_name'}|";
$my_fact = "$in{'col_0_factor'}|";
$my_form = "$in{'col_0_format'}|";
$myset .= "    \$cart\{\"$in{'col_0_name'}\"\} \n";

if ( $in{'col_1_name'} ) {
    $my_str  .= "$in{'col_1_heading'}|";
    $my_cols .= "$in{'col_1_name'}|";
    $my_fact .= "$in{'col_1_factor'}|";
    $my_form .= "$in{'col_1_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_1_name'}\"\} \n";
}
if ( $in{'col_2_name'} ) {
    $my_str  .= "$in{'col_2_heading'}|";
    $my_cols .= "$in{'col_2_name'}|";
    $my_fact .= "$in{'col_2_factor'}|";
    $my_form .= "$in{'col_2_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_2_name'}\"\} \n";
}
if ( $in{'col_3_name'} ) {
    $my_str  .= "$in{'col_3_heading'}|";
    $my_cols .= "$in{'col_3_name'}|";
    $my_fact .= "$in{'col_3_factor'}|";
    $my_form .= "$in{'col_3_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_3_name'}\"\} \n";
}
if ( $in{'col_4_name'} ) {
    $my_str  .= "$in{'col_4_heading'}|";
    $my_cols .= "$in{'col_4_name'}|";
    $my_fact .= "$in{'col_4_factor'}|";
    $my_form .= "$in{'col_4_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_4_name'}\"\} \n";
}
if ( $in{'col_5_name'} ) {
    $my_str  .= "$in{'col_5_heading'}|";
    $my_cols .= "$in{'col_5_name'}|";
    $my_fact .= "$in{'col_5_factor'}|";
    $my_form .= "$in{'col_5_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_5_name'}\"\} \n";
}
if ( $in{'col_6_name'} ) {
    $my_str  .= "$in{'col_6_heading'}|";
    $my_cols .= "$in{'col_6_name'}|";
    $my_fact .= "$in{'col_6_factor'}|";
    $my_form .= "$in{'col_6_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_6_name'}\"\} \n";
}
if ( $in{'col_7_name'} ) {
    $my_str  .= "$in{'col_7_heading'}|";
    $my_cols .= "$in{'col_7_name'}|";
    $my_fact .= "$in{'col_7_factor'}|";
    $my_form .= "$in{'col_7_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_7_name'}\"\} \n";
}
if ( $in{'col_8_name'} ) {
    $my_str  .= "$in{'col_8_heading'}|";
    $my_cols .= "$in{'col_8_name'}|";
    $my_fact .= "$in{'col_8_factor'}|";
    $my_form .= "$in{'col_8_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_8_name'}\"\} \n";
}
if ( $in{'col_9_name'} ) {
    $my_str  .= "$in{'col_9_heading'}|";
    $my_cols .= "$in{'col_9_name'}|";
    $my_fact .= "$in{'col_9_factor'}|";
    $my_form .= "$in{'col_9_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_9_name'}\"\} \n";
}

$myset .= "    );\n";
chop($my_str);
chop($my_cols);
chop($my_fact);
chop($my_form);
$myset .= "\$sc_cart_display_str = \'$my_str\';\n";
$myset .=
'@sc_cart_display_fields = split(/\|/,' . "\$sc_cart_display_str\);\n";
$myset .= "\$sc_cart_display_col = \'$my_cols\';\n";
$myset .= '@sc_col_name = split(/\|/,' . "\$sc_cart_display_col\);\n";
$myset .= "\$sc_cart_display_fact = \'$my_fact\';\n";
$myset .=
'@sc_cart_display_factor = split(/\|/,' . "\$sc_cart_display_fact\);\n";
$myset .= "\$sc_cart_display_form = \'$my_fact\';\n";
$myset .=
'@sc_cart_display_format = split(/\|/,' . "\$sc_cart_display_form\);\n";
$my_str  = "$in{'textcol_0_heading'}|";
$my_cols = "$in{'textcol_0_name'}|";
$my_fact = "$in{'textcol_0_factor'}|";
$my_form = "$in{'textcol_0_format'}|";
$myset .= "\@sc_textcart_index_for_display = ( \n";
$myset .= "    \$cart\{\"$in{'textcol_0_name'}\"\} \n";

if ( $in{'textcol_1_name'} ) {
    $my_str  .= "$in{'textcol_1_heading'}|";
    $my_cols .= "$in{'textcol_1_name'}|";
    $my_fact .= "$in{'textcol_1_factor'}|";
    $my_form .= "$in{'textcol_1_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_1_name'}\"\} \n";
}
if ( $in{'textcol_2_name'} ) {
    $my_str  .= "$in{'textcol_2_heading'}|";
    $my_cols .= "$in{'textcol_2_name'}|";
    $my_fact .= "$in{'textcol_2_factor'}|";
    $my_form .= "$in{'textcol_2_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_2_name'}\"\} \n";
}
if ( $in{'textcol_3_name'} ) {
    $my_str  .= "$in{'textcol_3_heading'}|";
    $my_cols .= "$in{'textcol_3_name'}|";
    $my_fact .= "$in{'textcol_3_factor'}|";
    $my_form .= "$in{'textcol_3_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_3_name'}\"\} \n";
}
if ( $in{'textcol_4_name'} ) {
    $my_str  .= "$in{'textcol_4_heading'}|";
    $my_cols .= "$in{'textcol_4_name'}|";
    $my_fact .= "$in{'textcol_4_factor'}|";
    $my_form .= "$in{'textcol_4_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_4_name'}\"\} \n";
}
if ( $in{'textcol_5_name'} ) {
    $my_str  .= "$in{'textcol_5_heading'}|";
    $my_cols .= "$in{'textcol_5_name'}|";
    $my_fact .= "$in{'textcol_5_factor'}|";
    $my_form .= "$in{'textcol_5_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_5_name'}\"\} \n";
}
if ( $in{'textcol_6_name'} ) {
    $my_str  .= "$in{'textcol_6_heading'}|";
    $my_cols .= "$in{'textcol_6_name'}|";
    $my_fact .= "$in{'textcol_6_factor'}|";
    $my_form .= "$in{'textcol_6_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_6_name'}\"\} \n";
}
if ( $in{'textcol_7_name'} ) {
    $my_str  .= "$in{'textcol_7_heading'}|";
    $my_cols .= "$in{'textcol_7_name'}|";
    $my_fact .= "$in{'textcol_7_factor'}|";
    $my_form .= "$in{'textcol_7_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'textcol_7_name'}\"\} \n";
}

$myset .= "    );\n";
chop($my_str);
chop($my_cols);
chop($my_fact);
chop($my_form);
$myset .= "\$sc_textcart_display_str = \'$my_str\';\n";
$myset .= '@sc_textcart_display_fields = split(/\|/,'
. "\$sc_textcart_display_str\);\n";
$myset .= "\$sc_textcart_display_col = \'$my_cols\';\n";
$myset .=
'@sc_textcol_name = split(/\|/,' . "\$sc_textcart_display_col\);\n";
$myset .= "\$sc_textcart_display_fact = \'$my_fact\';\n";
$myset .= '@sc_textcart_display_factor = split(/\|/,'
. "\$sc_textcart_display_fact\);\n";
$myset .= "\$sc_textcart_display_form = \'$my_form\';\n";
$myset .= '@sc_textcart_display_format = split(/\|/,'
. "\$sc_textcart_display_form\);\n";
# added by Mister Ed - March 15, 2012
$myset .= "\@sc_cart_thanks_index_for_display = ( \n";
$my_str  = "$in{'col_thanks_0_heading'}|";
$my_cols = "$in{'col_thanks_0_name'}|";
$my_fact = "$in{'col_thanks_0_factor'}|";
$my_form = "$in{'col_thanks_0_format'}|";
$myset .= "    \$cart\{\"$in{'col_thanks_0_name'}\"\} \n";

if ( $in{'col_thanks_1_name'} ) {
    $my_str  .= "$in{'col_thanks_1_heading'}|";
    $my_cols .= "$in{'col_thanks_1_name'}|";
    $my_fact .= "$in{'col_thanks_1_factor'}|";
    $my_form .= "$in{'col_thanks_1_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_1_name'}\"\} \n";
}
if ( $in{'col_thanks_2_name'} ) {
    $my_str  .= "$in{'col_thanks_2_heading'}|";
    $my_cols .= "$in{'col_thanks_2_name'}|";
    $my_fact .= "$in{'col_thanks_2_factor'}|";
    $my_form .= "$in{'col_thanks_2_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_2_name'}\"\} \n";
}
if ( $in{'col_thanks_3_name'} ) {
    $my_str  .= "$in{'col_thanks_3_heading'}|";
    $my_cols .= "$in{'col_thanks_3_name'}|";
    $my_fact .= "$in{'col_thanks_3_factor'}|";
    $my_form .= "$in{'col_thanks_3_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_3_name'}\"\} \n";
}
if ( $in{'col_thanks_4_name'} ) {
    $my_str  .= "$in{'col_thanks_4_heading'}|";
    $my_cols .= "$in{'col_thanks_4_name'}|";
    $my_fact .= "$in{'col_thanks_4_factor'}|";
    $my_form .= "$in{'col_thanks_4_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_4_name'}\"\} \n";
}
if ( $in{'col_thanks_5_name'} ) {
    $my_str  .= "$in{'col_thanks_5_heading'}|";
    $my_cols .= "$in{'col_thanks_5_name'}|";
    $my_fact .= "$in{'col_thanks_5_factor'}|";
    $my_form .= "$in{'col_thanks_5_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_5_name'}\"\} \n";
}
if ( $in{'col_thanks_6_name'} ) {
    $my_str  .= "$in{'col_thanks_6_heading'}|";
    $my_cols .= "$in{'col_thanks_6_name'}|";
    $my_fact .= "$in{'col_thanks_6_factor'}|";
    $my_form .= "$in{'col_thanks_6_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_6_name'}\"\} \n";
}
if ( $in{'col_thanks_7_name'} ) {
    $my_str  .= "$in{'col_thanks_7_heading'}|";
    $my_cols .= "$in{'col_thanks_7_name'}|";
    $my_fact .= "$in{'col_thanks_7_factor'}|";
    $my_form .= "$in{'col_thanks_7_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_7_name'}\"\} \n";
}
if ( $in{'col_thanks_8_name'} ) {
    $my_str  .= "$in{'col_thanks_8_heading'}|";
    $my_cols .= "$in{'col_thanks_8_name'}|";
    $my_fact .= "$in{'col_thanks_8_factor'}|";
    $my_form .= "$in{'col_thanks_8_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_8_name'}\"\} \n";
}
if ( $in{'col_thanks_9_name'} ) {
    $my_str  .= "$in{'col_thanks_9_heading'}|";
    $my_cols .= "$in{'col_thanks_9_name'}|";
    $my_fact .= "$in{'col_thanks_9_factor'}|";
    $my_form .= "$in{'col_thanks_9_format'}|";
    $myset   .= "    ,\$cart\{\"$in{'col_thanks_9_name'}\"\} \n";
}

$myset .= "    );\n";
chop($my_str);
chop($my_cols);
chop($my_fact);
chop($my_form);
$myset .= "\$sc_cart_thanks_display_str = \'$my_str\';\n";
$myset .=
'@sc_cart_thanks_display_fields = split(/\|/,' . "\$sc_cart_thanks_display_str\);\n";
$myset .= "\$sc_cart_thanks_display_col = \'$my_cols\';\n";
$myset .= '@sc_col_thanks_name = split(/\|/,' . "\$sc_cart_thanks_display_col\);\n";
$myset .= "\$sc_cart_thanks_display_fact = \'$my_fact\';\n";
$myset .=
'@sc_cart_thanks_display_factor = split(/\|/,' . "\$sc_cart_thanks_display_fact\);\n";
$myset .= "\$sc_cart_thanks_display_form = \'$my_fact\';\n";
$myset .=
'@sc_cart_thanks_display_format = split(/\|/,' . "\$sc_cart_thanks_display_form\);\n";

codehook( 'other_cart_settings' );

if ( $other_cart_settings ) {
    $myset .= "$other_cart_settings\n";
}

$myset = "sub init_cart_settings {\n" . $myset . "}\n";
$myset .= 'if ($main_program_running =~ /yes/i) {' . "\n";
$myset .=
'add_codehook("after_loading_setup_db","init_cart_settings");' . "\n";
$myset .= '} else { ' . "\n";
$myset .= 'init_cart_settings();' . "\n";
$myset .= '}' . "\n";

update_store_settings( 'cart', $myset );
display_cart_settings_screen();

}

#######################################################################

sub display_cart_settings_screen {

    print &$manager_page_header( 'Cart Display', '', '', '', '' );

    print <<ENDOFTEXT;
<h1 class='mgr-page-title'>Cart Contents Display</h1>
<p><br></p>

<p class="well">This area allows you to determine how AgoraCart displays a customer's cart contents, both on the screen and log file/confirming emails. Choose the columns to be displayed and enter the text for the heading for each cart column.
<br><br>Note: due to legacy, some of the labels are a bit misleading, "product" is actually the product category.</p>
<p><br></p>
ENDOFTEXT

    if ( $in{'system_edit_success'} ) {
        print <<ENDOFTEXT;
<div class="row col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 bg-success">
        <h4 class="text-primary mgr-center">Cart Display settings have been successfully updated</h4>
        </div>
    </div>
<div class="row col-xs-12 col-sm-12"><p><br></p></div>
ENDOFTEXT
    }

    $format_options = '<option>none</option>' . "\n"
        . '<option>2-D Price</option>' . "\n"
        . '<option>2-Decimal</option>' . "\n" . '';
    $my_options = q{};

    foreach $inx ( sort( keys %cart ) ) {
        $my_options .= "<option>$inx</option>\n";
    }

    for ( $inx = 0 ; $inx <= 8 ; $inx++ ) {
        if (   ( $sc_col_name[$inx] ne "" )
        && ( $sc_cart_display_factor[$inx] eq '' ) ) {
            $sc_cart_display_factor[$inx] = 'no';
        }
    }

    for ( $inx = 0 ; $inx <= 6 ; $inx++ ) {
        if ( ( $sc_textcol_name[$inx] )
        && ( $sc_textcart_display_factor[$inx] eq '' ) ) {
            $sc_textcart_display_factor[$inx] = 'no';
        }
        if ( ( $sc_textcol_name[$inx] ne '' )
        && ( $sc_textcart_display_format[$inx] eq '' ) ) {
            $sc_textcart_display_format[$inx] = 'none';
        }
    }

    for ( $inx = 0 ; $inx <= 8 ; $inx++ ) {
        if (   ( $sc_col_thanks_name[$inx] ne '' )
        && ( $sc_cart_thanks_display_factor[$inx] eq '' ) ) {
            $sc_cart_thanks_display_factor[$inx] = 'no';
        }
    }

    print <<ENDOFTEXT;
<h3 class='mgr-page-title'>CART CONTENTS - SCREEN DISPLAY</h3>
<p><br></p>

<p class="well">Any "options" selection in this section can be used to display an item's options in the cart contents display. NO HEADING TITLE NEEDED.</p>
<p><br></p>


<form action="manager.cgi" method="post">
<input type="hidden" name="mgr_seshun" value="$in{'mgr_seshun'}">


<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
<tr>
<td><b>What to Print</b></td>
<td><b>Multiply by QTY?</b></td>
<td><b>Column Heading</b></td>
</tr>
<tr>
<td>
<select name="col_0_name">
<option>$sc_col_name[0]</option>
$my_options
</select>
</td>
<td>
<select name="col_0_factor">
<option>$sc_cart_display_factor[0]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_0_heading" type="text" size=25
value="$sc_cart_display_fields[0]">
</td>
</tr>
<tr>
<td>
<select name="col_1_name">
<option>$sc_col_name[1]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_1_factor">
<option>$sc_cart_display_factor[1]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_1_heading" type="text" size=25
value="$sc_cart_display_fields[1]">
</td>
</tr>
<tr>
<td>
<select name="col_2_name">
<option>$sc_col_name[2]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_2_factor">
<option>$sc_cart_display_factor[2]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_2_heading" type="text" size=25
value="$sc_cart_display_fields[2]">
</td>
</tr>
<tr>
<td>
<select name="col_3_name">
<option>$sc_col_name[3]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_3_factor">
<option>$sc_cart_display_factor[3]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_3_heading" type="text" size=25
value="$sc_cart_display_fields[3]">
</td>
</tr>
<tr>
<td>
<select name="col_4_name">
<option>$sc_col_name[4]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_4_factor">
<option>$sc_cart_display_factor[4]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_4_heading" type="text" size=25
value="$sc_cart_display_fields[4]">
</td>
</tr>
<tr>
<td>
<select name="col_5_name">
<option>$sc_col_name[5]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_5_factor">
<option>$sc_cart_display_factor[5]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_5_heading" type="text" size=25
value="$sc_cart_display_fields[5]">
</td>
</tr>
<tr>
<td>
<select name="col_6_name">
<option>$sc_col_name[6]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_6_factor">
<option>$sc_cart_display_factor[6]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_6_heading" type="text" size=25
value="$sc_cart_display_fields[6]">
</td>
</tr>
<tr>
<td>
<select name="col_7_name">
<option>$sc_col_name[7]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_7_factor">
<option>$sc_cart_display_factor[7]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_7_heading" type="text" size=25
value="$sc_cart_display_fields[7]">
</td>
</tr>
<tr>
<td>
<select name="col_8_name">
<option>$sc_col_name[8]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_8_factor">
<option>$sc_cart_display_factor[8]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_8_heading" type="text" size=25
value="$sc_cart_display_fields[8]">
</td>
</tr>
</table></div>


<h3 class='mgr-page-title'>CART ITEMS - TEXT SETTINGS</h3>
<p><br></p>

<p class="well">Define the extra fields printed in the "text" version of the cart contents for each item ordered
(order log and confirming emails):</p>
<p><br></p>

<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
<tr>
<td><b>What to Print</b></td>
<td><b>Multiply by QTY?</b></td>
<td><b>Special Formatting</b></td>
<td><b>Label to give it</b> (Max. 13 chars printed!)</td>
</tr>
<tr>
<td>
<select name="textcol_0_name">
<option>$sc_textcol_name[0]</option>
$my_options
</select>
</td>
<td>
<select name="textcol_0_factor">
<option>$sc_textcart_display_factor[0]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_0_format">
<option>$sc_textcart_display_format[0]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_0_heading" type="text" size=25
value="$sc_textcart_display_fields[0]">
</td>
</tr>
<tr>
<td>
<select name="textcol_1_name">
<option>$sc_textcol_name[1]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_1_factor">
<option>$sc_textcart_display_factor[1]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_1_format">
<option>$sc_textcart_display_format[1]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_1_heading" type="text" size=25
value="$sc_textcart_display_fields[1]">
</td>
</tr>
<tr>
<td>
<select name="textcol_2_name">
<option>$sc_textcol_name[2]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_2_factor">
<option>$sc_textcart_display_factor[2]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_2_format">
<option>$sc_textcart_display_format[2]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_2_heading" type="text" size=25
value="$sc_textcart_display_fields[2]">
</td>
</tr>
<tr>
<td>
<select name="textcol_3_name">
<option>$sc_textcol_name[3]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_3_factor">
<option>$sc_textcart_display_factor[3]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_3_format">
<option>$sc_textcart_display_format[3]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_3_heading" type="text" size=25
value="$sc_textcart_display_fields[3]">
</td>
</tr>
<tr>
<td>
<select name="textcol_4_name">
<option>$sc_textcol_name[4]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_4_factor">
<option>$sc_textcart_display_factor[4]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_4_format">
<option>$sc_textcart_display_format[4]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_4_heading" type="text" size=25
value="$sc_textcart_display_fields[4]">
</td>
</tr>
<tr>
<td>
<select name="textcol_5_name">
<option>$sc_textcol_name[5]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_5_factor">
<option>$sc_textcart_display_factor[5]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_5_format">
<option>$sc_textcart_display_format[5]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_5_heading" type="text" size=25
value="$sc_textcart_display_fields[5]">
</td>
</tr>
<tr>
<td>
<select name="textcol_6_name">
<option>$sc_textcol_name[6]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_6_factor">
<option>$sc_textcart_display_factor[6]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_6_format">
<option>$sc_textcart_display_format[6]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_6_heading" type="text" size=25
value="$sc_textcart_display_fields[6]">
</td>
</tr>
<tr>
<td>
<select name="textcol_7_name">
<option>$sc_textcol_name[7]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="textcol_7_factor">
<option>$sc_textcart_display_factor[7]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<select name="textcol_7_format">
<option>$sc_textcart_display_format[7]</option>
$format_options
</select>
</td>
<td>
<input name="textcol_7_heading" type="text" size=25
value="$sc_textcart_display_fields[7]">
</td>
</tr>
</table></div>


<h3 class='mgr-page-title'>CART CONTENTS - THANK YOU PAGE DISPLAY</h3>
<p><br></p>

<p class="well">Any "options" selection in this section can be used to display an item's options in the cart contents display on the thank you page after payment is completed. NO HEADING TITLE NEEDED.</p>
<p><br></p>

<div class="table-responsive">
<table class="table table-striped table-bordered table-condensed">
<tr>
<td><b>What to Print</b></td>
<td><b>Multiply by QTY?</b></td>
<td><b>Column Heading</b></td>
</tr>
<tr>
<td>
<select name="col_thanks_0_name">
<option>$sc_col_thanks_name[0]</option>
$my_options
</select>
</td>
<td>
<select name="col_thanks_0_factor">
<option>$sc_cart_thanks_display_factor[0]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_0_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[0]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_1_name">
<option>$sc_col_thanks_name[1]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_1_factor">
<option>$sc_cart_thanks_display_factor[1]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_1_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[1]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_2_name">
<option>$sc_col_thanks_name[2]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_2_factor">
<option>$sc_cart_thanks_display_factor[2]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_2_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[2]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_3_name">
<option>$sc_col_thanks_name[3]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_3_factor">
<option>$sc_cart_thanks_display_factor[3]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_3_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[3]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_4_name">
<option>$sc_col_thanks_name[4]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_4_factor">
<option>$sc_cart_thanks_display_factor[4]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_4_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[4]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_5_name">
<option>$sc_col_thanks_name[5]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_5_factor">
<option>$sc_cart_thanks_display_factor[5]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_5_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[5]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_6_name">
<option>$sc_col_thanks_name[6]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_6_factor">
<option>$sc_cart_thanks_display_factor[6]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_6_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[6]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_7_name">
<option>$sc_col_thanks_name[7]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_7_factor">
<option>$sc_cart_thanks_display_factor[7]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_7_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[7]">
</td>
</tr>
<tr>
<td>
<select name="col_thanks_8_name">
<option>$sc_col_thanks_name[8]</option>
$my_options
<option value="">BLANK</option>
</select>
</td>
<td>
<select name="col_thanks_8_factor">
<option>$sc_cart_thanks_display_factor[8]</option>
<option>yes</option>
<option>no</option>
</select>
</td>
<td>
<input name="col_thanks_8_heading" type="text" size=25
value="$sc_cart_thanks_display_fields[8]">
</td>
</tr>
</table></div>
<p><br></p>

<input type="hidden" name="system_edit_success" value="yes">
<input name="ConfigCART" type="hidden" value="Submit">
<button class="btn btn-primary btn-lg btn-block mgr-center">Submit Cart Contents/Layout Changes</button>

</form>
<div class="row col-sm-12"><p><br><br><br></p></div>
ENDOFTEXT

    print &$manager_page_footer;

}

#######################################################################

1;
