Пример #1
0
    public function display()
    {
        global $wpdb;
        ?>
		<h3><?php 
        echo esc_html_e('General Settings', 'wpsc');
        ?>
</h3>
		<table class='wpsc_options form-table'>
			<tr>
				<th scope="row"><label for="wpsc-base-country-drop-down"><?php 
        esc_html_e('Base Country/Region', 'wpsc');
        ?>
</label></th>
				<td>
					<?php 
        wpsc_country_dropdown(array('id' => 'wpsc-base-country-drop-down', 'name' => 'wpsc_options[base_country]', 'selected' => get_option('base_country'), 'include_invisible' => true));
        ?>
					<span id='wpsc-base-region-drop-down'>
						<?php 
        $this->display_region_drop_down();
        ?>
						<img src="<?php 
        echo esc_url(wpsc_get_ajax_spinner());
        ?>
" class="ajax-feedback" title="" alt="" />
					</span>
					<p class='description'><?php 
        esc_html_e('Select your primary business location.', 'wpsc');
        ?>
</p>
				</td>
			</tr>

			<?php 
        /* START OF TARGET MARKET SELECTION */
        $countrylist = WPSC_Countries::get_countries_array(true, true);
        ?>
			<tr>
				<th scope="row">
					<?php 
        esc_html_e('Target Markets', 'wpsc');
        ?>
				</th>
				<td>
					<?php 
        // check for the suhosin module
        if (wpsc_is_suhosin_enabled()) {
            echo "<em>" . __("The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature then disable the suhosin extension, if you can not do this, you will need to contact your hosting provider.", 'wpsc') . "</em>";
        } else {
            ?>
							<span>
								<?php 
            printf(__('Select: <a href="%1$s"  class="wpsc-select-all" title="All">All</a> <a href="%2$s" class="wpsc-select-none" title="None">None</a>', 'wpsc'), esc_url(add_query_arg(array('selected_all' => 'all'))), esc_url(add_query_arg(array('selected_all' => 'none'))));
            ?>
							</span><br />
							<div id='wpsc-target-markets' class='ui-widget-content multiple-select'>
								<?php 
            foreach ((array) $countrylist as $country) {
                ?>
									<?php 
                if ($country['visible'] == 1) {
                    ?>
										<input type='checkbox' id="countrylist2-<?php 
                    echo $country['id'];
                    ?>
" name='countrylist2[]' value='<?php 
                    echo $country['id'];
                    ?>
' checked='checked' />
										<label for="countrylist2-<?php 
                    echo $country['id'];
                    ?>
"><?php 
                    esc_html_e($country['country']);
                    ?>
</label><br />
									<?php 
                } else {
                    ?>
										<input type='checkbox' id="countrylist2-<?php 
                    echo $country['id'];
                    ?>
" name='countrylist2[]' value='<?php 
                    echo $country['id'];
                    ?>
'  />
										<label for="countrylist2-<?php 
                    echo $country['id'];
                    ?>
"><?php 
                    esc_html_e($country['country']);
                    ?>
</label><br />
									<?php 
                }
                ?>
								<?php 
            }
            ?>
							</div>

							<p class='description'><?php 
            esc_html_e('Select the markets you are selling products to.', 'wpsc');
            ?>
</p>
							<?php 
        }
        ?>
				</td>
			</tr>

			<?php 
        $stock_keeping_time = wpsc_get_stock_keeping_time();
        $stock_keeping_interval = wpsc_get_stock_keeping_interval();
        ?>
			<tr>
				<th scope="row">
					<label for="wpsc-stock-keeping-time"><?php 
        esc_html_e('Keep stock in cart for', 'wpsc');
        ?>
</label>
				</th>
				<td>
					<input type="text" name="wpsc_options[wpsc_stock_keeping_time]" id="wpsc-stock-keeping-time" size="2" value="<?php 
        echo esc_attr($stock_keeping_time);
        ?>
" />
					<select name="wpsc_options[wpsc_stock_keeping_interval]">
						<option value="hour" <?php 
        selected('hour', $stock_keeping_interval);
        ?>
><?php 
        echo _n('hour', 'hours', $stock_keeping_time, 'wpsc');
        ?>
</option>
						<option value="day" <?php 
        selected('day', $stock_keeping_interval);
        ?>
><?php 
        echo _n('day', 'days', $stock_keeping_time, 'wpsc');
        ?>
</option>
						<option value="week" <?php 
        selected('week', $stock_keeping_interval);
        ?>
><?php 
        echo _n('week', 'weeks', $stock_keeping_time, 'wpsc');
        ?>
</option>
					</select>
					<p class='description'><?php 
        esc_html_e("Set the amount of time items in a customer's cart are reserved. You can also specify decimal amounts such as '0.5 days' or '1.25 weeks'. Note that the minimum interval you can enter is 1 hour, i.e. you can't schedule it to run every 0.5 hour.", 'wpsc');
        ?>
</p>
				</td>
			</tr>

			<?php 
        $hierarchical_category = get_option('product_category_hierarchical_url', 0);
        ?>
			<tr>
				<th scope="row">
					<?php 
        _e('Use Hierarchical Product Category URL', 'wpsc');
        ?>
				</th>
				<td>
					<label><input type="radio" <?php 
        checked($hierarchical_category, 1);
        ?>
 name="wpsc_options[product_category_hierarchical_url]" value="1" /> <?php 
        _e('Yes', 'wpsc');
        ?>
</label>&nbsp;&nbsp;
					<label><input type="radio" <?php 
        checked($hierarchical_category, 0);
        ?>
name="wpsc_options[product_category_hierarchical_url]" value="0" /> <?php 
        _e('No', 'wpsc');
        ?>
</label><br />
					<p class='description'><?php 
        _e('When Hierarchical Product Category URL is enabled, parent product categories are also included in the product URL.<br />For example: <code>http://example.com/products-page/parent-cat/sub-cat/product-name</code>', 'wpsc');
        ?>
</p>
				</td>
			</tr>
		</table>

		<h3 class="form_group"><?php 
        esc_html_e('Currency Settings', 'wpsc');
        ?>
</h3>
		<table class='wpsc_options form-table'>
			<?php 
        $currency_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY `country` ASC", ARRAY_A);
        $currency_type = esc_attr(get_option('currency_type'));
        ?>
			<tr>
				<th scope="row"><label for="wpsc_options_currency_type"><?php 
        esc_html_e('Currency Type', 'wpsc');
        ?>
</label></th>
				<td>
					<select id="wpsc_options_currency_type" name='wpsc_options[currency_type]' onchange='getcurrency(this.options[this.selectedIndex].value);'>
					<?php 
        foreach ($currency_data as $currency) {
            ?>
						<option value='<?php 
            echo $currency['id'];
            ?>
' <?php 
            selected($currency['id'], $currency_type);
            ?>
><?php 
            esc_html_e($currency['country']);
            ?>
 (<?php 
            echo $currency['currency'];
            ?>
)</option>
					<?php 
        }
        ?>
					</select>
				</td>
			</tr>

			<?php 
        $currency_data = $wpdb->get_row("SELECT `symbol`,`symbol_html`,`code` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `id`='" . esc_attr(get_option('currency_type')) . "' LIMIT 1", ARRAY_A);
        if ($currency_data['symbol'] != '') {
            $currency_sign = esc_attr($currency_data['symbol_html']);
        } else {
            $currency_sign = esc_attr($currency_data['code']);
        }
        $currency_sign_location = esc_attr(get_option('currency_sign_location'));
        $csl1 = "";
        $csl2 = "";
        $csl3 = "";
        $csl4 = "";
        switch ($currency_sign_location) {
            case 1:
                $csl1 = "checked='checked'";
                break;
            case 2:
                $csl2 = "checked='checked'";
                break;
            case 3:
                $csl3 = "checked='checked'";
                break;
            case 4:
                $csl4 = "checked='checked'";
                break;
        }
        ?>
			<tr>
				<th scope="row"><?php 
        esc_html_e('Currency Sign Location', 'wpsc');
        ?>
</th>
				<td>
					<input type='radio' value='1' name='wpsc_options[currency_sign_location]' id='csl1' <?php 
        echo $csl1;
        ?>
 />
					<label for='csl1'><?php 
        _ex('100', 'Currency sign location - option 1', 'wpsc');
        ?>
<span id='cslchar1'><?php 
        echo $currency_sign;
        ?>
</span></label> &nbsp;
					<input type='radio' value='2' name='wpsc_options[currency_sign_location]' id='csl2' <?php 
        echo $csl2;
        ?>
 />
					<label for='csl2'><?php 
        _ex('100', 'Currency sign location - option 2', 'wpsc');
        ?>
 <span id='cslchar2'><?php 
        echo $currency_sign;
        ?>
</span></label> &nbsp;
					<input type='radio' value='3' name='wpsc_options[currency_sign_location]' id='csl3' <?php 
        echo $csl3;
        ?>
 />
					<label for='csl3'><span id='cslchar3'><?php 
        echo $currency_sign;
        ?>
</span><?php 
        _ex('100', 'Currency sign location - option 3', 'wpsc');
        ?>
</label> &nbsp;
					<input type='radio' value='4' name='wpsc_options[currency_sign_location]' id='csl4' <?php 
        echo $csl4;
        ?>
 />
					<label for='csl4'><span id='cslchar4'><?php 
        echo $currency_sign;
        ?>
</span> <?php 
        _ex('100', 'Currency sign location - option 4', 'wpsc');
        ?>
</label>
				</td>
			</tr>
			<tr>
				<th scope="row"><?php 
        esc_html_e('Thousands and decimal separators', 'wpsc');
        ?>
</th>
				<td>
					<label for="wpsc_options_wpsc_thousands_separator"><?php 
        esc_html_e('Thousands separator', 'wpsc');
        ?>
</label>: <input name="wpsc_options[wpsc_thousands_separator]" id="wpsc_options_wpsc_thousands_separator" type="text" maxlength="1" size="1" value="<?php 
        echo esc_attr(get_option('wpsc_thousands_separator'));
        ?>
" /><br />
					<label for="wpsc_options_wpsc_decimal_separator"><?php 
        esc_html_e('Decimal separator', 'wpsc');
        ?>
</label>: <input name="wpsc_options[wpsc_decimal_separator]" id="wpsc_options_wpsc_decimal_separator" type="text" maxlength="1" size="1" value="<?php 
        echo esc_attr(get_option('wpsc_decimal_separator'));
        ?>
" /><br />
					<?php 
        esc_html_e('Preview:', 'wpsc');
        ?>
 10<?php 
        echo esc_attr(get_option('wpsc_thousands_separator'));
        ?>
000<?php 
        echo esc_attr(get_option('wpsc_decimal_separator'));
        ?>
00
				</td>
			</tr>
		</table>
		<?php 
    }
function wpsc_admin_category_forms_edit()
{
    global $wpdb;
    $category_value_count = 0;
    $category_name = '';
    $category = array();
    $category_id = absint($_REQUEST["tag_ID"]);
    $category = get_term($category_id, 'wpsc_product_category', ARRAY_A);
    $category['nice-name'] = wpsc_get_categorymeta($category['term_id'], 'nice-name');
    $category['description'] = wpsc_get_categorymeta($category['term_id'], 'description');
    $category['image'] = wpsc_get_categorymeta($category['term_id'], 'image');
    $category['fee'] = wpsc_get_categorymeta($category['term_id'], 'fee');
    $category['active'] = wpsc_get_categorymeta($category['term_id'], 'active');
    $category['order'] = wpsc_get_categorymeta($category['term_id'], 'order');
    $category['display_type'] = wpsc_get_categorymeta($category['term_id'], 'display_type');
    $category['image_height'] = wpsc_get_categorymeta($category['term_id'], 'image_height');
    $category['image_width'] = wpsc_get_categorymeta($category['term_id'], 'image_width');
    $category['use_additional_form_set'] = wpsc_get_categorymeta($category['term_id'], 'use_additional_form_set');
    ?>

	<tr>
		<td colspan="2">
			<h3><?php 
    esc_html_e('Advanced Store Settings', 'wpsc');
    ?>
</h3>
			<h4><?php 
    esc_html_e('Shortcodes and Template Tags', 'wpsc');
    ?>
</h4>
			<p class='description'><?php 
    esc_html_e('These settings override the general presentation settings found in Settings &gt; Store &gt; Presentation.', 'wpsc');
    ?>
</p>
		</td>
	</tr>


	<tr class="form-field">
		<th scope="row" valign="top">
			<label for="display_type"><?php 
    esc_html_e('Catalog View', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<?php 
    $display_type = isset($category['display_type']) ? $category['display_type'] : '';
    ?>
			<select name='display_type'>
				<option value='default'<?php 
    selected($display_type, 'default');
    ?>
><?php 
    esc_html_e('Default View', 'wpsc');
    ?>
</option>
				<option value='list'<?php 
    disabled(_wpsc_is_display_type_supported('list'), false);
    selected($display_type, 'list');
    ?>
><?php 
    esc_html_e('List View', 'wpsc');
    ?>
</option>
				<option value='grid' <?php 
    disabled(_wpsc_is_display_type_supported('grid'), false);
    selected($display_type, 'grid');
    ?>
><?php 
    esc_html_e('Grid View', 'wpsc');
    ?>
</option>
			</select><br />
		</td>
	</tr>
		<tr class="form-field">
			<th scope="row" valign="top">
				<label for="image"><?php 
    esc_html_e('Category Image', 'wpsc');
    ?>
</label>
			</th>
			<td>
				<?php 
    $category_image = wpsc_category_image($category['term_id']);
    if ($category_image) {
        echo '<p><img src=' . esc_url($category_image) . ' alt="' . esc_attr($category['name']) . '" title="' . esc_attr($category['name']) . '" class="wpsc_category_image" /></p>';
    }
    ?>
				<input type='file' name='image' value='' /><br />
				<label><input type='checkbox' name='deleteimage' class="wpsc_cat_box" value='1' /><?php 
    esc_html_e('Delete Image', 'wpsc');
    ?>
</label><br/>
				<span class="description"><?php 
    esc_html_e('You can set an image for the category here.  If one exists, check the box to delete.', 'wpsc');
    ?>
</span>
			</td>
	</tr>
	<?php 
    if (function_exists("getimagesize")) {
        ?>
		<tr class="form-field">
			<th scope="row" valign="top">
				<label for="image"><?php 
        esc_html_e('Thumbnail Size', 'wpsc');
        ?>
</label>
			</th>
			<td>
				<fieldset class="wpsc-width-height-fields">
					<legend class="screen-reader-text"><span><?php 
        esc_html_e('Thumbnail Size', 'wpsc');
        ?>
</span></legend>
					<label for="image_width"><?php 
        esc_html_e('Width', 'wpsc');
        ?>
</label>
					<input name="image_width" type="number" step="1" min="0" id="image_width" value="<?php 
        if (isset($category['image_width'])) {
            echo esc_attr($category['image_width']);
        }
        ?>
" class="small-text">
					<label for="large_size_h"><?php 
        esc_html_e('Height', 'wpsc');
        ?>
</label>
					<input name="image_height" type="number" step="1" min="0" id="image_height" value="<?php 
        if (isset($category['image_height'])) {
            echo esc_attr($category['image_height']);
        }
        ?>
" class="small-text">
				</fieldset>
			</td>
		</tr>
	<?php 
    }
    // 'getimagesize' condition
    ?>


	<tr>
		<td colspan="2"><h4><?php 
    esc_html_e('Shortcodes and Template Tags', 'wpsc');
    ?>
</h4></td>
	</tr>

	<tr class="form-field">
		<th scope="row" valign="top">
			<label for="image"><?php 
    esc_html_e('Display Category Shortcode', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<code>[wpsc_products category_url_name='<?php 
    echo $category["slug"];
    ?>
']</code><br />
			<span class="description"><?php 
    esc_html_e('Shortcodes are used to display a particular category or group within any WordPress page or post.', 'wpsc');
    ?>
</span>
		</td>
	</tr>
	<tr class="form-field">
		<th scope="row" valign="top">
			<label for="image"><?php 
    esc_html_e('Display Category Template Tag', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<code>&lt;?php echo wpsc_display_products_page( array( 'category_url_name' => '<?php 
    echo $category["slug"];
    ?>
' ) ); ?&gt;</code><br />
			<span class="description"><?php 
    esc_html_e('Template tags are used to display a particular category or group within your theme / template.', 'wpsc');
    ?>
</span>
		</td>
	</tr>

	<!-- START OF TARGET MARKET SELECTION -->

	<tr>
		<td colspan="2">
			<h4><?php 
    esc_html_e('Target Market Restrictions', 'wpsc');
    ?>
</h4>
		</td>
	</tr>
	<?php 
    $countrylist = WPSC_Countries::get_countries_array(true, true);
    $selectedCountries = wpsc_get_meta($category_id, 'target_market', 'wpsc_category');
    ?>
	<tr>
		<th scope="row" valign="top">
			<label for="image"><?php 
    esc_html_e('Target Markets', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<?php 
    if (wpsc_is_suhosin_enabled()) {
        ?>
				<em><?php 
        esc_html_e('The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature, then disable the suhosin extension. If you can not do this, you will need to contact your hosting provider.', 'wpsc');
        ?>
</em>
			<?php 
    } else {
        ?>
				<span><?php 
        esc_html_e('Select', 'wpsc');
        ?>
: <a href='' class='wpsc_select_all'><?php 
        esc_html_e('All', 'wpsc');
        ?>
</a>&nbsp; <a href='' class='wpsc_select_none'><?php 
        esc_html_e('None', 'wpsc');
        ?>
</a></span><br />
				<div id='resizeable' class='ui-widget-content multiple-select'>
					<?php 
        foreach ($countrylist as $country) {
            if (in_array($country['id'], (array) $selectedCountries)) {
                ?>
							<input type='checkbox' name='countrylist2[]' id='countrylist2-<?php 
                echo $country['id'];
                ?>
' value='<?php 
                echo $country['id'];
                ?>
' checked='<?php 
                echo $country['visible'];
                ?>
' />
							<label for="countrylist2-<?php 
                echo $country['id'];
                ?>
"><?php 
                esc_html_e($country['country']);
                ?>
</label><br />
							<?php 
            } else {
                ?>
							<input type='checkbox' name='countrylist2[]' id='countrylist2-<?php 
                echo $country['id'];
                ?>
' value='<?php 
                echo $country['id'];
                ?>
'  />
							<label for="countrylist2-<?php 
                echo $country['id'];
                ?>
"><?php 
                esc_html_e($country['country']);
                ?>
</label><br />
							<?php 
            }
        }
        ?>
				</div>
			<?php 
    }
    ?>
<br />
			<span class="description"><?php 
    esc_html_e('Select the markets you are selling this category to.', 'wpsc');
    ?>
</span>
		</td>
	</tr>

	<!-- Checkout settings -->

	<tr>
		<td colspan="2">
			<h4><?php 
    esc_html_e('Checkout Settings', 'wpsc');
    ?>
</h4>
		</td>
	</tr>
	<?php 
    if (!isset($category['term_id'])) {
        $category['term_id'] = '';
    }
    $used_additonal_form_set = wpsc_get_categorymeta($category['term_id'], 'use_additional_form_set');
    $checkout_sets = get_option('wpsc_checkout_form_sets');
    unset($checkout_sets[0]);
    $uses_billing_address = (bool) wpsc_get_categorymeta($category['term_id'], 'uses_billing_address');
    ?>
	<tr class="form-field">
		<th scope="row" valign="top">
			<label for="image"><?php 
    esc_html_e('Category requires additional checkout form fields', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<select name='use_additional_form_set'>
				<option value=''><?php 
    esc_html_e('None', 'wpsc');
    ?>
</option>
				<?php 
    foreach ((array) $checkout_sets as $key => $value) {
        $selected_state = "";
        if ($used_additonal_form_set == $key) {
            $selected_state = "selected='selected'";
        }
        ?>
						<option <?php 
        echo $selected_state;
        ?>
 value='<?php 
        echo $key;
        ?>
'><?php 
        echo esc_html($value);
        ?>
</option>
						<?php 
    }
    ?>
			</select>
		</td>
	</tr>

	<tr class="form-field">
		<th scope="row" valign="top">
			<label><?php 
    esc_html_e('Address to calculate shipping with', 'wpsc');
    ?>
</label>
		</th>
		<td>
			<label><input type="radio" class="wpsc_cat_box" value="0" name="uses_billing_address" <?php 
    echo $uses_billing_address != true ? 'checked="checked"' : '';
    ?>
 /> <?php 
    esc_html_e('Shipping Address (default)', 'wpsc');
    ?>
</label><br />
			<label><input type="radio" class="wpsc_cat_box" value="1" name="uses_billing_address" <?php 
    echo $uses_billing_address == true ? 'checked="checked"' : '';
    ?>
 /> <?php 
    esc_html_e('Billing Address', 'wpsc');
    ?>
</label>
			<p class='description'><?php 
    esc_html_e('Products in this category will use the address specified to calculate shipping costs.', 'wpsc');
    ?>
</p>
		</td>
	</tr>

	<?php 
}
function wpsc_admin_category_forms_edit()
{
    global $wpdb;
    $category_value_count = 0;
    $category_name = '';
    $category = array();
    $category_id = absint($_REQUEST["tag_ID"]);
    $category = get_term($category_id, 'wpsc_product_category', ARRAY_A);
    $category['nice-name'] = wpsc_get_categorymeta($category['term_id'], 'nice-name');
    $category['description'] = wpsc_get_categorymeta($category['term_id'], 'description');
    $category['image'] = wpsc_get_categorymeta($category['term_id'], 'image');
    $category['fee'] = wpsc_get_categorymeta($category['term_id'], 'fee');
    $category['active'] = wpsc_get_categorymeta($category['term_id'], 'active');
    $category['order'] = wpsc_get_categorymeta($category['term_id'], 'order');
    $category['display_type'] = wpsc_get_categorymeta($category['term_id'], 'display_type');
    $category['image_height'] = wpsc_get_categorymeta($category['term_id'], 'image_height');
    $category['image_width'] = wpsc_get_categorymeta($category['term_id'], 'image_width');
    $category['use_additional_form_set'] = wpsc_get_categorymeta($category['term_id'], 'use_additional_form_set');
    ?>

        <tr>
            <td colspan="2">
                <h3><?php 
    esc_html_e('Advanced Settings', 'wpsc');
    ?>
</h3>

            </td>
        </tr>

	<tr class="form-field">
            <th scope="row" valign="top">
		<label for="display_type"><?php 
    esc_html_e('Catalog View', 'wpsc');
    ?>
</label>
            </th>
            <td>
		<?php 
    $display_type = isset($category['display_type']) ? $category['display_type'] : '';
    ?>
            <select name='display_type'>
                <option value='default'<?php 
    checked($display_type, 'default');
    ?>
><?php 
    esc_html_e('Default View', 'wpsc');
    ?>
</option>
                <option value='list'<?php 
    disabled(_wpsc_is_display_type_supported('list'), false);
    checked($display_type, 'list');
    ?>
><?php 
    esc_html_e('List View', 'wpsc');
    ?>
</option>
                <option value='grid' <?php 
    disabled(_wpsc_is_display_type_supported('grid'), false);
    checked($display_type, 'grid');
    ?>
><?php 
    esc_html_e('Grid View', 'wpsc');
    ?>
</option>
            </select><br />
		<span class="description"><?php 
    esc_html_e('To over-ride the presentation settings for this group you can enter in your prefered settings here', 'wpsc');
    ?>
</span>
            </td>
	</tr>
        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Category Image', 'wpsc');
    ?>
</label>
            </th>
            <td>
		<input type='file' name='image' value='' /><br />
                <label><input type='checkbox' name='deleteimage' class="wpsc_cat_box" value='1' /><?php 
    esc_html_e('Delete Image', 'wpsc');
    ?>
</label><br/>
		<span class="description"><?php 
    esc_html_e('You can set an image for the category here.  If one exists, check the box to delete.', 'wpsc');
    ?>
</span>
            </td>
	</tr>
        <?php 
    if (function_exists("getimagesize")) {
        ?>
        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
        esc_html_e('Thumbnail Size', 'wpsc');
        ?>
</label>
            </th>
            <td>
                <?php 
        esc_html_e('Width', 'wpsc');
        ?>
 <input type='text' class="wpsc_cat_image_size" value='<?php 
        if (isset($category['image_width'])) {
            echo $category['image_width'];
        }
        ?>
' name='image_width' size='6' />
                <?php 
        esc_html_e('Height', 'wpsc');
        ?>
 <input type='text' class="wpsc_cat_image_size" value='<?php 
        if (isset($category['image_height'])) {
            echo $category['image_height'];
        }
        ?>
' name='image_height' size='6' /><br/>
           </td>
	</tr>
        <?php 
    }
    // 'getimagesize' condition
    ?>
	<tr>
            <td colspan="2"><h3><?php 
    esc_html_e('Shortcodes and Template Tags', 'wpsc');
    ?>
</h3></td>
        </tr>

        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Display Category Shortcode', 'wpsc');
    ?>
:</label>
            </th>
            <td>
                <span>[wpsc_products category_url_name='<?php 
    echo $category["slug"];
    ?>
']</span><br />
		<span class="description"><?php 
    esc_html_e('Shortcodes are used to display a particular category or group within any WordPress page or post.', 'wpsc');
    ?>
</span>
            </td>
	</tr>
        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Display Category Template Tag', 'wpsc');
    ?>
:</label>
            </th>
            <td>
                <span>&lt;?php echo wpsc_display_products_page( array( 'category_url_name'=>'<?php 
    echo $category["slug"];
    ?>
' ) ); ?&gt;</span><br />
		<span class="description"><?php 
    esc_html_e('Template tags are used to display a particular category or group within your theme / template.', 'wpsc');
    ?>
</span>
            </td>
	</tr>

<!-- START OF TARGET MARKET SELECTION -->

        <tr>
            <td colspan="2">
                <h3><?php 
    esc_html_e('Target Market Restrictions', 'wpsc');
    ?>
</h3>
            </td>
        </tr>
        <?php 
    $countrylist = $wpdb->get_results("SELECT id,country,visible FROM `" . WPSC_TABLE_CURRENCY_LIST . "` ORDER BY country ASC ", ARRAY_A);
    $selectedCountries = wpsc_get_meta($category_id, 'target_market', 'wpsc_category');
    ?>
        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Target Markets', 'wpsc');
    ?>
:</label>
            </th>
            <td>
                <?php 
    if (wpsc_is_suhosin_enabled()) {
        ?>
                <em><?php 
        esc_html_e('The Target Markets feature has been disabled because you have the Suhosin PHP extension installed on this server. If you need to use the Target Markets feature, then disable the suhosin extension. If you can not do this, you will need to contact your hosting provider.', 'wpsc');
        ?>
</em>

                <?php 
    } else {
        ?>
		<span><?php 
        esc_html_e('Select', 'wpsc');
        ?>
: <a href='' class='wpsc_select_all'><?php 
        esc_html_e('All', 'wpsc');
        ?>
</a>&nbsp; <a href='' class='wpsc_select_none'><?php 
        esc_html_e('None', 'wpsc');
        ?>
</a></span><br />
		<div id='resizeable' class='ui-widget-content multiple-select'>
                    <?php 
        foreach ($countrylist as $country) {
            if (in_array($country['id'], (array) $selectedCountries)) {
                echo " <input type='checkbox' class='wpsc_cat_box' name='countrylist2[]' value='" . $country['id'] . "'  checked='" . $country['visible'] . "' />" . $country['country'] . "<br />";
            } else {
                echo " <input type='checkbox' class='wpsc_cat_box' name='countrylist2[]' value='" . $country['id'] . "'  />" . $country['country'] . "<br />";
            }
        }
        ?>
		</div>
                <?php 
    }
    ?>
<br />
		<span class="description"><?php 
    esc_html_e('Select the markets you are selling this category to.', 'wpsc');
    ?>
</span>
            </td>
	</tr>
<!-- Checkout settings -->

        <tr>
            <td colspan="2">
                <h3><?php 
    esc_html_e('Checkout Settings', 'wpsc');
    ?>
</h3>
            </td>
        </tr>
        <?php 
    if (!isset($category['term_id'])) {
        $category['term_id'] = '';
    }
    $used_additonal_form_set = wpsc_get_categorymeta($category['term_id'], 'use_additional_form_set');
    $checkout_sets = get_option('wpsc_checkout_form_sets');
    unset($checkout_sets[0]);
    $uses_billing_address = (bool) wpsc_get_categorymeta($category['term_id'], 'uses_billing_address');
    ?>
        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Category requires additional checkout form fields', 'wpsc');
    ?>
</label>
            </th>
            <td>
                <select name='use_additional_form_set'>
                    <option value=''><?php 
    esc_html_e('None', 'wpsc');
    ?>
</option>
                    <?php 
    foreach ((array) $checkout_sets as $key => $value) {
        $selected_state = "";
        if ($used_additonal_form_set == $key) {
            $selected_state = "selected='selected'";
        }
        ?>
                    <option <?php 
        echo $selected_state;
        ?>
 value='<?php 
        echo $key;
        ?>
'><?php 
        echo esc_html($value);
        ?>
</option>
                    <?php 
    }
    ?>
                </select><br />
              </td>
	</tr>

        <tr class="form-field">
            <th scope="row" valign="top">
		<label for="image"><?php 
    esc_html_e('Products in this category use the billing address to calculate shipping', 'wpsc');
    ?>
</label>
            </th>
            <td>
                <input type='radio' class="wpsc_cat_box" value='1' name='uses_billing_address' <?php 
    echo $uses_billing_address == true ? "checked='checked'" : "";
    ?>
 /><?php 
    esc_html_e('Yes', 'wpsc');
    ?>
                <input type='radio' class="wpsc_cat_box" value='0' name='uses_billing_address' <?php 
    echo $uses_billing_address != true ? "checked='checked'" : "";
    ?>
 /><?php 
    esc_html_e('No', 'wpsc');
    ?>
                <br />
	  </td>
	</tr>

  <?php 
}