Good Looking Product Photos for WordPress Shopping Cart Plugin

The best WordPress Shopping Cart Plugin available to date is definitely the one from Instinct Entertainment. The shopping cart comes with 3 free themes and each is ready to be customized extensively.
I know there have been some browser problems with some of the themes but I think they have been worked out.

You can choose from several low cost modules to add on to the free version of the shopping cart plugin in order to have a gallery of multiple images under the main product photo, amongst other cool extras.

When it comes to the main product photo, the one you upload first when adding a new product, you may have experienced some difficulty with the way the resulting thumbnail image is cropped and re sized after uploading. This is the most important picture because its the one customers will see first. It’s been my experience that all product photos turn out the best if shot against a white background with an equal amount of empty space around the item at the top, sides and bottom.You’re going to really want to strive for uniformity because more often than not your product pages are going to show more than one product at a time.

Take a look at these 2 pictures:

goodtoo closely cropped

You can see in the 1st photo there is enough space around the product to result in a nicely resized thumbnail image. But the second photo will get chopped off because there’s not enough space around the product.

This is a screen shot of a row of products with photos that all had the same amount of white space:

a neat row of pictures
ex.1

In the second screen shot, the 1st product photo in the row shows what happens when there is too much space at the top of the model’s head and not enough at the bottom of her feet. And because the other photos in the same row have different cropping and background colors, this row does not look as neat and clean as the first.

a not so neat row
ex.2

Many online customers judge an ecommerce website’s “trustability” by how professional it looks. So spending a little extra time on your product photos will pay off with professional-looking product pages.

Revised Fake Grid View

Updated April 19th 2009

If you are using the latest version of the WordPress Shopping Cart plugin, version 3.12.6, please read my latest post on the subject:
“Revised File for Fake Grid View”
The following post is helpful but the file to be downloaded was written for version 3.6.7.

I use wpsc when I mean WordPress Shopping Cart.
Here is a re write of an earlier post on “faking” Grid View(for wordpress shopping cart plugin).
My earlier post did not take into account, beyond styling the page with CSS, the functions in homepage_products_functions.php and how the output of this file varies from the real grid view product display.
So if you have purchased Grid View you should be able to use the Cart Icon button in the Post or Page editor to insert a wpsc category into a Post or Page and have it display just like Grid View,right? I thought so. But it doesn’t work that way.Inserting a single category into a page results in a page that looks a lot like grid view but acts quite differently.

Some key differences between using homepage_products and the grid view
Inserting a wpsc category into a Page(shortcode is for homepage_products) displays a thumbnail gallery of all products from one category and their product titles. If you use “Full” your page will not look like Grid View. If you don’t select Full you will get close to faking Grid View ( if you have the correct CSS to do so). But a Fake Grid View page has one little problem:the thumbnail image does not link to the single product display page(like in Grid View).Instead,it links to the thumbnail image.Which means a thumbnail image will pop up where a full size image should.
Continue reading Revised Fake Grid View

Invalid argument foreach() error in WordPress Shopping Cart Plugin

my cart iconFor the longest time I held off upgrading any of my client’s stores using WP-Shopping Cart plugin because on my test install of WP I could not get RC1 3.6.8 to work.But it really bothers me not to use the latest version of something so on one client site I did the upgrade and tested it out.I got the same exact errors I got on my test install after trying to checkout/submit and have the payment sent to PayPal.

The old invalid argument foreach() error.

Going to the forum I did not see a way to fix this probably because everyone has different causes for this error? I’m not really sure but there should be definite documentation on how to get rid of so people can have a working cart.

Error Log Messages
This error:
WordPress database error Unknown column ‘files’ in ‘field list’ for query INSERT INTO `wp_cart_contents` ( `prodid` , `purchaseid`, `price`, `pnp`, `gst`, `quantity`, `donation`, `no_shipping`, `files` ) VALUES (’18’, ’75’,’64.50′,’0′, ‘0’,’1′, ‘0’, ‘1’, ”) made by nzshpcrt_submit_checkout

Led to this error:

PHP Warning: Invalid argument supplied for foreach() in /xxx/web10/xxxx/pow.xxxl/htdocs/site/wp-content/plugins/wp-shopping-cart/merchants/paypal_multiple.php on line 82

And this all led to the cart being empty and the logs printing the price as 0.00. If the cart can’t put the order into the wp_cart_contents table it can’t process the order. Not being able to fill in the info leads to a PHP error.

Let’s look at this message again:
WordPress database error Unknown column ‘files’ in ‘field list’ for query INSERT INTO `wp_cart_contents` ( `prodid` , `purchaseid`, `price`, `pnp`, `gst`, `quantity`, `donation`, `no_shipping`, `files` ) VALUES (’18’, ’75’,’64.50′,’0′, ‘0’,’1′, ‘0’, ‘1’, ”) made by nzshpcrt_submit_checkout

Everyone of those fields has to be in the wp_cart_contents table in your WP database.If your cart works perfectly all the way up to trying to test if orders can be processed- chances are when you upgraded a field or 2 even were not created.This can happen to WP upgrades as well.It is not a failing of the cart plugin.The fact that some people have no problem upgrading anything speaks to this.

The wp_cart_contents table.
——————-Type——– –Collation — —-Attributes— — — —Null—- — Default
purchaseid—–bigint(20) ——– —– — -UNSIGNED— – — — -No—— ——0
prodid—— – bigint(20) —– —— — — -UNSIGNED– — — –No—— ——0

——————Type———- —–Collation——- —-Attributes— ——Null——-Default
price——-varchar(128)——–latin1_swedish_ci ————– ——–No———-0
pnp———varchar(128)——–latin1_swedish_ci ——– — —– —-No———-0
gst ———varchar(128)——–latin1_swedish_ci ——- ——— – — No———0
quantity– –int(10)———————————— -UNSIGNED— — No ———-0
donation– -varchar(1) ——— latin1_swedish_ci—- —— — —— No ———0
no_shipping – varchar(1)——–latin1_swedish_ci ——— —- — — – No ———- 0
files ——- —text—————-latin1_swedish_ci——— —— — — No ———-

I know it isn’t really a table but it will have to do.

Fixing It
First check your error logs. It’s good to check your error logs the very first sign of trouble. If you can see the same kind of errors that I printed here you are having the same problem I was: field files was not added to the wp_cart_contents table when I upgraded. How pesky.

1st, log into your control panel find Manage Mysql and when you are in the manage mysql area, click on Administer for your WordPress database.

When you are in, look in the left side panel for wp_cart_contents. Click on it.

Please check to see if a “files” line has been added after the no_shipping line in wp_cart_contents.
If not, don’t be scared. It is easy-peasy to add a field to a database table.If the field called files is already there your problem is being caused by something else.Check the table for missing fields you can use my ugly “graph” up above.There should be 9 fields.If anyone of these fields is missing from the table you are going to get the invalid argument foreach() error.

If the field for “files” was not added – no_shipping will be the last field in this table.It was for me.

Look for this option it’s usually underneath the bottom of the table (my host uses phpMyAdmin some other managers will be set up differently).

Add 1 field(s) At End of Table.

Leave the 1 field to be added. Leave the radio button for At End of Table selected.

Then look for the go button-Click go.

In the Field text box, type files and use all use lowercase.

In VARCHAR dropdown list, select TEXT.

Leave everything else alone and click the save button.It’s very important to save it or the field will not get added.

Test it Out!
You should now be able to add an item to the cart and checkout and send the payment to PayPal with no more errors and blank orders in the purchase logs,

if all your checkout and payment settings in the admin for the plugin are correct and there aren’t any other issues with the plugin besides the ones I have written about.

Get Grid View Without the Gold Cart

gratuitous blog post imageWPSC means WordPress Shopping Cart, a plugin for WordPress.

What: Too cheap to buy a Gold Cart Module for your WPSC plugin? Well, it isn’t only out of cheapness that I’m writing this (anyway I make my clients buy the module for other reasons like more payment gateways than PayPal) it’s the constant battle to optimize SEO. This shopping cart plugin is possibly the best thing to happen to WordPress but it gives less than great SEO. Duplicate title tags,missing or too short meta descriptions.

How: Use the WordPress editor in Visual Mode to insert a product group into a Page or Post.

The more familiar I get with how low ranking websites get knocked for duplicate content (yep, Google gives more leeway to popular sites with loads of incoming links and high page rank) the more value I see in adding a product group/category to a page or post rather than use the one page to show your entire store.

The editor in HTML mode will not show the shopping cart button. And if you turned this option off in your user profile you won’t ever see this button. So go to your user profile and turn Use Visual Editor back on.
So go to Write > Page and click on the cart icon to choose a category from product groups. Select, insert,save. Once you preview you’ll see that the products scroll down the page.
Don’t publish just yet.

Here is some sweet sweet CSS to fake the Grid View, save 20 bucks and get some good SEO working (that those rich guys that paid for Grid View probably won’t have).
This part is so incredibly easy I could kiss myself. In fact I will.

Fake Grid View CSS
Add this to style.css in your theme folder:
[css]
#homepage_products{overflow:hidden;}
#homepage_products .category_view_product .product_details .wpsc_product_title{font-size:12px;}
#homepage_products .category_view_product{width:200px;height:300px;float:left;margin:8px 3px;}
[/css]
The height and width and margins will have to be tweaked to fit your wishes.You can make the product titles smaller and change color.You can also have borders.It’s wide open for customization.But the float:left is what matters and creates the grid.Having overflow:hidden in the wrapper div keeps the page from looking screwy.

SEO
Next thing is to download the All in One SEO pack plugin for WordPress, unzip, upload to plugins folder, activate settle up the options and go back to your almost done Page or Post.Pop open the All in One SEO box in the editor page, below Categories. You’ll see title,description and keyword fields. Writing in your description will solve the short or missing meta description problem. If you used a post you can skip the keywords field and use tags instead. Tags are better anyway.

Use a Page or a Post?
In WordPress categories are king and you can great things with category templates.You can only use categories with posts. I would rather be able to place a single product into a Post.I think this would open up a lot more flexibility in using this plugin. This is supposed to be an option in the latest release of the plugin but either it doesn’t work or I have another plugin that breaks the button code for this. Entirely possible.

Last but not least tweak your header.php. Look for the line with html]blah blah blah [/html] delete it and paste this in it’s place:
[php]<title><?php

// Page or Single Post
if ( is_page() or is_single() ) {
the_title();

// Category Archive
} elseif ( is_category() ) {
printf( __(‘Archive for &lsquo;%s&rsquo;’), single_cat_title(”, false) );

// Tag Archive
} elseif ( function_exists(‘is_tag’) and function_exists(‘single_tag_title’) and is_tag() ) {
printf( __(‘Tag Archive for &lsquo;%s&rsquo;’), single_tag_title(”, false) );

// General Archive
} elseif ( is_archive() ) {
printf( __(‘%s Archive’), wp_title(”, false) );

// Search Results
} elseif ( is_search() ) {
printf( __(‘Search Results for &lsquo;%s&rsquo;’), get_query_var(‘s’) );
}

// Insert separator for the titles above
if ( !is_home() and !is_404() ) {
_e(‘ at ‘);
}

// Finally the blog name
bloginfo(‘name’);

?></title>[/php]

That helps take care of the duplicate title problem for categories and archives.
The all in one seo pack does most of the work and this does the rest. It’s very cool.