Design and Layout RSS feed for this section

Shortcodes: Categories

Short Codes are a great way to display shop pages anywhere on your site, for more information on short codes you can look at the documentation.

Otherwise please find a complete list of category shortcodes below, additional arguments can be found and the bottom and incorporated into these shortcodes.

Short code:

[php][wpsc_products category_id='4'][/php]
(more…)

Read Documentation ·

wpsc_has_downloads

Located in: Located in: wpsc-user_log_functions.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the user has any downloadable purchases. You would most likely use this condition on the user “My Profile” page

[php]
<?php elseif ( is_wpsc_downloads_page() ) : ?>

<?php if ( wpsc_has_downloads() ) : ?>

<table class="logdisplay">
<tr>
<th><?php _e( ‘File Names’, ‘wpsc’ ); ?> </th>
<th><?php _e( ‘Downloads Left’, ‘wpsc’ ); ?> </th>
<th><?php _e( ‘Date’, ‘wpsc’ ); ?> </th>
</tr>

<?php
[/php]

Read Documentation ·

wpsc_has_purchases_this_month

Located in: Located in: wpsc-user_log_functions.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the user has made any purchases this month.

[php]
<?php if ( wpsc_has_purchases() ) : ?>

<table class="logdisplay">

<?php if ( wpsc_has_purchases_this_month() ) : ?>

<tr class="toprow">
<td><strong><?php _e( ‘Status’, ‘wpsc’ ); ?></strong></td>
<td><strong><?php _e( ‘Date’, ‘wpsc’ ); ?></strong></td>
<td><strong><?php _e( ‘Price’, ‘wpsc’ ); ?></strong></td>

<?php if ( get_option( ‘payment_method’ ) == 2 ) : ?>

<td><strong><?php _e( ‘Payment Method’, ‘wpsc’ ); ?></strong></td>

<?php endif; ?>

</tr>

<?php wpsc_user_details(); ?>

<?php else : ?>

[/php]

Read Documentation ·

wpsc_has_purchases

Located in: Located in: wpsc-user_log_functions.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the user has any purcahses – you would normally use this on the my account page.

[php]
<?php if ( wpsc_has_purchases() ) : ?>
//display the purcahses
<?php endif; ?>
[/php]

Read Documentation ·

is_wpsc_downloads_page

Located in: Located in: wpsc-user_log_functions.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the current page is the WP-e-Commerce download profile page.

Note: This is the check for downloads profile page you can use the condition: is_wpsc_profile_page to check if the user is on their profile page.

[php]
<!– START OF DOWNLOADS PAGE –>
<?php elseif ( is_wpsc_downloads_page() ) : ?>

<?php if ( wpsc_has_downloads() ) : ?>

[/php]

Read Documentation ·

is_wpsc_profile_page

Located in: Located in: wpsc-user_log_functions.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the current page is the WP-e-Commerce profile page.

Note: This is the check for the main profile page with the user details you can use the condition: is_wpsc_downloads_page to check if the user is on their downloads page.

[php]
<?php if ( is_wpsc_profile_page() ) : ?>

<form method="post">

<?php echo validate_form_data(); ?>

<table>

<?php wpsc_display_form_fields(); ?>
[/php]

Read Documentation ·

wpsc_is_checked_status

Located in: Located in: purchaselogs.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if a purchase status is selected. It should be used within the purchase log loop.

[php]<?php while(wpsc_have_purch_items_statuses()) : wpsc_the_purch_status(); ?>[/php]

[php]
<?php while(wpsc_have_purch_items_statuses()) : wpsc_the_purch_status(); ?>
<option value='<?php echo wpsc_the_purch_status_id(); ?>’ <?php echo wpsc_is_checked_status(); ?> ><?php echo wpsc_the_purch_status_name(); ?> </option>
[/php]

Read Documentation ·

wpsc_has_purchlog_shipping

Located in: Located in: purcahselogs.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the purchase logs have shipping details. You would normally use this on the user “My account” page.

[php]
<?php if(wpsc_has_purchlog_shipping()) { ?>
<div id=’wpsc_shipping_details_box’>
<h3><?php _e(‘Shipping Address’,’wpsc’); ?></h3>
<p><strong><?php echo wpsc_display_purchlog_shipping_name(); ?></strong></p>
[/php]

Read Documentation ·

wpsc_has_tnc

Located in: Located in: checkout.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if terms and conditions are not empty.

[php]
<?php if(wpsc_has_tnc()) : ?>
<tr>
<td colspan=’2′>
<label for="agree"><input id="agree" type=’checkbox’ value=’yes’ name=’agree’ /> <?php printf(__("I agree to the <a class=’thickbox’ target=’_blank’ href=’%s’ class=’termsandconds’>Terms and Conditions</a>", "wpsc"), site_url("?termsandconds=true&amp;width=360&amp;height=400")); ?> <span class="asterix">*</span></label>
</td>
</tr>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_has_noca_message

Located in: Located in: wpsc-deprecated.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the noca gateway has a message.

Note: This function is now deprecated and should not be used.

Read Documentation ·

wpsc_has_category_and_country_conflict

Located in: Located in: checkout.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check whether the country and categories selected have conflicts
i.e products of this category cannot be shipped to selected country.

[php]
<?php if(wpsc_has_category_and_country_conflict()): ?>
<p class=’validation-error’><?php echo $_SESSION['categoryAndShippingCountryConflict']; ?></p>
<?php unset($_SESSION['categoryAndShippingCountryConflict']);
endif;
[/php]

Read Documentation ·

wpsc_has_regions

Located in: Located in: checkout.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if a country has regions or not.

[php]
<?php if(wpsc_has_regions : ?>
echo "Please select a region";
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_is_noca_gateway

Located in: Located in: wpsc-deprecated.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the gateway name is noca.

Note: This function is now deprecated and should not be used.

Read Documentation ·

wpsc_is_shipping_details

Located in: Located in: checkout.class.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the shipping details ahve been filled out. Normally you would used this to excute some code / display a message when the user selects the “shipping same as billing details checkbox”

[php]
<?php if(wpsc_is_shipping_details()):?>
echo "Your order will be shipped to your billing address";
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_is_checkout

Located in: Located in: wpsc-functions.php
Version Introduced: 3.8
Return: Boolean – True if we have and use them, False otherwise

Description: This condition is used to check if the buyer is at the checkout

[php]
<?php if(wpsc_is_checkout()) : ?>

<?php endif; ?>
[/php]

Read Documentation ·

wpsc_show_thumbnails

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product thumbnails should be displayed.

Note: you should also use the following to check if that particular product has a thumbnail: <?php if(wpsc_the_product_thumbnail()) :

Code Example:
[php]
<?php if(wpsc_show_thumbnails()) :?>
<div class="imagecol" style="width:<?php echo $image_width; ?>;" id="imagecol_<?php echo wpsc_the_product_id(); ?>">

[/php]

Read Documentation ·

wpsc_have_custom_meta

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product has custom meta assigned to it.

Code Example:
[php]
<?php if (wpsc_have_custom_meta()) : ?>
<div class="custom_meta">
<?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>
<?php if (stripos(wpsc_custom_meta_name(),’g:’) !== FALSE) continue; ?>
<strong><?php echo wpsc_custom_meta_name(); ?>: </strong><?php echo wpsc_custom_meta_value(); ?><br />
<?php endwhile; ?>
</div><!–close custom_meta–>
<?php endif; ?>

[/php]

Read Documentation ·

wpsc_product_has_supplied_file

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product can have a file uploaded to it.

[php]
<?php if ( wpsc_product_has_supplied_file() ) : ?>

<fieldset class="custom_file">
<legend><?php _e( ‘Upload a File’, ‘wpsc’ ); ?></legend>
<p><?php _e( ‘Select a file from your computer to include with this purchase.’, ‘wpsc’ ); ?></p>
<input type="file" name="custom_file" />
</fieldset>
<?php endif; ?>

[/php]

Read Documentation ·

wpsc_product_is_customisable

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product can be customized (image or message uploaded with the product)

[php]
<?php if( wpsc_product_is_customisable() ) : ?>
<input type="hidden" value="true" name="is_customisable"/>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_product_has_file

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product has a downloadable file.

Read Documentation ·

wpsc_product_on_special

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product is on special.

[php]
<?php if(wpsc_product_on_special()) : ?>
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e(‘Old Price’, ‘wpsc’); ?>: <span class="oldprice" id="old_product_price_<?php echo wpsc_the_product_id(); ?>"><?php echo wpsc_product_normal_price(); ?></span></p>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_product_is_donation

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to determine if the product is a donation.

[php]
<?php if(wpsc_product_is_donation()) : ?>
<label for="donation_price_<?php echo wpsc_the_product_id(); ?>"><?php _e(‘Donation’, ‘wpsc’); ?>: </label>

[/php]

Read Documentation ·

wpsc_is_product_external

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the product has an external link (this is set under the advanced product settings)

[php]
if ( wpsc_is_product_external() ) :
$action = wpsc_product_external_link( $product_id );
<?php else: ?>
[/php]

Read Documentation ·

wpsc_product_has_stock

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if stock is available for the given product (stock quantities can be set on the add / edit product).

[php]
<?php if(wpsc_product_has_stock()) : ?>
<div id="stock_display_<?php echo wpsc_the_product_id(); ?>" class="in_stock"><?php _e(‘Product in stock’, ‘wpsc’); ?></div>
<?php else: ?>
[/php]

Read Documentation ·

wpsc_show_fb_like

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean

Description: This condition is used to check if the face-book live button should be shown.

[php]
if(wpsc_show_fb_like()): ?>
<div class="FB_like">
<iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo wpsc_the_product_permalink(); ?>&amp;layout=standard&amp;show_faces=true&amp;width=435&amp;action=like&amp;font=arial&amp;colorscheme=light" frameborder="0"></iframe>
</div><!–close FB_like–>
[/php]

Read Documentation ·

wpsc_is_single_product

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean – True /False

Description: This condition is used to check if we are on a single product page.

[php]
<?php if(wpsc_is_single_product()) : ?>
//single product code in here
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_is_product

Located in: Located in: wpsc-functions.php
Version Introduced: 3.8
Return: False if not a product, $wp_query->is_product will be set if true

Description: This condition is used to check if your viewing a product

[php]
<?php if(wpsc_is_product()) : ?>
//product code in here
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_has_breadcrumbs

Located in: Located in: breadcrumbs.class.php
Version Introduced: 3.8
Return: Boolean – True if we have and use them, False otherwise

Description: This condition is used to check if breadcrumbs are turned on and present.

Note: If your using the wpsc_output_breadcrumbs(); template tag then this check is already done for you.

[php]
<?php if(wpsc_has_breadcrumbs()) : ?>
//breadcrumbs stuff in here
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_is_in_category

Located in: Located in: category.functions.php
Version Introduced: 3.8
Return: True / False

Description: This condition is used to check if your viewing a product category page.

[php]
<?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]

Read Documentation ·

wpsc_is_viewable_taxonomy

Located in: Located in: theme.functions.php
Version Introduced: 3.8
Return: True / False

Description: This condition is used to check if your looking at a viewable taxonomy – eg a product category page.

[php]
<?php if(wpsc_is_viewable_taxonomy()) : ?>
//do taxonomy code here
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_has_multi_adding

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: True / False

Description: This condition is used with the template tag is used to check if the user has turned on the product quantity setting. It is normally used on the product pages to display the quanity input boxes.

[php]
<?php if(wpsc_has_multi_adding()): ?>
<fieldset><legend><?php _e(‘Quantity’, ‘wpsc’); ?></legend>
<div class="wpsc_quantity_update">
<?php /*<label for="wpsc_quantity_update_<?php echo wpsc_the_product_id(); ?>"><?php _e(‘Quantity’, ‘wpsc’); ?>:</label>*/ ?>
<input type="text" id="wpsc_quantity_update_<?php echo wpsc_the_product_id(); ?>" name="wpsc_quantity_update" size="2" value="1" />
<input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
<input type="hidden" name="wpsc_update_quantity" value="true" />
</div><!–close wpsc_quantity_update–>
</fieldset>
<?php endif ;?>
[/php]

Read Documentation ·

wpsc_has_pages

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: Boolean true if we have pages false if we dont

Description: This condition is used to check if you have more than one page to display.

NOTE: This condition is used within the wpsc_has_pages_top and wpsc_has_pages_bottom condition so if you using these condidtions the check has already been done for you.

Code example:
[php]
if ( wpsc_has_pages ){
//show some pagination or something
}
[/php]

Read Documentation ·

wpsc_has_pages_bottom

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: True / False

Description: This condition is used with the template tag

  

it will check to see if the user has set their pagination settings (under store settings > presentation) to display the pagination on bottom of the page.

[php]
<?php if(wpsc_has_pages_bottom()) : ?>
<div class="wpsc_page_numbers_bottom">
<?php wpsc_pagination(); ?>
</div><!–close wpsc_page_numbers_bottom–>
[/php]

Read Documentation ·

wpsc_has_pages_top

Located in: Located in: product-template.php
Version Introduced: 3.8
Return: True / False

Description: This condition is used with the template tag wpsc_pagination(); it will check to see if the user has set their pagination settings (under store settings > presentation) to display the pagination on top of the page.

[php]
<?php if(wpsc_has_pages_top()) : ?>
<div class="wpsc_page_numbers_top">
<?php wpsc_pagination(); ?>
</div><!–close wpsc_page_numbers_top–>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_core_is_multisite

Located in: Located in: wpsc-constants.php
Version Introduced: 3.8
Return: BOL 1 = multi site 0 = not multi site

Description: This condition will check if the current install of WP-e-Commerce is on a multi site.

[php]
<?php
if (wpsc_core_is_multisite){
//multi site code in here
}else{
// not multi site code in here
}
[/php]

Read Documentation ·

WPEC Conditional Tags – Complete list

Introduction

The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches. For example, you might want to display a snippet of text above the series of posts, but only on the main page of your blog. With the is_home Conditional Tag, that task is made easy.

The Conditions For …

Generic

  • wpsc_page_is_selected – returns if on a WP e-Commerce Page
  • wpsc_core_is_multisite
  • wpsc_has_pages_top
  • wpsc_has_pages_bottom
  • wpsc_has_pages
  • wpsc_has_multi_adding

Products Page

  • wpsc_is_viewable_taxonomy
  • wpsc_is_in_category
  • wpsc_has_breadcrumbs

Single Product

  • wpsc_is_product
  • wpsc_is_single_product – determines if you’re viewing a Product page
  • wpsc_show_fb_like – checks whether to display Facebook Like
  • wpsc_product_has_stock – determines if stock is available for the given Product
  • wpsc_is_product_external – determines if the Product has an external link
  • wpsc_product_is_donation – determines if the Product is a donation
  • wpsc_product_on_special – determines if the Product is on special
  • wpsc_product_has_file – determines if the Product has a downloadable file
  • wpsc_product_is_customisable – determines if the Product can be customised (uploaded image)
  • wpsc_product_has_personal_text – determines if the Product can accept customised text
  • wpsc_product_has_supplied_file – …
  • wpsc_have_custom_meta – determines if the current Product has custom meta assigned
  • wpsc_show_thumbnails – determines whether to display Product thumbnails

Checkout

  • wpsc_is_checkout
  • wpsc_is_shipping_details
  • wpsc_is_noca_gateway – Depricated
  • wpsc_has_regions
  • wpsc_has_category_and_country_conflict
  • wpsc_has_noca_message – Depricated
  • wpsc_has_tnc
  • wpsc_has_purchlog_shipping

Sales

  • wpsc_is_checked_status

User Account

  • is_wpsc_profile_page
  • is_wpsc_downloads_page
  • wpsc_has_purchases
  • wpsc_has_purchases_this_month
  • wpsc_has_downloads
Read Documentation ·

wpsc_pagination

Located in: product-template.php
Version Introduced: 3.8

Description: This template tag is used to output the pagination on the product page. You would want to include this tag on all your product templates expect for the single product.

Note: Pagination will only be output if the user has them turned on in the store settings. You will also want to use the conditional tags to check if the user wants to display pagination on the top, or bottom of their product page (or both!)

Code Example:
Pagination on top – using the conditional tag to see if the user wants pagination there
[php]
<?php if(wpsc_has_pages_top()) : ?>
<div class="wpsc_page_numbers_top">
<?php wpsc_pagination(); ?>
</div><!–close wpsc_page_numbers_top–>

[/php]
Pagination on bottom – using the conditional tag to see if the user wants pagination there
[php]
<?php if(wpsc_has_pages_bottom()) : ?>
<div class="wpsc_page_numbers_bottom">
<?php wpsc_pagination(); ?>
</div><!–close wpsc_page_numbers_bottom–>
[/php]

Read Documentation ·

wpsc_category_description

Located in: Located in: category.functions.php
Version Introduced: 3.8
Accepted Parameters: $category_id – can be left out if used within the category loop.

Description: This template tag will return the category description it must be used within the category loop unless a Category Id is supplied. This function will return false is not description is found so you can use this tag as a conditional as well.

Note: This function only returns the value if you want to print it to your template use an echo function.
Category descriptions are an option in the presentation settings so you should always check that the user has the setting turned on before you output the description.

[php] <?php if(get_option(‘wpsc_category_description’) && wpsc_category_description()) : ?>
<?php echo wpsc_category_description(); ?>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_category_name

Located in: Located in: category.functions.php
Version Introduced: 3.8
Accepted Parameters: $category_id – can be left out if used within the category loop.

Description: This template tag will return the category name it must be used within the category loop unless a Category Id is supplied.

Note: This function only returns the value if you want to print it to your template use an echo function.

[php] <?php if(wpsc_show_category_thumbnails()) : ?>
<img src="<?php echo wpsc_category_image(); ?>" alt="<?php echo wpsc_category_name(); ?>" />
<?php endif; ?>[/php]

Read Documentation ·

wpsc_category_image

Located in: Located in: category.functions.php
Version Introduced: 3.8
Accepted Parameters: $category_id – can be left out if used within the category loop.

Description: This template tag will return the src for the category image – if not image is found ti will return false because of this you can also use this tag as a conditional to check if the category has an image.

Note: This function only returns the value if you want to print it to your template use an echo function.

[php] <?php if(wpsc_show_category_thumbnails()) : ?>
<img src="<?php echo wpsc_category_image(); ?>" alt="<?php echo wpsc_category_name(); ?>" />
<?php endif; ?>[/php]

Read Documentation ·

wpsc_print_category_description

Located in: Located in: category.functions.php
Version Introduced: 3.8

Description: This template tag will print the category description it must be used within the category loop. Showing the category Description is an extra setting so its always good to check if the user has that setting turned on before outputting the description.

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<?php if(get_option(‘wpsc_category_description’)) :?>
<?php wpsc_print_category_description("<div class=’wpsc_subcategory’>", "</div>"); ?>
<?php endif;?>[/php]

Read Documentation ·

wpsc_print_category_classes_section

Located in: Located in: category.functions.php
Version Introduced: 3.8

Description: This template tag will print the category class section it must be used after the category query has been started.

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<?php wpsc_print_subcategory( ”, ” ); ?>
[/php]
[php]<li class="wpsc_category_<?php wpsc_print_category_id(); wpsc_print_category_classes_section();?>">[/php]

Read Documentation ·

wpsc_print_category_id

Located in: Located in: category.functions.php
Version Introduced: 3.8

Description: This template tag will print the category ID it must be used after the category query has been started.

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<?php wpsc_print_subcategory( ”, ” ); ?>
[/php]
[php]<li class="wpsc_category_<?php wpsc_print_category_id(); wpsc_print_category_classes_section();?>">[/php]

Read Documentation ·

wpsc_print_category_classes

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: $category_to_print (default = false), $echo (default= true)

Description: This template tag will place classes for the category including selected state. It accepts two parameters, the category to print classes for and if the class should be echoed or returned

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>">
<?php wpsc_print_category_image(45, 45); ?>
</a>
[/php]

Read Documentation ·

wpsc_print_subcategory

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: $start_element $end_element

Description: This template tag will print the subcategories for the product category. If you want to display them in a list then set the start element to be [php]<li>[/php]

end element will be [php] </li>[/php]

Note – you will need to open and close your list before you output the subcategories (see below)

It must be used after the category query has been stared:

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:

[php]
<ul>
<?php wpsc_print_subcategory( ‘<li>’, ‘</li>’ ); ?>
</ul>
[/php]

Read Documentation ·

wpsc_print_category_image

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: $width, $height

Description: This template tag will print the category image it must be used after the category query has been stared:

[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>">
<?php wpsc_print_category_image(45, 45); ?>
</a>

[/php]

Read Documentation ·

wpsc_print_category_name

Located in: Located in: category.functions.php
Version Introduced: 3.8

Description: This template tag will print the category name it must be used after the category query has been started.
[php] <?php wpsc_start_category_query(array(‘category_group’=> 1, ‘show_thumbnails’=> 1)); ?> [/php]

Code Example:
[php]
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>">
<?php wpsc_print_category_image(45, 45); ?>
</a>

[/php]

Read Documentation ·

wpsc_print_category_url

Located in: Located in: category.functions.php
Version Introduced: 3.8

Description: This template tag will print the category URL it must be used after the category query has been started.

Code Example:
[php]
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name();?>">
<?php wpsc_print_category_image(45, 45); ?>
</a>

[/php]

Read Documentation ·

wpsc_end_category_query

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: None

Description: This template tag will end the category query, and start outputting the category loop

Code Example:
[php]
<?php wpsc_start_category_query(array(‘category_group’=> get_option(‘wpsc_default_category’), ‘show_thumbnails’=> 1)); ?>
<a href="<?php wpsc_print_category_url();?>" class="wpsc_category_grid_item <?php wpsc_print_category_classes_section(); ?>" title="<?php wpsc_print_category_name(); ?>">
<?php wpsc_print_category_image(get_option(‘category_image_width’),get_option(‘category_image_height’)); ?>
</a>
<?php wpsc_print_subcategory("", ""); ?>
<?php wpsc_end_category_query(); ?>
[/php]

Read Documentation ·

wpsc_start_category_query

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: $args array(‘parent_category_id’, ‘show_thumbnails’, ‘show_name’)

Description: This template tag will start the category query, you must do this in order to use most of the category template tags. This tag gets passed the query and makes it into a global variable, then starts capturing the html for the category loop.

Code Example:
[php]
<?php wpsc_start_category_query( array( ‘parent_category_id’ => $category_id, ‘show_thumbnails’ => $show_thumbnails, ‘show_name’ => $show_name) ); ?>
[/php]

Read Documentation ·
KIWI