Home » Developers » 3.8 Theme Goodness

3.8 Theme Goodness

I’m sure you’ve heard a lot of hype about the new WP e-Commerce 3.8 version that has been in the works for a good 6 months. The one that uses Custom Post Types for products, and Custom Taxonomies for Categories and Variations? Yea it’s coming along. You can have a sneak peak at it by downloading a version using SVN the link is:

http://svn.wp-plugins.org/wp-e-commerce/branches/3.8-development

(NOTE: just don’t use it on a live production site! It’s not even in beta stages yet,, though it is getting closer)

Custom Post Types for Products and Variation Products have been Implemented for a while now, and we’ve just been slaving away at making the front-end products-page and single-products pages work. We’ve come across some obstacles, Lee talks about one of the major hurdles here which relates to the way Custom Post Types and Taxonomies are rather difficult to work with if you aren’t the Theme Developer as well.
However we came up with a work around for this, and I thought I’d explain it a little (and the Theme System in general) before we release so you guys can get an idea of what is going on.

The Files

So WP e-Commerce has a number of ‘templates’ that get used for rendering out the XHTML for certain aspects of your store. To date they are:

3.7 Versions

  • cart_widget.php
  • category_widget.php
  • functions.php
  • default.css
  • products-page.php
  • shopping_cart_page.php
  • single_product.php

3.8 Versions

  • wpsc-cart_widget.php
  • wpsc-category_widget.php
  • wpsc-default.css
  • wpsc-products-page.php
  • wpsc-shopping_cart_page.php
  • wpsc-single_product.php
  • wpsc-transaction_results_functions.php *new*
  • wpsc-user-log.php *new*

The Locations

In 3.7 we recommended users move their theme files to their uploads directory (wp-content/uploads/wpsc/themes/). This caused a few problems with users that

  • Didn’t know FTP
  • Had weird servers that didn’t grant them permissions to edit files in the uploads directory

After talking with a few WordPress Developers we found that placing Themes, Templates in the wp-content/themes folder was THE best solution to keeping your themes safe. So in 3.8 when we say ‘move your WP e-Commerce templates to a safe place’ we NOW mean `wp-content/themes/{activeTheme}` We are pretty stoked about that :)

Template Logic

So we aim at making the upgrade to 3.8 as painless as possible, and we know lots of you out there have customized your stores to look amazing. Forcing you to use the new templates and start from scratch was just not an option. So we have made some interesting fallback logic for the templates. Which should cover both New and existing installs of WP e-Commerce.

WP e-Commerce Template Hierarchy

Say you are using the very cool new WP 3.0 Default Theme (TwentyTen) and you upgrade from 3.7. WP e-Commerce will then:

  1. First check wp-content/themes/twentyten for the desired template and use it if it is there;
  2. Secondly check wp-content/themes/uploads/wpsc/themes/{youroldtheme} for the desired template and use it if it was there;
  3. Thirdly fallback to wp-content/plugins/wp-e-commerce/themes/ for the desired template, it will always be there!

WP e-Commerce Move your Themes

Again the amazing Lee took a lot of time out of his day to explain to us the best way to approach moving your Themes to a safe place. As I mentioned earlier 3.7 had some set backs on the users side, it also had a logical issue When you move your files, it moved ALL of them. This caused problems for some users.
Example:
A User using 3.7.5 Moved his themes to a safe place but only modified the products_page.php. He then upgraded to 3.7.6 which had a fix for a problem in the shopping_cart_page.php. His site is upgraded but the changes in shopping_cart_page.php don’t show up because WP e-Commerce is using the template in his uploads directory and not his WP e-Commerce directory…

Solution
In 3.8 we give you a bit more flexibility by allowing you to move only the files you WANT to customize, and we recommend you move only the files you really DO want to customize. That way if we need to make changes to the theme, which we need to do now and again, you will only need to port over the changes to the files that you have moved.. make sense? Heres a screen shot of the new UI for porting your templates.


Templates from Uploads Directory that haven't been moved to active theme folder

Templates from wp-e-commerce Directory that haven't been moved to active theme folder

Templates from wp-e-commerce Directory with some moved to active theme folder

Templates from uploads Directory with some that have been moved to active theme folder

The Backup System

New in 3.8 we have added a simple Backup button for your Active Theme. What this does is copies all your files and folders from within your wp-content/themes/{activeTheme} and places them in the wp-content/uploads/wpsc/theme_backup folder. Each time you click ‘Backup Your Theme’ The files in the theme_backup folder will be replaced with your current active theme files.

Well that’s all for now. I know this is going to excite a lot of your, and I can’t wait to release this version, but it still needs a little more loving yet ;)

Best,
Jeff


10 Responses to 3.8 Theme Goodness


  1. jashnu September 16, 2010 at 6:59 pm

    Is it possible to upgrade directly from the 3.7-series to 3.8-series? What kind of database changes there will be?

  2. Aaron Dwyer September 16, 2010 at 10:30 pm

    Good work guys, I can see that wp-e-commerce will become if it isn’t already the defacto shop for wordpress.

  3. Jason September 17, 2010 at 8:56 am

    Yup great work guys – we can’t wait for 3.8 to come out!

    We’ve got a few client website builds over the next month which we’d hoped 3.8 would be ready for – but hopefully the move from 3.7 – 3.8 will be painless when it comes!

    Arw there any tips for a 3.7 build now, to make it -more- 3.8 ‘ready’?

  4. Jeff Ghazally September 17, 2010 at 10:16 am

    Hi Guys,
    Thanks for the positive feedback.
    @jashnu, the upgrade script needs a few more tests but upgrading to 3.8 is as simple as clicking an upgrade button! The changes are pretty phenomenal to say the least. To date I think 3.8 uses 10 less DB tables!
    @Jason, Just make sure your customizations are in plugins, not core wp-e-commerce, and make sure you don’t forget to backup your files and databases.

    Best
    Jeff

  5. Kate Mag September 18, 2010 at 4:24 am

    OMG. It looks awesome. I think WP E-Commerce 3.8 will be the best WP E-Commerce ever!.

  6. uwiuw September 18, 2010 at 11:37 pm

    man, i agree with you. this is a better solution.

    someday, for the sake of Compatibility, the plugin has option to control whether we want to choose theme in the pluggin theme folder (wp-content/plugins/wp-e-commerce/themes/) or in the blog uploads folder (wp-content/themes/uploads/wpsc/themes/)

    i believe it would be safer and easy to maintain.

  7. Sol September 24, 2010 at 12:08 am

    @jeff

    make sure your customizations are in plugins, not core wp-e-commerce, and make sure you don’t forget to backup your files and databases. </

    Hmmm would be good to know what you mean by this. How does one make a change to core files “in a plugin” as opposed to the core file!

  8. Richard Tape October 7, 2010 at 2:37 am

    Hi guys, great work on this.

    Am I missing something or have the variations not been ‘implemented’ yet? I can’t seem to add them to a product on the latest version on SVN. Is there a quick fix for this as I imagine it’s just a custom taxonomy that needs to be associated with the products post type? Or am I speaking out of my backside? ;)

    Richard

    • Richard Tape October 7, 2010 at 3:31 am

      Actually, bizarrely they are being put onto the add or edit products page but they have ‘display: none’ as an inline style — this applies to the shipping details, variation control and advanced options panels. This doesn’t seem to apply *all* of the time, just sometimes and I can’t for the life of me figure out why.

    • Dan Milward October 8, 2010 at 9:18 am

      To get 3.8 help you need to be a developer on the developers mailing list :P
      Its probably nothing… the new 3.8 variations are pretty cool.