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