Support » Plugins » Problem with WP E-commerce Function wpsc_the_category_title

  • Resolved vanessaking


    I’m having an issue with the WP E-commerce wpsc_the_category_title function. I can’t understand what is causing it to work when it does, and not work when it doesn’t. When it works, it should be writing the single product category’s name at the top of the single product’s listing page; and it should write ‘All Products’ at the top of a list of—you guessed it—all the products.

    What it is currently doing is writing the product category name when the product has 1 item, or any number of items except 0 or 2 with the exception of two categories, or… It’s maddening because it varies depending on which item is selected under Settings > Store > Presentation > Sort Product By: Name, Price, Drag & Drop, or Time Uploaded.

    There are two product categories which are always listed with their product category names, and five categories which are never listed with their product category names at the top of the page.

    The categories that always have their names written at the top of the listings page all have 1 product,the two which never have their names written have two and three products respectively, but they are not the only categories which only have two or three categories.

    The site is at, and a few of the listings are here:

    Never show product category name:

    Shows the product category name only when ‘Price’ is selected on the Presentation Settings page:

    Shows the product category name only when ‘Name’ or ‘Drag & Drop’ are selected on the Presentation Settings page:

    I’ve scanned through theme.functions.php and removed filters, but that didn’t change anything. I’ve put them all back, so it is as it was out of the box, so to speak.

    Any help would be so greatly appreciated, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • vanessaking


    UPDATED: I’ve made some of the ‘fixes’ I’ve found, but now it’s doing the dreaded ‘First product named after the category’ thing.

    I’d found a patch, but not sure where it’s meant to go or what it’s meant to replace (the documentation, all the way around, is negligible). Now my problem is a dozen times worse than it was and I’m still not sure how to fix it.



    RESOLVED: I think I’ve finally solved this problem which, by the way, started doing the dreaded ‘Replaces the first product title with category title…’ thing!

    In approximately line 1241 of theme.functions.php, in wpsc-includes, the enable page filters function:

    `function wpsc_enable_page_filters( $excerpt = '' ) {
    add_filter( 'the_content', 'add_to_cart_shortcode', 12 ); //Used for add_to_cart_button shortcode
    add_filter( 'the_content', 'wpsc_products_page', 1 );
    add_filter( 'the_content', 'wpsc_single_template',12 );
    add_filter( 'archive_template','wpsc_the_category_template');
    add_filter( 'the_title', 'wpsc_the_category_title',10,2 );
    add_filter( 'the_content', 'wpsc_place_shopping_cart', 12 );
    add_filter( 'the_content', 'wpsc_transaction_results', 12 );
    add_filter( 'the_content', 'wpsc_user_log', 12 );
    return $excerpt;


    The line which applies to the category title, line 1246:

    add_filter( 'the_title', 'wpsc_the_category_title',10,2 );

    I changed the priority from 10,2 to 10,1, so that line changes to:

    add_filter( 'the_title', 'wpsc_the_category_title',10,1 );

    That solved all my troubles and I hope it can solve yours, too!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with WP E-commerce Function wpsc_the_category_title’ is closed to new replies.