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

# Contains all sub routines (functions) for the store's layout and display settings manager.

# Fix for SuperCats module in category list builder - half was deleted.

#######################################################################
#
# 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) = 'misc_store_layout_display';
    register_extension( $modname, 'Layout and Design Settings: Misc',
        $versions{$modname} );
    add_merchtools_settings_choice(
        'Layout and Design Settings: Misc',
        'Layout & Design Settings: Misc',
        'change_store_layout_screen'
    );
    register_menu(
        'LayoutSettings', 'write_store_layout_settings',
        $modname,  'Write Store Layout Settings'
    );
    register_menu( 'change_store_layout_screen', 'display_store_layout_screen',
        $modname, 'Display Store Layout Settings' );
}

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

sub write_store_layout_settings {
    my ( $info, $thanks_info, $temp_page_thanks_layout2 );
    my ($myset, $myset2) = q{};
    my ($supercats) = q{./add_ons/supercats.pl};
    my ( @temp, $junk );

    if ( -e $supercats ) {
        $myset2 = "\$custom_sc_extended_menu_ff_css = \"$in{'custom_sc_extended_menu_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_categories_viewable = \"$in{'custom_sc_sub_categories_viewable'}\";\n";

        # To prevent IE from displaying squares instead of bullets or nonbreaking spaces
        # for indention characters, we will force litteral HTML friendly name substitution
        $myset2 .= "\$custom_sc_sub_category_1_indent = \"$custom_sc_sub_category_indent\";\n";
        #------------------------------------------------------------------------------------------------------------------
        $myset2 .= "\$custom_sc_sub_category_1_css_class = \"$in{'custom_sc_sub_category_css_class'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_2_css_class = \"$in{'custom_sc_sub_category_2_css_class'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_3_css_class = \"$in{'custom_sc_sub_category_3_css_class'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_4_css_class = \"$in{'custom_sc_sub_category_4_css_class'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_5_css_class = \"$in{'custom_sc_sub_category_5_css_class'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_1_end_html = \"$in{'custom_sc_sub_category_end_html'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_2_end_html = \"$in{'custom_sc_sub_category_2_end_html'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_3_end_html = \"$in{'custom_sc_sub_category_3_end_html'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_4_end_html = \"$in{'custom_sc_sub_category_4_end_html'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_5_end_html = \"$in{'custom_sc_sub_category_5_end_html'}\";\n";
        $myset2 .= "\$custom_sc_main_category_ff_css = \"$in{'custom_sc_main_category_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_1_ff_css = \"$in{'custom_sc_sub_category_1_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_2_ff_css = \"$in{'custom_sc_sub_category_2_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_3_ff_css = \"$in{'custom_sc_sub_category_3_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_4_ff_css = \"$in{'custom_sc_sub_category_4_ff_css'}\";\n";
        $myset2 .= "\$custom_sc_sub_category_5_ff_css = \"$in{'custom_sc_sub_category_5_ff_css'}\";\n";

        # keep this in case some one wants option of non-collapsible menu's in the future
        $myset2 .= "\$custom_sc_sub_categories_collapsible = \"$in{'custom_sc_sub_categories_collapsible'}\";\n";
        $myset = $myset2;
    }

    $myset .= "\$sc_use_html_product_pages = \"$in{'sc_use_html_product_pages'}\";\n";
    $myset .= "\$sc_use_category_name_as_header = \"$in{'sc_use_category_name_as_header'}\";\n";
    $myset .= "\$sc_use_category_name_as_ppinc_root = \"$in{'sc_use_category_name_as_ppinc_root'}\";\n";

    $myset .= "\$sc_skip_form_supplied_productname_ppinc_titles = \"$in{'sc_skip_form_supplied_productname_ppinc_titles'}\";\n";
    $myset .= "\$sc_db_max_rows_returned = \"$in{'sc_db_max_rows_returned'}\";\n";
    $myset .= "\$sc_max_product_description_chars = \"$in{'sc_max_product_description_chars'}\";\n";
    $myset .= "\$sc_default_qty_to_display = \"$in{'sc_default_qty_to_display'}\";\n"; # becomes [[qty]] in $sc_default_qty_box_html

    if ( $in{'sc_money_symbol'} =~ /euro/) {
        $myset .= "\$sc_money_symbol = q{&euro;};\n";
    }
    elsif ( $in{'sc_money_symbol'} =~ /pound/) {
        $myset .= "\$sc_money_symbol = q{&pound;};\n";
    }
    elsif ( $in{'sc_money_symbol'} =~ /dollarafter/) {
        $in{'sc_money_symbol'} =~ s/dollarafter//;
        $myset .= "\$sc_money_symbol = q{" . $in{'sc_money_symbol'} . "\$};\n";
    }
    elsif ( $in{'sc_money_symbol'} =~ /dollar/) {
        $myset .= "\$sc_money_symbol = q{\$};\n";
    }
    else  {
        $myset .= "\$sc_money_symbol = q{" . $in{'sc_money_symbol'} . "};\n";
    }
    $myset .= "\$sc_money_symbol_placement = \"$in{'sc_money_symbol_placement'}\";\n";
    $myset .= "\$sc_money_symbol_spaces = \"$in{'sc_money_symbol_spaces'}\";\n";
    $myset .= "\$store_currency_code = \"$in{'store_currency_code'}\";\n";
    $myset .= "\$sc_use_alt_next_display = \"$in{'sc_use_alt_next_display'}\";\n";
    $thanks_info = my_escape( $in{'layout_store_productpage_thanks_mess'} );
    $myset .= "\$layout_store_productpage_thanks_mess = qq~$thanks_info~;\n";
    $temp_page_thanks_layout2 = "$in{'layout_store_productpage_thanks_mess'}";
    my $temp_message = my_escape( $in{'sc_search_error_message'} );
    $myset .= "\$sc_search_error_message = qq~$temp_message~;\n";
    $myset .= "\$sc_item_ordered_message = \'$temp_page_thanks_layout2\';\n";
    $myset .= "\$sc_show_shipping_label_box = \"$in{'sc_show_shipping_label_box'}\";\n";
    $myset .= "\$sc_totals_table_ship_label = \"$in{'sc_totals_table_ship_label'}\";\n";
    $myset .= "\$sc_totals_table_disc_label = \"$in{'sc_totals_table_disc_label'}\";\n";
    $myset .= "\$sc_totals_table_stax_label = \"$in{'sc_totals_table_stax_label'}\";\n";
    $myset .= "\$sc_totals_table_GSTtax_label = \"$in{'sc_totals_table_GSTtax_label'}\";\n";
    $myset .= "\$sc_totals_table_PSTtax_label = \"$in{'sc_totals_table_PSTtax_label'}\";\n";
    $myset .= "\$sc_show_subtotal_label_box = \"$in{'sc_show_subtotal_label_box'}\";\n";
    $myset .= "\$sc_totals_table_subtot_label = \"$in{'sc_totals_table_subtot_label'}\";\n";
    $myset .= "\$sc_totals_table_gtot_label = \"$in{'sc_totals_table_gtot_label'}\";\n";
    $myset .= "\$sc_totals_table_itot_label = \"$in{'sc_totals_table_itot_label'}\";\n";
    $myset .= "\$sc_totals_table_thdr_label = \"$in{'sc_totals_table_thdr_label'}\";\n";
    $myset .= "\$sc_display_cartlinksite = \"$in{'sc_display_cartlinksite'}\";\n";
    $myset .= "\$sc_display_cartlinksite_url = \"$in{'sc_display_cartlinksite_url'}\";\n";
    $myset .= "\$sc_display_cartlinksite_name = \"$in{'sc_display_cartlinksite_name'}\";\n";
    $myset .= "\$sc_display_cartlinkhome = \"$in{'sc_display_cartlinkhome'}\";\n";
    $myset .= "\$sc_display_cartlinkhome_name = \"$in{'sc_display_cartlinkhome_name'}\";\n";
    $myset .= "\$sc_homesite_link_class = \"$in{'sc_homesite_link_class'}\";\n";
    $myset .= "\$sc_carthome_link_class = \"$in{'sc_carthome_link_class'}\";\n";
    $myset .= "\$sc_cartlink_page_link_class = \"$in{'sc_cartlink_page_link_class'}\";\n";

    $myset .= "\$custom_sc_main_category_css_class = \"$in{'custom_sc_main_category_css_class'}\";\n";
    $myset .= "\$custom_sc_sub_category_css_class = \"$in{'custom_sc_sub_category_css_class'}\";\n";
    $myset .= "\$mgr_skip_category_list_builder = \"$in{'mgr_skip_category_list_builder'}\";\n";
    my $temp_footer_text = my_escape( $in{'sc_footer_copyright_text'} );
    $myset .= "\$sc_footer_copyright_text = \"$temp_footer_text\";\n";

    update_store_settings( 'layout', $myset );    # layout settings

    $custom_sc_main_category_css_class = "$in{'custom_sc_main_category_css_class'}";
    $custom_sc_sub_category_css_class = "$in{'custom_sc_sub_category_css_class'}";

    category_list_builder_for_store();

    display_store_layout_screen();
}

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

sub display_store_layout_screen {

    print &$manager_page_header( 'Store Layout', '', '', '', '' );
    my ($supercats) = q{./add_ons/supercats.pl};

    if ( $sc_show_shipping_label_box eq '' ) {
        $sc_show_shipping_label_box = 'yes';
    }

    if ( $sc_show_subtotal_label_box eq '' ) {
        $sc_show_subtotal_label_box = 'no';
    }

    if ( $sc_totals_table_subtot_label eq '' ) {
        $sc_totals_table_subtot_label = 'Sub Total';
    }

    if ( $sc_footer_copyright_text eq '' ) {
        $sc_footer_copyright_text = '2001-2019 by K-Factor Technologies Inc.';
    }

    if ( $sc_use_alt_next_display eq '' ) {
        $sc_use_alt_next_display = 'No';
    }
     if ( $store_currency_code eq '' ) {
         $store_currency_code = 'USD';
     }

    if ( $sc_default_qty_to_display eq '' ) {
        $sc_default_qty_to_display = '1';
    }

    if ( $sc_max_product_description_chars eq '' ) {
        $sc_max_product_description_chars = '175';
    }

    if ( $sc_skip_form_supplied_productname_ppinc_titles eq '' ) {
        $sc_skip_form_supplied_productname_ppinc_titles = 'no';
    }

    if ( $mgr_skip_category_list_builder eq '' ) {
        $mgr_skip_category_list_builder = 'no';
    }

    if ( $sc_search_error_message eq '' ) {
        $sc_search_error_message =
          qq~I'm sorry, no matches were found. Please try your search again.~;
    }

    if ( $custom_sc_main_category_css_class eq '' ) {
        $custom_sc_main_category_css_class =  qq~agora_maincat_line~;
    }
    if ( $custom_sc_sub_category_css_class eq '' ) {
        $custom_sc_sub_category_css_class =  qq~agora_subcat_line~;
    }

    print <<ENDOFTEXT;
<h1 class='mgr-page-title'><b>Layout &amp; Design Settings - Misc</b></h1>

<br><br>
<p class="well">The Store Layout manager controls misc variables like messages, cart order table titles, and controls for cartlink pages.  To change store attributes like fonts, colors, widths and more; please see the <a href="manager.cgi?mgr_seshun=$in{'mgr_seshun'}&store_design_editor_screen=yes">CSS File Editor</a>. Use the tabs below to view each sub-section. You may change the settings within as many tabs/groups as needed, then press the <b><i>submit</i></b> button at the very bottom of the page after you are finished making any desired changes. Click on the <i class="fa fa-info-circle"></i> icon next to any setting for more information on the setting.</p>
<p><br></p>
ENDOFTEXT

    if ( $in{'system_edit_success'} ) {
        $page_output .= qq|
<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">Main/Core settings have been successfully updated</h4>
        <p class="mgr-center">Check/Edit each of your Gateway Settings <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&select_gateway_settings_screen=yes>here</a></p>
    </div>
</div>
<div class="row col-xs-12 col-sm-12"><p><br></p></div>

|;
    }

    print <<ENDOFTEXT;
<ul class="nav nav-tabs" id="tabs2" role="tablist">
    <li role="presentation" class="active"><a href="#tabs-1" aria-controls="tabs-1" role="tab" data-toggle="tab">Products &amp; Pages</a></li>
    <li role="presentation"><a href="#tabs-2" aria-controls="tabs-2" role="tab" data-toggle="tab">Order Table Display</a></li>
    <li role="presentation"><a href="#tabs-3" aria-controls="tabs-3" role="tab" data-toggle="tab">Static Page Links (cartlinks)</a></li>
    <li role="presentation"><a href="#tabs-4" aria-controls="tabs-4" role="tab" data-toggle="tab">Product Category List</a></li>
    <li role="presentation"><a href="#tabs-5" aria-controls="tabs-5" role="tab" data-toggle="tab">Misc Cart Messages</a></li>
</ul>


<form class="form-horizontal" action="manager.cgi" method="post">
<input type="hidden" name="mgr_seshun" value="$in{'mgr_seshun'}">
<div class="tab-content">

<div class="tab-pane active" id="tabs-1">

<p><br></p>
<h2 class="mgr-page-title"><b>Dynamic Product Viewing &amp; Page Layout</b></h2>
<p><br></p>

<p class="well">New Feature in Route 66 version: You may select the Product Page templates/layout files for each individual product category in the <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&edit_catdescription=yes><b>Category: Product Page Template &amp; SEO MetaTags</b></a> manager. Otherwise the default productPage.inc file will be used.</p>
<p><br></p>


<p><b>Use Category Name for Header/Footer Includes? &nbsp; <a data-toggle="collapse" href="#categoryHeadersFooters" aria-expanded="false" aria-controls="categoryHeadersFooters"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_category_name_as_header">
<option>$sc_use_category_name_as_header</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="categoryHeadersFooters">
     <div class="well">
         <p>Default is YES which allows you to create and use headers and/or footers for each individual category of products being viewed. Setting to NO disables this feature. </p>
         <p><b>Example</b>: if you have a category named BOOKS (as listed in product database) and you want to have a custom header ( but still use the standard store footer ) in that category in such a fashion that is different from the standard store header, then you would create a file called header-BOOKS.inc ( prepend with header-, then the category name - case sensitive, and appended with the .inc which stands for "include".  Category specific footers would be similar in naming convention, but using footer prepended to name instead of header: footer-BOOKS.inc ).</p>
         <p>Repeat for every product category you wish to be different from the standard store header ( named: store_header.inc ) or the standard store footer (named: store_footer.inc).</p>
         <p>Any custom header or footer files would go into the store's "" sub-directory.</p>
         <p><b>You do not need custom headers or footers for every category name</b> as the store-wide headers and footers will be used by automatically for all categories without any custom files installed, but when custom versions are put into the store's "$sc_hedfut_templates_dir" sub-directory, then they will be automatically used for the specific product category the next time that any product or list of products from that specific category is viewed by a visitor.</p>
         <p>You can use either a header or a footer or both as long as they match up layout wise., such as matching HTML DIV tags.</p>
         <p><b>Speed Enhancement:</b> Your store will run faster with this set to NO, especially in stores that are busy and/or have numerous product categories.</p>
     </div>
</div>
<p><hr></p>

<p><b>Use Category Name as ppinc Root? &nbsp; <a data-toggle="collapse" href="#categoryPageLayout" aria-expanded="false" aria-controls="categoryPageLayout"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_category_name_as_ppinc_root">
<option>$sc_use_category_name_as_ppinc_root</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="categoryPageLayout">
     <div class="well">
         <p>New Feature in Route 66 version: You may select the Product Page templates/layout files for each individual product category in the <a href=manager.cgi?mgr_seshun=$in{'mgr_seshun'}&edit_catdescription=yes><b>Product Page Template &amp; SEO MetaTags</b></a> manager. This allows you to set this setting to NO and save a little processing time.</p>
         <p>Default is YES which allows you to create and drop in product page layouts based on the category name of products being viewed. Setting to NO disables this feature.</p>
         <p><b>Example</b>: if you have a category named BOOKS (as listed in product database) and you want to layout products in that category in such a fashion that is different from the main product layout, then you would create a file called BOOKS.inc (must be exactly like category name as listed in product database - is case sensitive, and appended with the .inc which stands for "include)".</p>
         <p>Repeat for every product category you wish to be different from the main product layout (main layout file is named: productPage.inc).</p>
         <p>Any custom product page layout files go into the store's "$sc_product_layouts_dir" sub-directory..</p>
         <p><b>You do not need custom product page layouts for every category name</b> as the store-wide product page layout ( productPage.inc ) will be used by automatically for all categories without any custom files installed, but when custom versions are put into the store's "$sc_product_layouts_dir" sub-directory, then they will be automatically used for the specific product category the next time that any product or list of products from that specific category is viewed by a visitor.</p>
         <p>Unless you have a good reason to set this to no, it is recommended that you leave it set to YES.</p>
     </div>
</div>
<p><hr></p>

<p><b>Public Key to Add: &nbsp; <a data-toggle="collapse" href="#addToCartThanks" aria-expanded="false" aria-controls="addToCartThanks"><i class="fa fa-info-circle"></i></a></b><textarea name="layout_store_productpage_thanks_mess" class="form-control" rows="2" wrap=off>$layout_store_productpage_thanks_mess</textarea></p>
<div class="collapse" id="addToCartThanks">
     <div class="well">
         <p>This is the thank you message or message of choice that is shown after a visitor adds an item to the cart, if messages are included in the header or product page layouts, other wise it is not used.</p>
     </div>
</div>
<p><hr></p>

<p><b>How do you want to generate database-based HTML product pages? &nbsp; <a data-toggle="collapse" href="#productPageGeneration" aria-expanded="false" aria-controls="productPageGeneration"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="sc_use_html_product_pages">
<option>$sc_use_html_product_pages</option>
<option>yes</option>
<option>no</option>
<option>maybe</option>
</select></p>
<div class="collapse" id="productPageGeneration">
     <div class="well">
         <p>Default is "MAYBE" which allows you to generate database product pages unless a specific ppinc page is specified in the URL or by other means.</p>
         <p>"NO" will only allow you to generate dynamic pages from the products in the database.</p>
         <p>Use "YES" if running an HTML-based store and you are not using a product database ( Experimental ).</p>
         <p>NOTE: links to cart and database still need to come from the same domain name where your AgoraCart store operates.</p>
     </div>
</div>
<p><hr></p>

<p><b>Skip Page Titles from Generic Form Submits? &nbsp; <a data-toggle="collapse" href="#skipFormProvidedPPINCproductNameTitles" aria-expanded="false" aria-controls="skipFormProvidedPPINCproductNameTitles"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"><select name="sc_skip_form_supplied_productname_ppinc_titles">
<option>$sc_skip_form_supplied_productname_ppinc_titles</option>
<option>no</option>
<option>yes</option>
</select></p>
<div class="collapse" id="skipFormProvidedPPINCproductNameTitles">
     <div class="well">
         <p>Default: <b>no</b></p>
         <p>If you have a large number of legacy product category names in your database that you do not want to display as a page title, you can skip displaying the page title in those instances by setting this to <b>yes</b>.</p>
         <p>These types of page titles are generated when a form provides a "product" field with a category name, or a link has <b>&amp;product=</b> added to the URL for the cart.</p>
         <p>If you have the product category setup in the <b>Category: productpage &amp; SEO Metatags</b> manager, then the page title will use that information and this setting does not apply and the title will be displayed.</p>
         <p>This setting also does not apply when the following items are included in a form submit or added to the URL:  searchProdHeader, Keywords. If present, the page title will be displayed.</p>
     </div>
 </div>
 <p><hr></p>

<p><b>How many products to display per page ( Pagination ) ? &nbsp; <a data-toggle="collapse" href="#howManyProductsShown" aria-expanded="false" aria-controls="howManyProductsShown"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_db_max_rows_returned" type="number" value="$sc_db_max_rows_returned"></p>
<div class="collapse" id="howManyProductsShown">
     <div class="well">
         <p>This is the number of products that are shown on product category list pages and search results.</p>
         <p>"NO" will only allow you to generate dynamic pages from the products in the database.</p>
         <p>You may override this on individual links ( manually ) by setting the URL/Form variable maxp=nn in a URL like so: agoracgi?%%cart_id%%&maxp=27.</p>
         <p><b>Speed Enhancement:</b> Your store will run faster with this set to the smallest number possible.</p>
     </div>
</div>
<p><hr></p>

<p><b>Max Number of Characters for a Product Description: &nbsp; <a data-toggle="collapse" href="#maxProductDescription" aria-expanded="false" aria-controls="maxProductDescription"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_max_product_description_chars" type="number" width="3" maxlength="3" value="$sc_max_product_description_chars"></p>
<div class="collapse" id="maxProductDescription">
     <div class="well">
         <p>This setting allows you to control the amount of text shown on productPage layouts (per product listing) before it is truncated with an indicator that allows your visitor to click on the indictor to read more details.</p>
         <p>Controlling the number of characters also helps with design flow so that product listing display is more uniform with the same length of text.</p>
         <p>Default is: 175. We recommend to keep the limit below 500 characters unless you don't have very many product listings in your database.</p>
     </div>
 </div>
 <p><hr></p>

<p><b>Default Number presented in Product "Quantity-to-Add" Box? &nbsp; <a data-toggle="collapse" href="#defaultItemsToAdd" aria-expanded="false" aria-controls="defaultItemsToAdd"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><input name="sc_default_qty_to_display" type="number" value="$sc_default_qty_to_display"></p>
<div class="collapse" id="defaultItemsToAdd">
     <div class="well">
         <p>Default is 1.</p>
         <p>This is the default number displayed storewide in each product's QTY box as a convenience so that customers can add to their cart without typing a most common quantity.</p>
         <p><b>Speed Enhancement:</b> Your store will run faster with this set to the smallest number possible.</p>
     </div>
</div>
<p><hr></p>

<p><b>Monetary Symbol? &nbsp;</b><span style="padding-left: 25px;"></span><select name=sc_money_symbol>
<option>$sc_money_symbol</option>
<option value="dollar">\$</option>
<option value="pound">&pound;</option>
<option value="euro">&euro;</option>
<option value="dollarafterRD">RD\$</option>
<option value="dollarafterR">R\$</option>
<option value="dollarafterBZ">BZ\$</option>
<option value="dollarafterJ">J\$</option>
<option value="CHF">CHF</option>
<option value="kr">kr</option>
<option value="R">R</option>
</select><span style="padding-left: 25px;"></span><b>Position of Monetary Symbol? &nbsp;</b><span style="padding-left: 25px;"></span><select name=sc_money_symbol_placement>
<option>$sc_money_symbol_placement</option>
<option>front</option>
<option>back</option>
</select>
</p>
<p><br></p>

<p><b>Currency Code: &nbsp; <a data-toggle="collapse" href="#agCurrencyCode" aria-expanded="false" aria-controls="agCurrencyCode"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="store_currency_code">
<option>$store_currency_code</option>
<option value='USD'>USD - US Dollar</option>
<option value='CAD'>CAD - Canadian Dollar</option>
<option value='AUD'>AUD - Australian Dollar</option>
<option value='GBP'>GBP - British Pound</option>
<option value='BZD'>BZD	- Belize Dollar</option>
<option value='BRL'>BRL	- Brazil Real</option>
<option value='CNY'>CNY - Chinese Yuan Renminbi</option>
<option value='EUR'>EUR - Euro</option>
<option value='INR'>INR - Indian Rupee</option>
<option value='JPY'>JPY - Japanese Yen</option>
<option value='MYR'>MYR - Malaysian Ringgit</option>
<option value='MXN'>MXN - Mexico Peso</option>
<option value='NZD'>NZD	- New Zealand Dollar</option>
<option value='SGD'>SGD - Singapore Dollar</option>
<option value='CHF'>CHF - Swiss Franc</option>
</select></p></p>
<div class="collapse" id="agCurrencyCode">
    <div class="well">
          <p>Default: USD. If left blank, a default of USD will be used.</p>
          <p>use only a 3 character ISO 4217 compliant currency code.</p>
    </div>
</div>

<p><b>Set space/character between money symbol and numeric values: &nbsp;</b><span style="padding-left: 25px;"></span><input name="sc_money_symbol_spaces" type="text" size="2" maxlength="2" value="$sc_money_symbol_spaces">
</p>
<p><hr></p>

<p><b>Use alternate next/previous product tokens? &nbsp; <a data-toggle="collapse" href="#altPaginationTokens" aria-expanded="false" aria-controls="altPaginationTokens"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_use_alt_next_display>
<option>$sc_use_alt_next_display</option>
<option>No</option>
<option>yes</option>
</select></p>
<div class="collapse" id="altPaginationTokens">
     <div class="well">
         <p>Default is "NO".</p>
         <p>Allows you to disable the standard messages and place the %%alt_next%% token on your layouts to control the location of the "next/previous products" pagination statements..</p>
     </div>
</div>
<p><hr></p>
</div>

<!-- End of tab 1 -->


<div class="tab-pane" id="tabs-2">

<p><br></p>
<h2 class="mgr-page-title"><b>Order Table Display / Layout Section</b></h2>
<p><br></p>

<p class="well"><b>Enter the line-item labels for the Order Display Table below.</b><br>This table lists such things as shipping, subtotals, various sales/VAT taxes, discounts given, and the grand total. The order table contents can be seen on the "view cart" page and during the rest of the check out process.</p>
<p><br></p>

<p><b>Order Totals Table Header Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_thdr_label" type="text" size=20 maxlength="30" value="$sc_totals_table_thdr_label"></p>
<p><hr></p>

<p><b>Item Cost Subtotal Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_itot_label" type="text" size=20 maxlength="30" value="$sc_totals_table_itot_label"></p>
<p><hr></p>

<p><b>Display Shipping Label/Costs at View Cart and Checkout?</b><span style="padding-left: 25px;"></span><select name=sc_show_shipping_label_box>
<option>$sc_show_shipping_label_box</option>
<option>yes</option>
<option>no</option>
</select></p>
<p><br></p>

<p><b>Shipping Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_ship_label" type="text" size=20 maxlength="25" value="$sc_totals_table_ship_label"></p>
<p><hr></p>

<p><b>Discount Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_disc_label" type="text" size=20 maxlength="25" value="$sc_totals_table_disc_label"></p>
<p><hr></p>

<p><b>Sales Tax / VAT / HST Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_stax_label" type="text" size=20 maxlength="25" value="$sc_totals_table_stax_label"></p>
<p><hr></p>

<p><b class="text-primary">Following 2 fields are for CANADA based businesses only</b></p>
<p><br></p>
<p><b>GST Tax Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_GSTtax_label" type="text" size=20 maxlength="25" value="$sc_totals_table_GSTtax_label"></p>
<p><br></p>

<p><b>PST Tax Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_PSTtax_label" type="text" size=20 maxlength="25" value="$sc_totals_table_PSTtax_label"></p>
<p><hr></p>

<p><b>Grand Total Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_gtot_label" type="text" size=20 maxlength="25" value="$sc_totals_table_gtot_label"></p>
<p><hr></p>

<p><b>Display Sub Total label instead of Grand Total label? &nbsp; <a data-toggle="collapse" href="#switchTotalTitles" aria-expanded="false" aria-controls="switchTotalTitles"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_show_subtotal_label_box>
<option>$sc_show_subtotal_label_box</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="switchTotalTitles">
     <div class="well">
         <p>This will change the "Grand Total" title to a "Sub Total" title at the view cart page and at the checkout order form where information is entered by the customer. The "Grand Total" will then shown until the verify page right before payment is made.</p>
         <p>Set to "YES" if your customers are getting confused by the totals before real-time shipping and taxes are computed and making the actual payment.</p>
     </div>
</div>
<p><br></p>

<p><b>Sub Total Label:</b><span style="padding-left: 25px;"></span><input name="sc_totals_table_subtot_label" type="text" size=20 maxlength="25" value="$sc_totals_table_subtot_label"></p>
<p><br></p>

</div>

<!-- End of tab 2 -->



<div class="tab-pane" id="tabs-3">

<p><br></p>
<h2 class="mgr-page-title"><b>Static Page Links: CartLinks Section</b></h2>
<p><br></p>

<p class="well"><b>Enter Home and Store homepage links info below.</b><br>This is where you can designate if a home page link or a main store page with link will be created when using the cartlinks auto-linking options that build links inside widget for any static pages located within the "$sc_store_menu_pages_path" sub-directory. Those "cartlink" pages can be common pages like "about us", "shipping policies", "privacy policies", "refunds", and etc.
<br><br>The URL to your Home Page should be in the form of: www.yoursite.com or www.your-site.com/pagename.html (with or without the "www.").
<br><br><b>Do not</b> add the http:// or https:// portion to the URL as they are added by the script for the actual links created.
<br><br>"Name of links" are the Names shown on the web pages that you would click on to go to the Home Page or Main Store Page</p>
<p><br></p>

<p><b>Add Link to your Main Site's "Home Page"? &nbsp; <a data-toggle="collapse" href="#addHomePageLink" aria-expanded="false" aria-controls="addHomePageLink"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_display_cartlinksite><option selected>$sc_display_cartlinksite</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="addHomePageLink">
     <div class="well">
         <p>This is the home page for your web site if AgoraCart was not used to build your site, when AgoraCart is located in a sub-domain ( example: store.yoursite.com/agora.cgi ) or sub-directory of your site ( example: www.yoursite.com/store/agora.cgi )</p>
         <p><b>Examples:</b> http://www.yoursite.com or https://yoursite.com</p>
     </div>
</div>
<p><br></p>

<p><b>URL to your site's Home Page (include https:// or http://):</b><input name="sc_display_cartlinksite_url" type="text" class="form-control" maxlength="80" value="$sc_display_cartlinksite_url"></p>
<p><br></p>

<p><b>Name of link to your Site's Home Page:</b><span style="padding-left: 25px;"></span><input name="sc_display_cartlinksite_name" type="text" size=20 maxlength="35" value="$sc_display_cartlinksite_name"></p>
<p><br></p>

<p><b>CSS class attributes for your site's Home Page link:</b><span style="padding-left: 25px;"></span><input name="sc_homesite_link_class" type="text" class="form-control" maxlength="50" value="$sc_homesite_link_class"></p>
<p><hr></p>

<p><b>Add Link to your Store's "Main/Home Page" ? &nbsp; <a data-toggle="collapse" href="#addStoreHomeLink" aria-expanded="false" aria-controls="addStoreHomeLink"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name=sc_display_cartlinkhome>
<option selected>$sc_display_cartlinkhome</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="addStoreHomeLink">
     <div class="well">
         <p>This is the main/default/home page of the store when your first visits agora.cgi ( example: www.yoursite.com/store/agora.cgi )</p>
         <p><b>Example:</b> www.yoursite.com/store/agora.cgi )</p>
     </div>
</div>
<p><br></p>

<p><b>Name of link to your Store's Home Page:</b><span style="padding-left: 25px;"></span><input name="sc_display_cartlinkhome_name" type="text" size=20 maxlength="35" value="$sc_display_cartlinkhome_name"></p>
<p><br></p>

<p><b>CSS class attributes for your Store's Home Page link:</b><span style="padding-left: 25px;"></span><input name="sc_carthome_link_class" type="text" class="form-control" maxlength="50" value="$sc_carthome_link_class"></p>
<p><hr></p>

<p><b>CSS class attributes for your static page links (aka cartlinks) such as About Us, Terms of Service, etc:</b><span style="padding-left: 25px;"></span><input name="sc_cartlink_page_link_class" type="text" class="form-control" maxlength="50" value="$sc_cartlink_page_link_class"></p>
<p><br></p>

</div>

<!-- End of tab 3 -->



<div class="tab-pane" id="tabs-4">

<p><br></p>
<h2 class="mgr-page-title"><b>Product Category Layout / Formatting Section</b></h2>
<p><br></p>

<p class="well">This section allows you to update basic formatting used in the display of your category and sub-category links, which are used used in agorascript enabled headers or footers</p>
<p><br></p>

ENDOFTEXT

if ( -e $supercats ) {
    $mgr_main_cat_ident_pixels  =~ s/\[bullet\]/\&amp;bull\;/g;
    $mgr_main_cat_ident_pixels  =~ s/\&bull\;/\&amp;bull\;/g;
    $mgr_main_cat_ident_pixels  =~ s/\[nbsp\]| /\&amp;nbsp\;/g;
    $custom_sc_sub_category_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_1_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_2_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_3_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_4_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_5_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_6_indent  =~ s/\&nbsp\;| /\&amp\;nbsp\;/g;
    $custom_sc_sub_category_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_1_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_2_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_3_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_4_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_5_indent  =~ s/\&bull\;/\&amp;bull\;/g;
    $custom_sc_sub_category_6_indent  =~ s/\&bull\;/\&amp;bull\;/g;

    print <<ENDOFTEXT;
<p><b>Category Levels Viewable on Category Sidebar List: &nbsp; <a data-toggle="collapse" href="#catLevelsViewable" aria-expanded="false" aria-controls="catLevelsViewable"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="custom_sc_sub_categories_viewable">
<option>$custom_sc_sub_categories_viewable</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select></p>
<div class="collapse" id="catLevelsViewable">
     <div class="well">
         <p>Select how many category levels are viewable before main category index shift. If
         you set this to 4 and you have traveled down to the 5th level of subcats, the categories on the
         second level are shown as the main categories in the menu. It and all it's subcats take
         on all the attributes selected below, and you only see 3 levels of subcats displayed
         including the main category. The first category will not be viewable except in the extended menu.
         Setting this to more than 3 will most likely require you to create custom table restraints for the
         category table which these reside. Otherwise, long category names, limited table size with the addition
         of word wrapping will produce strange looking results. Using very short category names can help to offset this.</p>
     </div>
</div>
<p><hr></p>

<p><b>Collapsible Categories on Category Sidebar List: &nbsp; <a data-toggle="collapse" href="#collapseCatLists" aria-expanded="false" aria-controls="collapseCatLists"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="custom_sc_sub_categories_collapsible">
<option>$custom_sc_sub_categories_collapsible</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="collapseCatLists">
     <div class="well">
         <p>Default is "YES".</p>
         <p>Choosing "YES" allows only the category and sub-categries ( subcats )  that you navigate to be expanded. All others will remain collapsed, showing only the main categories, and all its subcats, relative to the current main category index.</p>
     </div>
</div>
<p><hr></p>

<p><b class="text-primary">Following 7 fields are for Indentation for each category name, set in number of pixels</b></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Each Main Product Category:</b><span style="padding-left: 25px;"></span><input name="mgr_main_cat_ident_pixels" type="number" size="3" maxlength="3" value="$mgr_main_cat_ident_pixels"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Product Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_1_indent"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Level 2 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_2_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_2_indent"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Level 3 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_3_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_3_indent"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Level 4 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_4_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_4_indent"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Level 5 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_5_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_5_indent"></p>
<p><br></p>

<p><b>Indent ( pixels ) at Beginning of Level 6 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_6_indent" type="number" size="3" maxlength="3" value="$custom_sc_sub_category_6_indent"></p>
<p><hr></p>

<p><b class="text-primary">Following 6 fields are for any HTML code to add to the END of each category or subcat name, such as a &lt;br&gt; tag.</b></p>
<p><br></p>

<p><b>HTML added to the end of each Main Product Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_main_category_end_html" type="text" size="6" maxlength="20" value="$custom_sc_main_category_end_html"></p>
<p><br></p>

<p><b>HTML added to the end of each Product Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_1_end_html" type="text" size="6" maxlength="20" value="$custom_sc_sub_category_1_end_html"></p>
<p><br></p>

<p><b>HTML added to the end of each Level 2 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_2_end_html" type="text" size="6" maxlength="20" value="$custom_sc_sub_category_2_end_html"></p>
<p><br></p>

<p><b>HTML added to the end of each Level 3 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_3_end_html" type="text" size="6" maxlength="20" value="$custom_sc_sub_category_3_end_html"></p>
<p><br></p>

<p><b>HTML added to the end of each Level 4 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_4_end_html" type="text" size="6" maxlength="20" value="$custom_sc_sub_category_4_end_html"></p>
<p><br></p>

<p><b>HTML added to the end of each Level 5 Sub-Category:</b><span style="padding-left: 25px;"></span><input name="custom_sc_sub_category_5_end_html" type="text" size="6" maxlength="20" value="$custom_sc_sub_category_5_end_html"></p>
<p><br></p>

ENDOFTEXT

}
else {

    print <<ENDOFTEXT;

<p><b>CSS Class Attribute Name for Main Product Categories:</b>
<input name="custom_sc_main_category_css_class" type="text" class="form-control" maxlength="40" value="$custom_sc_main_category_css_class"></p>
<p><br></p>

<p><b>CSS Class Attribute Name" for Product Sub-Categories:</b>
<input name="custom_sc_sub_category_css_class" type="text" class="form-control" maxlength="40" value="$custom_sc_sub_category_css_class"></p>
<p><hr></p>

<p><b>Skip Building Auto-Generated Category Lists &nbsp; <a data-toggle="collapse" href="#skipCatListBuilds" aria-expanded="false" aria-controls="skipCatListBuilds"><i class="fa fa-info-circle"></i></a></b><span style="padding-left: 25px;"></span><select name="mgr_skip_category_list_builder">
<option>$mgr_skip_category_list_builder</option>
<option>yes</option>
<option>no</option>
</select></p>
<div class="collapse" id="skipCatListBuilds">
     <div class="well">
         <p>Default is "NO".</p>
         <p>Choosing "YES" you to skip building the category lists used in sidebars that are automatically built everytime you add, edit, or delete products. If you have built your category lists manually, then this allows you to save time and resources, espeically if you have hundreds or thousands of categories.</p>
         <p>Note: if you skip building these lists, they will be empty and not available for use.</p>
     </div>
</div>
<p><hr></p>

ENDOFTEXT
}

    print <<ENDOFTEXT;

<p><br></p>
</div>

<!-- End of tab 4 -->


<div class="tab-pane" id="tabs-5">

<p><br></p>
<h2 class="mgr-page-title"><b>Misc Cart Messages</b></h2>
<p><br></p>

<p><b>Cart Search Error: &nbsp; <a data-toggle="collapse" href="#cartSearchError" aria-expanded="false" aria-controls="cartSearchError"><i class="fa fa-info-circle"></i></a></b><textarea name="sc_search_error_message" class="form-control" rows="4" wrap="soft">$sc_search_error_message</textarea></p>
<div class="collapse" id="cartSearchError">
     <div class="well">
         <p>No Results Found From Searches and/or in Product Categories.</p>
     </div>
</div>
<p><hr></p>

<p><b>Cart Footer Copyright Text: &nbsp; <a data-toggle="collapse" href="#footerCopyrightText" aria-expanded="false" aria-controls="footerCopyrightText"><i class="fa fa-info-circle"></i></a></b><textarea name="sc_footer_copyright_text" class="form-control" rows="2" wrap="soft">$sc_footer_copyright_text</textarea></p>
<div class="collapse" id="footerCopyrightText">
     <div class="well">
         <p>Used by default in the Copyright &copy; portion of official templates. May or may not be present in custom templates.</p>
     </div>
</div>
<p><br></p>

</div>

<!-- End of tab 5 -->

<p><br><br></p>
</div>

<input type="hidden" name="system_edit_success" value="yes">
<input name="LayoutSettings" type="hidden" value="Submit">
<button class="btn btn-primary btn-lg mgr-center" style="display: block;">Submit Layout Updates</button>
<p><br><br><br></p>

</form>
ENDOFTEXT
    print &$manager_page_footer;
}

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

1;
