Tips Tricks and Handy Code Snippets RSS feed for this section

Tutorial: Changing the grid view image to display in a lightbox instead of go to the single product

Someone asked in premium support today

How can I make my Grid view image link to the light box instead of the single product page?

This is not to hard to do, and I thought it would be something others might be interested in so I have put together a little tutorial below.

Note: This current tutorial only applies to the 3.8 theme files – it might work with 3.7 but this is untested.

(more…)

Read Documentation ·

Changing the product order from ascending to descending

WP-e-Commerce has a filter that you can  in your themes functions.php file to change the product order from ascending to descending. To change the order simply copy the function below.

[php]

add_filter( ‘wpsc_product_order’ , ‘change_product_order’ );

function change_product_order(){

return ‘desc’;

}

[/php]

Read Documentation ·

Get All Product Posts – using get_posts()

You can use the WordPress function get_posts() to get out all product posts you will need to adjust the $args to do a check for the post_type of  ‘wpsc-product’ for more information on get_posts see the WordPress Codex on get_posts

(more…)

Read Documentation ·

Checking if you’re on a product page

There are a few ways to check if your on a product page, you would most likely want to do this within your theme. for example on your page.php file when you call your side bars you might want to call a different side bar for product related pages.

(more…)

Read Documentation ·

Adding the Genesis SEO Settings to Products

Add this code snippet to your Genesis child theme to enable the built in SEO options for the product post type.

(more…)

Read Documentation ·

Adding the Genesis Layout Settings to Products

One cool thing I have noticed with Genesis is the ability to choose your Page Layout for each post and page, this will also work for your products you just need to add the product post type support

(more…)

Read Documentation ·

Excluding a category from the Products Page

Excluding a category from the Products Page

To exclude products that belong to a particular category from the products page (Default,list or Grid). One solution is to put this code in your selected products page template just after the loop begins. eg. If you are using Grid View, place it here.

(more…)

Read Documentation ·