WP-ecommerce ajax error wpsc_ajax not defined-Collection of common programming errors

I’ve got a problem with my WP-ecommerce plugin (3.8.12.1) in wordpress. My add to cart button refreshes the page. I’m getting an javascript error:

Uncaught ReferenceError: wpsc_ajax is not defined in wp-e-commerce.js on line 275:

jQuery.post( wpsc_ajax.ajaxurl, form_values, success, 'json' );

This means my jquery.post is not performed and a normal post action is performed. I am not sure when this problem started to occur but I think it was when I installed w3 total cache (a wordpress cache plugin). Does anybody know where wpsc_ajax is defined or what the actual problem might be? Any help in the right direction is appreciated, I’m kind of stuck!

Cheers, Adnan