w-ecommerce action,filter, template document - wordpress

piaoling  2013-08-22 12:16:17

Action Reference


Actions are triggered by specific events that take place in WordPress, such as publishing a post, changing themes, or displaying a page of the admin panel. Your plugin can respond to the event by executing a PHP function, which might do one or more of the following:

  • Modify database data
  • Send an email message
  • Modify what is displayed in the browser screen (admin or end-user)

The basic steps to making this happen (described in more detail below) are:

  1. Create the PHP function that should execute when the event occurs, in your plugin file.
  2. Hook to the action in WordPress, by callingadd_action()
  3. Put your PHP function in a plugin file, and activate it.

Actions run during a typical Products Page request

Actions run during a typical Product request

Products Page

  • wpsc_top_of_products_page: Top of Products Page (e.g. Live Search).
  • wpsc_theme_footer: Bottom of Products Page.
  • wpsc_product_before_description: Above Product description on Products Page.
  • wpsc_product_addons: After wpsc_product_before_description template hook on Products Page.

Single Page

  • wpsc_product_addon_after_descr: After Product description on Single Product page.


  • wpsc_before_shipping_of_shopping_cart: Before shipping tab on Checkout.
  • wpsc_before_form_of_shopping_cart: Before shopping cart form on Checkout.
  • wpsc_inside_shopping_cart: Inside Checkout fields on Checkout.
  • wpsc_bottom_of_shopping_cart: Used to add content/ functionality right at the bottom of the checkout page.

Transaction Results

  • wpsc_transaction_result_cart_item: Inside cart item on Transaction Results.
  • wpsc_confirm_checkout:

User Account

Settings Pages

  • wpsc_admin_settings_page: Bottom of Admin tab.
  • wpsc_taxes_settings_page: Bottom of Taxes tab.
  • wpsc_shipping_settings_page: Bottom of Shipping tab.
  • wpsc_general_settings_page: Bottom of General tab.
  • wpsc_presentation_settings_page: Bottom of Presentation tab.
  • wpsc_move_theme: Bottom of Move Themes dialog within Presentation tab.
  • wpsc_checkout_settings_page: Bottom of Checkout tab.


  • wpsc_purchlogitem_links_start: Bottom of Actions within Store Sales detail page.

Function Reference

Conditional Tags Index


wpsc_this_page_url – returns the current URL of this page

Products Page

  • wpsc_pagination – generates and returns the urls for pagination
  • wpsc_check_display_type – returns the display ‘view’ of the given Product Category
  • wpsc_output_breadcrumbs

Single Page

  • wpsc_output_breadcrumbs
  • gold_cart_display_gallery – displays the Product Gallery within Gold Cart
  • wpsc_product_image – returns Product image
  • wpsc_product_no_image_fallback – returns ‘no image’ if Product image is not provided
  • wpsc_show_pnp – returns the Product postage and packaging detail
  • wpsc_the_product_price – returns the Product price
  • wpsc_display_categories – checks whether to display Product on the page
  • wpsc_edit_the_product_link – returns the Product edit link
  • wpsc_the_product_title – returns the current Product title
  • wpsc_the_product_description – returns the current Product description
  • wpsc_the_product_additional_description – returns the current Product additional description
  • wpsc_the_product_permalink – returns the current Product URL
  • wpsc_product_external_link – returns the current Product external link if provided
  • wpsc_product_sku – returns the current Product SKU
  • wpsc_product_creation_time – returns the current Product date/time of creation
  • wpsc_check_variation_stock_availability – returns the availability of a given Product variation
  • wpsc_product_remaining_stock – returns the remaining stock of a given Product
  • wpsc_product_postage_and_packaging – display the current Products postage and packaging amount (only works for flat rate)
  • wpsc_product_normal_price – returns the normal price of a Product has a special price
  • wpsc_the_product_image – returns the URL to the featured Product image
  • wpsc_the_product_thumbnail – returns the Product image thumbnail
  • wpsc_the_product_image_link_classes – returns the classes assigned to the Product image container within the template
  • wpsc_product_comment_link – returns the Intense Debate link on the Product detail page
  • wpsc_product_comments – returns the Javascript for the Intense Debate feature on the Product detail page
  • wpsc_display_product_multicurrency – displays the different currency prices assigned to a Product
  • wpsc_product_rater – displays the ratings for a given Product
  • wpsc_you_save – displays the amount saved off a Product normal price

Filter Reference


Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Your plugin can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.

Product Filters

  • product_tag_cloud
  • wp_generate_product_tag_cloud
  • get_product_tags
  • product_tag_link
  • wpsc_locale – Change the default language displayed within WP e-Commerce.
  • wpsc_set_purchlog_statuses
  • wpsc_merchants_modules
  • wpsc_gateway_modules
  • the_products
  • wpsc_shipping_modules
  • wpsc_alter_database_template
  • wpsc_get_theme_files
  • wpsc_enqueue_user_script_and_css
  • user_registration_email
  • wpsc_product_stock
  • wpsc_downloadable_file_list
  • wpsc_jpeg_quality – Returns the value to use for image quality when generating Product image and thumbnails.
  • wpsc_coupon_rule_property_options
  • wpsc_packing_slip_header – Change the display of the Packing Slip header.

Sale Filters

Checkout Filters

Transaction Results Filters

  • wpsc_pre_transaction_results – Display content above the Transaction Results content.
  • wpsc_transaction_result_content – (int) purchase_id, (array) cart_item, (array) purchase_log

User Account Filters

  • wpsc_profile_message – (string) message
  • wpsc_account_form_field_ – ??

Building Themes

Skeleton Theme for WP e-Commerce 3.8

A WP e-Commerce theme can contain as little as a wpsc-default.css file, and as much as any full-fledged WP e-Commerce theme contains:

  • wpsc-default.css (required)
  • Template files (optional)
  • Template images (optional)

Template files

  • compatibility.css
  • wpsc-cart_widget.php
  • wpsc-category_widget.php
  • wpsc-default.css
  • wpsc-grid_view.php
  • wpsc-list_view.php
  • wpsc-products_page.php
  • wpsc-shopping_cart_page.php
  • wpsc-single_product.php
  • wpsc-transaction_results.php
  • wpsc-user-log.php

Template images

  • bulletpoint.gif
  • cart.png
  • delete.png
  • gold-star.gif
  • grey-star.gif
  • icon_window_collapse.gif
  • icon_window_expand.gif
  • indicator.gif
  • noimage.png
  • no_stock.gif
  • outofstock.png
  • sale.png
  • yes_stock.gif
  • yes_stock.png



A shortcode is a WordPress-specific code that lets you do nifty things with very little effort. Shortcodes can embed files or create objects that would normally require lots of complicated, ugly code in just one line. Shortcode = shortcut.


The [productspage] shortcode displays a complete list of Products, the presentation and filtering of Products is managed within the Settings > Store > Presentation tab of the WordPress Administration.

This shortcode is a required shortcode within WP e-Commerce as it is responsible for driving the Products Page, Product Category and Single Product templates.

The [shoppingcart] shortcode displays the Checkout page, site visitors manage the contents of their shopping basket and finalise their purchase.

This shortcode is a required shortcode within WP e-Commerce as it is responsible for driving the Checkout template.

The [transactionresults] shortcode displays the Transaction Results page, site visitors are notified of the status of their Sale as well as purchase summary.

This shortcode is a required shortcode within WP e-Commerce as it is responsible for driving the Transaction Results template.

The [userlog] shortcode displays the My Account page, logged-in site visitors can view existing Sales, update their Checkout details and download electronic purchases.

This shortcode is a required shortcode within WP e-Commerce as it is responsible for driving the My Account template.


  • [wpsc_products product_id='379'] – displays the product with teh ID or 379
  • [buy_now_button product_id='188'] – Displays a PayPal buy now button for the prdouct with the id of 188
  • [add_to_cart=379] – Display an add to cart button for the product with the ID of 379


Posted in Design and Layout


WordPress Widgets (WPW) [...] provide a simple way to arrange the various elements of your sidebar content (known as “widgets”) without having to change any code.

Dashboard Widgets

  • E-Commerce
  • Sales by Quarter

Sidebar Widgets

  • Admin Menu
  • Latest Products: Display Products on sale.
  • Price Range: Enable site visitors to narrow their Product search based on price sets.
  • Product Categories: Displays links to individual Product Categories.
  • Product Donations: Displays Products marked as a donation.
  • Product Specials: Displays products for which specials exist.
  • Product Tags: Displays a tag cloud of weighted Product tags.
  • Shopping Cart: Displays the shopping basket.
类别 :  wordpress(8)  |  浏览(179118)  |  评论(0)