Пример #1
0
							
							<?php wpsc_print_subcategory("<ul>", "</ul>"); ?>
						</li>
				<?php wpsc_end_category_query(); ?>
			</ul>
		<?php endif; ?>
	<?php endif; ?>



	
	<?php if(wpsc_display_products()): ?>
		<?php if(wpsc_is_in_category()) : ?>
			<div class='wpsc_category_details'>
				<?php if(get_option('show_category_thumbnails') && wpsc_category_image()) : ?>
					<img src='<?php echo wpsc_category_image(); ?>' alt='<?php echo wpsc_category_name(); ?>' title='<?php echo wpsc_category_name(); ?>' />
				<?php endif; ?>
				
				<?php if(get_option('wpsc_category_description') &&  wpsc_category_description()) : ?>
					<?php echo wpsc_category_description(); ?>
				<?php endif; ?>
			</div>
		<?php endif; ?>
		
		
		<!-- Start Pagination -->
		<?php if ( ( get_option( 'use_pagination' ) == 1 && ( get_option( 'wpsc_page_number_position' ) == 1 || get_option( 'wpsc_page_number_position' ) == 3 ) ) ) : ?>
			<div class="wpsc_page_numbers">
				<?php if ( wpsc_has_pages() ) : ?>
					<div class="pagination-products-showing">Showing <?php echo wpsc_showing_products(); ?> of <?php echo wpsc_total_product_count(); ?> products</div>
					<div class="pagination-pages"><?php echo wpsc_first_products_link( '&laquo; First', true ); ?> <?php echo wpsc_previous_products_link( '&laquo; Previous', true ); ?> <?php echo wpsc_pagination( 10 ); ?> <?php echo wpsc_next_products_link( 'Next &raquo;', true ); ?> <?php echo wpsc_last_products_link( 'Last &raquo;', true ); ?></div>
Пример #2
0
// */
?>

	<?php 
if (wpsc_display_products()) {
    ?>

		<?php 
    if (wpsc_is_in_category()) {
        ?>
			<div class="wpsc_category_details">
				<?php 
        if (wpsc_show_category_thumbnails()) {
            ?>
					<img src="<?php 
            echo wpsc_category_image();
            ?>
" alt="<?php 
            echo wpsc_category_name();
            ?>
" />
				<?php 
        }
        ?>

				<?php 
        if (wpsc_show_category_description() && wpsc_category_description()) {
            ?>
					<?php 
            echo wpsc_category_description();
            ?>
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 
}
Пример #4
0
/**
 * wpsc_show_category_thumbnails function
 * @return bool - whether to show category thumbnails or not
 */
function wpsc_show_category_thumbnails()
{
    if (get_option('show_category_thumbnails') && wpsc_category_image()) {
        return true;
    } else {
        return false;
    }
}
?>
			<div class="slider-mask<?php 
if (count($category_data) > 5) {
    echo ' slideable';
}
?>
">
				<div class="front-category-slider">
					<?php 
$i = 0;
foreach ($category_data as $category_row) {
    $name = $category_row['name'];
    $id = $category_row['id'];
    $description = $category_row['description'];
    $url = wpsc_category_url($category_row['id']);
    $image = wpsc_category_image($id);
    ?>
							<?php 
    if ($i % 5 == 0) {
        echo '<div class="full-width"><ul class="front-category-list">';
    }
    ?>
							<li <?php 
    if ($i % 5 == 4) {
        echo 'class="col-right"';
    }
    ?>
>
								<div class="padding">
									<a href="<?php 
    echo $url;