add_to_cart shortcode not working WP e-Commerce Plugin

This is just a short tutorial that might help you if you’re currently using WP e-Commerce plugin, I just found this bug while trying to create Custom Product Page in a grid view design, I found out that shorcode is not working, so I began searching in their forum and fortunately I got this very simple solution, btw I’m using latest versions of WP e-Commerce plugin.


Put this snippet in your functions.php> of your current theme, if you don’t have functions.php yet please create and paste this snippet.


by Ryan Sutana

  • mario

    There is an extra space in the function name. You also missed a ‘ in the add_shortcode. The correct code is:

    add_shortcode(‘add_to_cart’, ‘add_to_cart_fixed’);

    function add_to_cart_fixed( $atts )
    $output = wpsc_add_to_cart_button( $atts[‘id’], true );

    return $output;

    Btw, it doesn’t work for me