Template Tags RSS feed for this section

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 ·

wpsc_parent_category_image

Located in: Located in: category.functions.php
Version Introduced: 3.8
Parameters Accepted: $show_thumbnails , $category_image , $width, $height, $grid=false, $show_name

Description: This template tag will get the parents category image URL and Link to the category, it will also check if its meant to display it or not. You would most likely want to use this tag within your category widget.

Code Example:
[php]
<a href="<?php echo $link; ?>" style="padding: 4px 4px 0 0; width:<?php echo $width; ?>px; height:<?php echo $height; ?>px;" title="<?php echo $curr_cat['name']; ?>" class="wpsc_category_grid_item">
<?php wpsc_parent_category_image( $show_thumbnails, $category_image , $width, $height, true ,$show_name); ?>
</a>
[/php]

Read Documentation ·

wpsc_gateway_form_field_style

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

Description: Selected gateways have form fields that are generated on the checkout page, for example Authorize.net and PayPal Pro. Use this template tag to output the form field styles.

Note: You must use this tag within the gateway loop. This template tag only returns the value so you must echo out the tag.

[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<?php if(wpsc_gateway_form_fields()): ?>
<table class=’wpsc_checkout_table <?php echo wpsc_gateway_form_field_style();?>’>
<?php echo wpsc_gateway_form_fields();?>
</table>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_gateway_form_fields

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

Description: Selected gateways have form fields that are generated on the checkout page, for example Authorize.net and PayPal Pro. Use this template tag to output and form fields that the gateway might have.

Note: You must use this tag within the gateway loop. This template tag only returns the value so you must echo out the tag. You should use the same tag as a conditional check before trying to output the form fields.

[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<?php if(wpsc_gateway_form_fields()): ?>
<table class=’wpsc_checkout_table <?php echo wpsc_gateway_form_field_style();?>’>
<?php echo wpsc_gateway_form_fields();?>
</table>
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_gateway_image_url

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

Description: Selected gateways have credit card images associated with them, to show what cards they accept, this template tag returns the image URL for each gateway.

Note: You must use this tag within the gateway loop. This template tag only returns the value so you must echo out the tag. You should use the following conditional to check if the gateway has an image before outputting it

[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<div class="custom_gateway">

<?php if( wpsc_show_gateway_image() ): ?>
<img src="<?php echo wpsc_gateway_image_url(); ?>" alt="<?php echo wpsc_gateway_name(); ?>" style="position:relative; top:5px;" />
<?php endif; ?>
[/php]

Read Documentation ·

wpsc_gateway_is_checked

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

Description: This template tag returns the HTML attribute for the input box (checked= ‘checked’ if the gateway is selected or blank if its unselected)

Note: You must use this tag within the gateway loop. This template tag only returns the value so you must echo out the tag.

[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<label><input type="radio" value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?> </label>[/php]

Read Documentation ·

wpsc_gateway_name

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

Description: This template tag returns the gateway Display name – you would use this tag within your gateway selection form to display the available gateway names for checkout.

Note: You must use this tag within the gateway loop. If you want the Gateway internal name (for generating the form) use the

 wpsc_gateway_internal_name(); 

template tag.

example below.
[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<label><input type="radio" value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?> </label>[/php]

Read Documentation ·

wpsc_gateway_internal_name

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

Description: This template tag returns the internal gateway name – you would most likely want to use within your gateway forms.

Note: You must use this tag within the gateway loop. If you want the Gateway display name use the

 wpsc_gateway_name(); 

template tag.

example below.
[php] <?php while (wpsc_have_gateways()) : wpsc_the_gateway(); ?> [/php]

Code Example:
[php]
<label><input type="radio" value="<?php echo wpsc_gateway_internal_name();?>" <?php echo wpsc_gateway_is_checked(); ?> name="custom_gateway" class="custom_gateway"/><?php echo wpsc_gateway_name(); ?> </label>[/php]

Read Documentation ·

wpsc_the_checkout_item_error

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

Description: This template tag returns the checkout error message for that form field.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag. Its important to check that there is an error before you try to output it see the simple check in the example below.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]

Code Example:
[php]
<td>
<?php echo wpsc_checkout_form_field();?>
<?php if(wpsc_the_checkout_item_error() != ”): ?>
<p class=’validation-error’><?php echo wpsc_the_checkout_item_error(); ?></p>
<?php endif; ?>
</td>
[/php]

Read Documentation ·

wpsc_checkout_form_field

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

Description: This template tag returns the checkout form field, users can configure their own form fields in the checkout settings – Using this template tag to generate your form fields will ensure the correct type of field is printed for every user.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]
Code Example:
[php]
<td>
<?php echo wpsc_checkout_form_field();?>
<?php if(wpsc_the_checkout_item_error() != ”): ?>
<p class=’validation-error’><?php echo wpsc_the_checkout_item_error(); ?></p>
<?php endif; ?>
</td>

[/php]

Read Documentation ·

wpsc_checkout_form_name

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

Description: This template tag returns the checkout form name, you would use this for generating the form names on your checkout form.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]
Code Example:
[php]
<tr class=’wpsc_change_country’>
<tr <?php echo wpsc_the_checkout_item_error_class();?>>
<td <?php wpsc_the_checkout_details_class(); ?> colspan=’2′>
<h4><?php echo wpsc_checkout_form_name();?></h4>
</td>
</tr>
[/php]

Read Documentation ·

wpsc_the_checkout_details_class

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

Description: This template tag returns the class for the shipping and billing details form (it will return a different class for each) you can use this class to style your different forms.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]
Code Example:
[php]
<tr class=’wpsc_change_country’>
<tr <?php echo wpsc_the_checkout_item_error_class();?>>
<td <?php wpsc_the_checkout_details_class(); ?> colspan=’2′>
<h4><?php echo wpsc_checkout_form_name();?></h4>
</td>
</tr>
[/php]

Read Documentation ·

wpsc_display_tax_label

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

Description: This template tag returns the tax label depending on the stores tax settings (Tax Included / Tax). You would use this function with

 wpsc_cart_tax(); 

To display the Tax label and the Tax value. This would most likely be used on the checkout page as part of the order total table.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]

For example:
[php]
<?php echo wpsc_display_tax_label() . ‘ ‘ . wpsc_cart_tax(); ?>
[/php]
Would display:

Tax Included: $10.00

Code Example:
[php]
<table class="productcart">
<tr class="total_price total_tax">
<td colspan="3">
<?php echo wpsc_display_tax_label(true); ?>
</td>
<td colspan="2">
<span id="checkout_tax" class="pricedisplay checkout-tax"><?php echo wpsc_cart_tax(); ?></span>
</td>
</tr>
</table>

[/php]

Read Documentation ·

wpsc_the_checkout_item_error_class

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

Description: This template tag returns the error class for the checkout item, you would use this class to style your errors.

Note: You must use this tag within the checkout loop, the class is only returned so you must echo the tag.
[php] while (wpsc_have_checkout_items()) : wpsc_the_checkout_item(); ?> [/php]
Code Example:
[php]
<tr class=’wpsc_change_country’>
<tr <?php echo wpsc_the_checkout_item_error_class();?>>
<td <?php wpsc_the_checkout_details_class(); ?> colspan=’2′>
<h4><?php echo wpsc_checkout_form_name();?></h4>
</td>
</tr>
[/php]

Read Documentation ·

wpsc_shipping_country_list

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

Description: This template tag is used to display the shipping country / region drop down lists used to calculate the users shipping, you would use this on the checkout page as it generates all the correct ID’s and classes for the drop down box that WP-e-Commerce requires to calculate the shipping.

Note: You must wrap this drop down list in a form tag for the shipping form to work correctly, it would be advised to keep the form exactly the same as the default one in WP-e-Commerce to avoid shipping errors.

Code Example:
[php]
<tr class=’wpsc_change_country’>
<td colspan=’5′>
<form name=’change_country’ id=’change_country’ action=” method=’post’>
<?php echo wpsc_shipping_country_list();?>
<input type=’hidden’ name=’wpsc_update_location’ value=’true’ />
<input type=’submit’ name=’wpsc_submit_zipcode’ value=’Calculate’ />
</form>
</td>
</tr>

[/php]

Read Documentation ·

wpsc_product_rater

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

Description: This template tag is used to display the product rater you would use it on your product templates, it must be used within the product loop.

NOTE: The product rating setting must be turned on with your store settings / marketing for this to work. This Tag will onyl return the HTML so you must echo it to your browser for it to display.

Code Example:
[php]
<div id="product_rating">
<?php echo wpsc_product_rater(); ?>
</div>
[/php]

Read Documentation ·

wpsc_loading_animation_url

Located in: Located in: display.functions.php
Version Introduced: 3.8
Parameters Accepted: $price_in (the product price), $args

Description: This template tag is used to echo the URL to the loading image that WP-e-Commerce uses for its product pages (when items are added to the cart). This template tag can also be filtered so you can change the url if you want to use another image.

Code Example:
[php]
<div class="wpsc_loading_animation">
<img title="Loading" alt="Loading" src="<?php echo wpsc_loading_animation_url(); ?>" />
<?php _e(‘Updating cart…’, ‘wpsc’); ?>
</div><!–close wpsc_loading_animation–>
[/php]

Read Documentation ·

wpsc_you_save

Located in: Located in: product-template.php
Version Introduced: 3.8
Parameters Accepted: $args ($product_id = defaults to the current product id if used within the loop, $type – percentage / amount, Variations)

Description: This template tag is used to display the “you save” price or percentage for products that are on special. You would use this tag within your products pages.

Note: Use this tag inside the product loop for best results, this function will not return a $ or % sign it will only return the difference amount.

Code Example:
[php]
<?php echo ‘$’ . wpsc_you_save(‘type=amount’); ?>
[/php]

Read Documentation ·

wpsc_currency_display

Located in: Located in: processing.functions.php
Version Introduced: 3.8
Parameters Accepted: $price_in (the product price), $args

Description: This template tag is used to display the product price and currency symbol int he correct place as per the users store settings, WP-e-Commerce uses this function to display the you save price for products on special

NOTE: the template tag the_product_price already wraps the price in this function so using it is not required.

Code Example:
[php]
<p class="pricedisplay product_<?php echo wpsc_the_product_id(); ?>"><?php _e(‘You save’, ‘wpsc’); ?>: <span class="yousave" id="yousave_<?php echo wpsc_the_product_id(); ?>"><?php echo wpsc_currency_display(wpsc_you_save(‘type=amount’), array(‘html’ => false)); ?>! (<?php echo wpsc_you_save(); ?>%)</span></p>

[/php]

Read Documentation ·

wpsc_calculate_price

Located in: Located in: product-template.php
Version Introduced: 3.8
Parameters Accepted: $product_id

Description: This template tag is used to return the product price, it will take into account special prices and variations. It accepts one parameter which is the product ID.

NOTE: If using this tag inside the product loop you can use

 wpsc_the_product_id(); 

as the product ID.

Code Example:
[php]
<input type="text" id="donation_price_<?php echo wpsc_the_product_id(); ?>" name="donation_price" value="<?php echo wpsc_calculate_price(wpsc_the_product_id()); ?>" size="6" />
[/php]

Read Documentation ·

gold_shpcrt_display_gallery

Located in: Located in: Gold Cart Files
Version Introduced: 3.8

Description: This template tag is used to output the Gold Cart gallery, you would normally use this on your single products page.

Note: For this template tag to work the user must have Gold Cart installed and the “Show thumbnail Gallery” setting set yo yes.

Because not all users will have Gold Cart installed its best to check if the function exists before calling it.

Code Example:
[php]
<?php
if ( function_exists( ‘gold_shpcrt_display_gallery’ ) )
echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
?>
[/php]

Read Documentation ·

wpsc_buy_now_button

Located in: Located in: display.functions.php
Version Introduced: 3.8
Parameters Accepted: $product_id

Description: This template tag is used on output the PayPal buy now button instead of the add to cart button.
This tag accepts the product ID as a paramter you can use this function within the product loop and use

 wpsc_the_product_id() 

for the ID. Otherwise if used outside of the product loop you can just enter in any product ID.

Note: It’s best to check if the user has this option turned on in their settings before just out putting the button you can check for that like this:

[php]<?php if((get_option(‘hide_addtocart_button’) == 0) && (get_option(‘addtocart_or_buynow’)==’1′)) : ?>[/php]

Code Example:
[php]
<?php if((get_option(‘hide_addtocart_button’) == 0) && (get_option(‘addtocart_or_buynow’)==’1′)) : ?>
<?php echo wpsc_buy_now_button(wpsc_the_product_id()); ?>
<?php endif ; ?>
[/php]

Read Documentation ·

wpsc_this_page_url

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

Description: This template tag is used on out the url of the current page – you would mostly use this within your forms as the action when checking for an external link (advanced product option)

Code Example:
[php]
<?php if(wpsc_product_external_link(wpsc_the_product_id()) != ”) : ?>
<?php $action = wpsc_product_external_link(wpsc_the_product_id()); ?>
<?php else: ?>
<?php $action = wpsc_this_page_url(); ?>
<?php endif; ?>

[/php]

Read Documentation ·

wpsc_output_breadcrumbs

Located in: breadcrumbs.class.php
Version Introduced: 3.8

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

Note: Breadcrumbs will only be output if the user has them turned on in the store settings.

Code Example:
[php]
<div id="single_product_page_container">
<?php
// Breadcrumbs
wpsc_output_breadcrumbs();

// Plugin hook for adding things to the top of the products page, like the live search
do_action( ‘wpsc_top_of_products_page’ );
?>
<div class="single_product_display group">
<?php

[/php]

Read Documentation ·

wpsc_user_details

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

Description: This template tag is used on the users “My Account” page. You would use this tag to display the purchase history and receipt details.

Code Example:
[php hightlight="16"]

<?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 : ?>

<tr>
<td colspan="<?php echo $col_count; ?>">

<?php _e( ‘No transactions for this month.’, ‘wpsc’ ); ?>

</td>
</tr>

<?php endif; ?>

</table>

[/php]

Read Documentation ·

wpsc_display_form_fields

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

Description: This template tag is used on the users “My Account” page. You would use this tag to display to forms fields for the users my account information (shipping / billing address etc)

Note: Use with

 validate_form_data(); 

to return a form with validation.

[php]

Code Example:
[php]
<!– START OF PROFILE PAGE –>
<?php if ( is_wpsc_profile_page() ) : ?>

<form method="post">

<?php echo validate_form_data(); ?>

<table>

<?php wpsc_display_form_fields(); ?>

<tr>
<td></td>
<td>
<input type="hidden" value="true" name="submitwpcheckout_profile" />
<input type="submit" value="<?php _e( ‘Save Profile’, ‘wpsc’ ); ?>" name="submit" />
</td>
</tr>
</table>
</form>

[/php]

Read Documentation ·

validate_form_data

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

Description: This template tag is used on the users “My Account” page. You would use this tag within the form that allows the user to update their details (Billing shipping etc).

It will return an array of error messages if an error is found int he form otherwise an update message if the details have been updated.

Note: Use with

 wpsc_display_form_fields(); 

to generate the default form fields.

[php]

Code Example:
[php]
<!– START OF PROFILE PAGE –>
<?php if ( is_wpsc_profile_page() ) : ?>

<form method="post">

<?php echo validate_form_data(); ?>

<table>

<?php wpsc_display_form_fields(); ?>

<tr>
<td></td>
<td>
<input type="hidden" value="true" name="submitwpcheckout_profile" />
<input type="submit" value="<?php _e( ‘Save Profile’, ‘wpsc’ ); ?>" name="submit" />
</td>
</tr>
</table>
</form>

[/php]

Read Documentation ·

wpsc_the_variation_name

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

Description: This template tag is used to print the variation Name (This is the post title for the variation eg size, medium, large).

Note: This template tag only returns the Name so to display in on your page you must echo the tag, it must also be used within the variation loop. You would most likely use this within form tags on your products pages

[php]

Code Example:
[php]
<?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
<option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock(); ?>><?php echo wpsc_the_variation_name(); ?></option>
<?php endwhile; ?>
[/php]

Read Documentation ·

wpsc_the_variation_out_of_stock

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

Description: This template tag is used to prints the HTML attribute to disable select options and radio buttons. You would use thi on your products page templates to ensure out of stock products can not be selected from the variation drop down menu.

Note: This template tag only returns the HTML so to display in on your page you must echo the tag, it must also be used within the variation loop.

Code Example:
[php]
<?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
<option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock(); ?>><?php echo wpsc_the_variation_name(); ?></option>
<?php endwhile; ?>
[/php]

Read Documentation ·

wpsc_the_variation_id

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

Description: This template tag is used to print the variation ID (This is the post id for the variation).

Note: This template tag only returns the ID so to display in on your page you must echo the tag, it must also be used within the variation loop. You would most likely use this within form tags on your products pages

[php]

Code Example:
[php]
<?php while (wpsc_have_variations()) : wpsc_the_variation(); ?>
<option value="<?php echo wpsc_the_variation_id(); ?>" <?php echo wpsc_the_variation_out_of_stock(); ?>><?php echo wpsc_the_variation_name(); ?></option>
<?php endwhile; ?>
[/php]

Read Documentation ·

wpsc_vargrp_id

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

Description: This template tag is used to print the variation group ID (For example Size – This is the Post Parent). You would normally use this within your variation forms etc

Note: This template tag only returns the ID so to display in on your page you must echo the tag, it must also be used within the variation loop.

[php]

Code Example:
Used within the loop
[php]
<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>

<tr><td class="col1"><label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label></td>

[/php]

Read Documentation ·

wpsc_the_vargrp_name

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

Description: This template tag is used to print the variation group name (For example Size). You would normally use this on your product page templates before the variation drop down list.

Note: This template tag only returns the name so to display in on your page you must echo the tag, it must also be used within the variation group loop.

[php]

Code Example:
Used within the loop
[php]
<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
<tr><td class="col1"><label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label></td>
<?php /** the variation HTML and loop */?>
<td class="col2"><select class="wpsc_select_variation" name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>">

[/php]

Read Documentation ·

wpsc_vargrp_form_id

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

Description: This template tag is used to print the variation group form id, you would mostly want to use this for printing form labels and IDS.

Note: Its normally best to just copy the existing variation code that generates the drop downs from the default WP-e-Commerce theme files. The reason for this is that WP-e-Commerce uses these ID’s and names to reference alot of JavaScript. coping the select boxes will help avoid problems further down the line with validation and trying to add variations to the cart. To style them further you can always add additional classes and adjust the CSS.

This function must be used within the variation group loop.

Code Example:
Used within the loop
[php]
<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>

<tr><td class="col1"><label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label></td>

[/php]

Read Documentation ·

wpsc_product_comments

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

Description: This template tag is used to display the intense debate comments these must be turned on within your presentation settings page and you must also have an account with intense debate. This template tag will return a JavaScript string.

Note: This function accepts no parameters so to use it you just echo the function (must be called witin the product loop)

Code Example:
[php]
<?php echo wpsc_product_comments(); ?>
[/php]

Read Documentation ·

wpsc_custom_meta_value

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

Description: This template tag is used to display the custom meta value.

Note: This function accepts no parameters but must be used within the custom meta loop.
[php]<?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>[/php]

Code Example:
[php]
<?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>
<strong><?php echo wpsc_custom_meta_name(); ?>: </strong><?php echo wpsc_custom_meta_value(); ?><br />
[/php]

Read Documentation ·

wpsc_custom_meta_name

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

Description: This template tag is used to display the custom meta name.

Note: This function accepts no parameters but must be used within the custom meta loop.
[php]<?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>[/php]

Code Example:
[php]
<?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>
<strong><?php echo wpsc_custom_meta_name(); ?>: </strong><?php echo wpsc_custom_meta_value(); ?><br />
[/php]

Read Documentation ·

wpsc_the_sticky_image

Located in: theme.functions.php
Version Introduced: 3.8
Parameters Accepted: $product_id

Description: This template tag is used to print the fatured product image – It will hook into the “top_of_products” page action normally, but you can use it however you like. It accepts one parameter and that is the product ID.

Note: This function just returns the link so to use this function you must use it with an echo to output the link to the browser.

Code Example:
Used within the loop
[php] <?php while (wpsc_have_products()) : wpsc_the_product(); ?>
<?php echo wpsc_the_sticky_image( wpsc_the_product_id() ); ?>[/php]
Outside the loop – product Id of 123
[php]
<?php echo wpsc_the_sticky_image( 123 ); ?>[/php]

Read Documentation ·
KIWI