WP e-Commerce no images in “People who bought this also bought”

Posted by on Oct 6, 2012 in Blog, WP e-Commerce | No Comments

This is a WP e-Commerce bug

When “Display Cross Sales” is activated on Settings/Store/Marketing tab the “People who bought this item also bought” section displays on the single product page. The display does not include the product thumbnail as the location for the thumbnail generated by the plugin is incorrect. As of version 3.8.8.5 this bug still exists. This code diff on code.google covers the changes required to make it work. Some of these changes have been implemented in 3.8.8.5, some not. This makes it a bit confusing, and diffs are very confusing for any non developer anyway. So I poked through it carefully and made the changes. tested and have verified images are working.

The PHP code fix

You can download the working file here. The file should be unzipped and uploaded to the wp-content/plugins/wp-e-commerce/wpsc-includes folder to replace the existing display.functions.php file.

CSS layout fix

You will have a vertical stack of images with product title and price aligned left and together once you do the change above. Add this CSS to fix the layout.

/*align images, set text centering*/
.wpsc_also_bought_item {
     float: left;
     margin-right: 20px;
     text-align: center;
}
/* set price width so text centers*/
.wpsc_also_bought_item span.pricedisplay {
     width: 100%;
}
/* set product title width so text centers*/
.wpsc_also_bought_item a.wpsc_product_name {
     float: left;
     width: 100%;
}

Custom CSS:

This code belongs in your Custom CSS file. Don’t have a custom.css?
If using a Storefront theme you can also just paste this code in the “Custom CSS” box in the Storefront options panel on the Style tab.

Tools:

You may also edit custom.css outside WordPress and upload it to your server. You must use an appropriate code editor NOT microsoft word or anything like that which adds a lot of invisible formatting and will be a disaster.
If you do not have one, 2 excellent free ones are…
TextWrangler for Mac, http://www.barebones.com/products/textwrangler/
Notepad++ for the PC http://notepad-plus-plus.org/

Leave a Reply