Fixing A WordPress Theme to Work with WP-E-Commerce 3.8.9 (or whatever)

I was contacted to fix a WP theme I did not design called Kassyopea – a premium theme that costs $55 for a regular license, $2750 for an extended license.

Error number 1: clicking the add to cart button with Fancy Notifications turned on showed the item in the fancy notification message overlay but didn’t actually add the item to the cart (going to check out you got the message “oops cart is empty”).With Fancy Nootifications turned off all you saw when clicking add to cart was “..Updating” and a little spinner icon but that’s it.Updating never went away and the items were never added to the cart.

So off I went to getshopped.org to check out the user forums and saw this exact same issue was marked Resolved, a rare thing if you’ve ever visited a forum for help with your exact issue. A user suggested de activating all the plugins except the shopping cart and switching over to TwentyEleven ( or any other “proven” WP theme) then go to Settings > Store and then to Presentation and click Flush Theme Cache a few times. I also turned off Fancy Notifications in Settings > store > Presentation. After I did that I went back to the shop and added something to the cart, now the add to cart button worked. I re activated the plugins and switched back to Kassyopea and then went back to Settings > Store and then to Presentation and clicked Flush Theme Cache a few times and then a few more times just to be safe.
The add to cart button worked with Fancy Notifications turned back on – one issue fixed!

Now we just had to deal with the fact that after the normal product listing – about 4 or 5 un-styled, duplicated products were also appearing on the page.
I had fixed this before – it’s always a matter of placing wp_reset_query(); in the right place…

Being too lazy to get an FTP login set up I went right over to Appearance > Editor > page.php and experimentally – just to see what would happen – clicked save without editing anything. Big oops now the page displayed with a big PHP error – somehow just saving the page did something bad!

Oh fab, can I please debug code I didn’t write? That’s what I like to do in my spare time, yay. Unfortunately I didn’t save the original but here is the corrected code in page.php:

[php]
if( is_front_page() || is_home() ) {
add_filter( ‘body_class’, create_function( ‘$classes ="", "$classes[] = wpsc;" return $classes;’ ) );
get_template_part( ‘home’, ‘store’ );
die;
}[/php]

After the last curly brace I added wp_reset_query(); now the code looks like this:

[php]
if( is_front_page() || is_home() ) {
add_filter( ‘body_class’, create_function( ‘$classes ="", "$classes[] = wpsc;" return $classes;’ ) );
get_template_part( ‘home’, ‘store’ );
die;
}
wp_reset_query();
[/php]

No more duplicated products on the Shop using WP theme Kassyopea.

So there you have it. If you are having the problem where your add to cart button doesn’t work try switching to a different theme and in Presentation flushing the theme cache 2 or 3 times.Most plugin authors will say it’s another plugin and that is true some of the time but the other part of the time it’s usually the theme you’re using.

And you’re seeing duplicated products it’s probably because there is something like this in the theme:

[php]if( is_front_page() || is_home() ) {

//special code

}

[/php]

Update

After I wrote this the site owner wrote me to tell me that the add to cart button wasn’t working. I did everything all over again and tested the button. It worked.
Then I cleared the cart items and it didn’t work. The add to cart button always worked with TwentyEleven and TwentyTen even after I cleared cookies. I poked and prodded and changed settings and etc, etc, etc nothing helped. The add to cart button just didn’t work.

Unfortunately I ended up giving up on fixing it.

The weirdest part of this whole thing was the site owner had the almost exact same site set up using the exact same theme with almost exact same domain (other domain ended in .com, this one ended in .com.au). On this set up the Home page contained the productspage shortcode and also had a products Page that also had the products page shortcode. On this site, the add to cart button worked all the time! What a head scratcher.

A WordPress Theme Built Especially For The WP-Ecommerce Plugin!

Update! I’m finally done, Whew!

Here is Color-Cart Green ( I know, I couldn’t think of a good name.All my brain cells went toward making the thing).
[download id=”4″]
Also, there is Color-Cart Black but it costs 10 whole dollars! Please take the test drive and hopefully you will like it enough to buy it. If this new venture goes well I plan to release more free themes. In fact I think I will release one free theme for every paid one. That’s a tentative promise!

Hi Everybody. For the last few days I have been working on a new theme for WordPress specifically a theme centered around using the WP ECommerce plugin. Right now there is only one other free Premium quality WP theme I know of that is centered around the shopping cart plugin .

I’m not competing with King Cart’s design, which is super cute especially that smiling apple in the little banner. Perhaps the trend of the mega banner has run its course? It makes sense to reduce the size of the banner:it frees up valuable real estate on the site above the fold. The navigation menu is positioned extremely well so that the hover dropdown lists don’t fall down over the page content- a tendency of crowded web sites and kind of why I don’t like to use them. The graphics are first class and my overall impression of the layout is one of clear, clean, well thought out presentation. In short, it is awesome. And free! I want to join in one the effort to create and release for free, well crafted WordPress themes meant to be used along with the WordPress E Commerce plugin.

The project has stalled somewhat because I was flooded with work. I’m not complaining. But I hope to get it packaged and set for free download very soon. The drawbacks of releasing a one size fits all WordPress theme are the inevitable support requests and how to field them all without draining my most valuable resource: my time. Also one wants to take care not to overly design the theme to make it simpler for people to customize it. It is very hard to create a simple theme! It is even harder to design for 2 sexes. I may just end up releasing 2 versions:one theme that is a bit more feminine and a masculine leaning theme. You know: blue is for boys and pink is for girls. Though I don’t think I will be that literal about the color choices.

So stay tuned, people. It’s coming soon.

Revised File For Fake Grid View

how to get grid view wordpress shopping cart
a shop page suing my fake Grid View:

Very happy to report that you can still “fake” Grid View in Posts/Pages using version 3.12.6 of the WordPress Shopping Cart as the paid for Grid View Module. Most times upgrading a plugin will mean I will have to work very hard to re create the desired effects with the new code. But this time I caught a break and the changes were minimal.

CSS for Grid View-esque Styled Shop Pages in Posts or Pages
These are my suggested styles. You can do what you like just remember that float:left is the main element of Grid View.

/*makes sure things look ok in IE and floats don’t get wonky*/
.homepage_products{overflow:hidden;width:100%;height:auto;position:relative;}

/Product title. !important will override link styling */
.homepage_products a.wpsc_product_title{color:#000!important;font:bold 11px arial!important}

/*adjust widths and heights to fit your product thumbnail */
/* Add padding for more “air” in the boxes, add a border or background color,too. Go crazy!*/
.homepage_products .category_view_product{position:relative;width:155px;height:350px;float:left;margin:8px 8px 2px 6px;}

Download homepage_products_functions.php
*Note* This file was edited April 21st,2009 to correct a validity issue.
[download id=”3″]
FTP to your WordPress Shopping Cart plugin folder and rename the current file: homepage_products_functions_old.php,
if there is a disastrous error you can delete my file and rename the other one, no harm done.
Then upload the edited file, tweak your stylesheet and enjoy!

Beefy SEO Title Tags for WordPress Header.php

WordPress title tags in your theme’s header.php may not be the SEO ideal.
Try this instead:

[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]