since re designing my site …

Google Analytics reports that my visitor rates have dropped 99.99% since April 21st when I first began working on the new design.

  • Possible reasons:

  • My landing page used to be my blog page, where all the good stuff is. Or at least where all the stuff people came to my site for is.
  • My blog landing page is now called work – which I might change – I’m still working on how to arrange stuff and what to call stuff after moving it.
  • My old site was completely different-looking so maybe they think they’ve come to the wrong site.
  • This might not have been enough of a warning that changes were coming?

In any event I apologize to the folks who didn’t find what they were looking for and left in 00:01:22. Soon things you need will be easier to find.
It might not be awesome to re design a live site but that is a privilege I reserve, just the same.

Using WP 3.1, jQuery, Cforms & WP-E-Commerce? Frustrated by Javascript Errors?

The main error I’ve seen when using these 2 plugins and using WordPress’ jQuery is “jquery form.product_form .livequery is not a function” which makes it look like the wp-e-commerce plugin is at fault but it actually isn’t. I know it isn’t because I de activated all my plugins and re activated them one by one until the error came back. With my specific set up the error only came back when I had cforms and wp-e-commerce activated at the same time.

You’ve learned how to enqueue jQuery plugins with WordPress’ jQuery without errors.WP-E-Commerce relies on WordPress’ jQuery. CformsII uses jQuery 1.4.2. WordPress uses jQuery 1.4.4. So now you’ve got 2 versions of jQuery being loaded at the same time which we all know means Javascript errors.

The easiest thing to do is FTP into your server, go to wp-content/plugins/cforms/js, open jquery.js and paste in a copy of jQuery 1.4.4. Doing this will not disrupt cformsII on the backend or submitting forms on the frontend.

If you upgrade cforms you’ll have to do this all over again. But since you’re not editing lines of code this is a snap to repeat.

* Note: Just because FireFox Web Developer or Firebug are reporting JS errors doesn’t necessarily mean things are not working as they should be. But you should remember that Internet Explorer is going show a nasty message: “error on page” or “done, but with errors on page” that your clients and their customers will see. But if you fix it before they see it it can be one less thing you’ll have to hear about.

This advice can be used with other combinations of plugins. If any plugin is enqueuing its own copy of jQuery that is not 1.4.4 and you’ve already enqueued WordPress’ jQuery you can just empty the plugin’s jquery.js so that its enqueuing an empty file or paste in 1.4.4. You’ll have to make sure doing this doesn’t stop the plugin from functioning, I’ve only tested this “fix” with cformsII.

In any event as long as everyone is using the same version of jQuery there won’t be any errors.

How are you dealing with Javascript errors?

WP-E-Commerce Tip: Change the path to the add to cart image

You’re using the theme named iShop.
You’ve moved your themes to the /wp-content/uploads/wpsc directory.
Now you want to get the add to cart image from /wp-content/uploads/wpsc/iShop instead of /wp-content/plugins/wp-e-commerce/themes/iShop
Once this is done, upgrading the plugin won’t get rid of your add to cart image.

products_page.php /wp-content/uploads/wpsc/themes/iShop/products_page.php
Please backup your files before editing!

Find lines 231 to 233

[php]
<?php else: ?>
<input type=’image’ src='<?php echo WPSC_URL; ?>/themes/iShop/images/buy_button.gif’
id=’product_<?php echo wpsc_the_product_id(); ?>_submit_button’
class=’wpsc_buy_button’ name=’Buy’ value="<?php echo __(‘Add To Cart’, ‘wpsc’); ?>" />
<?php endif; ?>[/php]

Change to:

[php]
<?php else: ?>
<?php $upload_dir = wp_upload_dir(); ?>
<input type=’image’ src='<?php echo $upload_dir[‘baseurl’];?>
/wpsc/themes/iShop/images/buy_button.gif’
id=’product_<?php echo wpsc_the_product_id(); ?>_submit_button’
class=’wpsc_buy_button’ name=’Buy’ value="<?php echo __(‘Add To Cart’, ‘wpsc’); ?>" />
<?php endif; ?>[/php]

single_product.php
Find lines 180 to 183
[php]
<?php else: ?>
<input type=’image’ src='<?php echo WPSC_URL; ?>/themes/iShop/images/buy_button.gif’
id=’product_<?php echo wpsc_the_product_id(); ?>_submit_button’
class=’wpsc_buy_button’ name=’Buy’ value="<?php echo __(‘Add To Cart’, ‘wpsc’); ?>" />
<?php endif; ?>[/php]

Change to
[php]
<?php else: ?>
<?php $upload_dir = wp_upload_dir(); ?>
<input type=’image’ src='<?php echo $upload_dir[‘baseurl’];?>
/wpsc/themes/iShop/images/buy_button.gif’
id=’product_<?php echo wpsc_the_product_id(); ?>_submit_button’
class=’wpsc_buy_button’ name=’Buy’ value="<?php echo __(‘Add To Cart’, ‘wpsc’); ?>" />
<?php endif; ?>[/php]

Now all you have to do is upload your add to cart image to the images folder of your theme in your theme’s new location.
If you’re using a .png or .jpg image file type or an image with a different file name than buy_button.gif you have to make sure to edit the code to use the image file name or type.

Marketplace
products_page.php at lines 235 to 238
single_product.php at lines 182 to 184
Tip about the Marketplace theme: it uses atc.gif as the add to cart image, not buy_button.gif.

Default
Tip about the default theme: it uses input type=’submit’ instead of input type=’image’ which is what the 2 other themes use.
So if you’re already using some CSS to style the button I would leave this code alone since upgrading won’t affect your theme.
But if you want to use an image go ahead and edit the files:
products_page.php at lines 233 to 235
single_product.php at lines 179 to 181