Nov
02

How to customise WP e-Commerce Breadcrumbs

I’m posting this here as there doesn’t seem to be any documentation on how to do this. The WP e-Commerce plugin is a decent shopping cart plugin for WordPress, unfortunately it’s documentation is rather poor!

The breadcrumbs (once enabled via the settings in the admin panel) display a breadcrumb trail on your product pages. by default is looks something like this:

Store Name » Products Page » Category Name » Product Name

To edit the output you need to edit the function in the theme files. The function is:

<?php wpsc_output_breadcrumbs (); ?>

You can pass an array of arguments to the function. Your options are:

'before-breadcrumbs' => '<div class="wpsc-breadcrumbs">',
'after-breadcrumbs'  => '</div>',
'before-crumb'       => '',
'after-crumb'        => '',
'crumb-separator'    => ' &raquo; ',
'show_home_page'     => true,
'show_products_page' => true,
'echo'               => true

Now simply pass your arguments to the function, for example:

<?php wpsc_output_breadcrumbs ( array (
 'crumb-separator'    => ' &gt; ',
 'show_home_page'     => false,   
) ); ?>

The above would display breadcrumbs with ‘>’ as a separator and removes the homepage:

Products Page > Category Name > Product Name

I also think its best to put your breadcrumb function in a separate file e.g ‘wpsc-breadcrumbs.php’ then include it in each instance:

<? include "wpsc-breadcrumbs.php"; ?>

This way you don’t need to edit it multiple times should you decide to change something in the future.

I hope this can be of help to someone!

Jan
26

How to display browser specific widgets in WordPress

BrowsersThe huge array of plugins available for WordPress is one of it’s most appealing aspects. Unfortunately not all are cross-browser compatible especially with older versions of Internet Explorer.

CSS can fix most visual problems however sometimes the javascript used by a plugin throws up an ugly error message, a common one in IE6 & IE7 versions is: “An error has occurred with a script on this page”. It prompts the user to choose whether to stop running all scripts or not. Read the rest of this article

Our Prices RSS Feed