WP-eCommerce Downloads and bypassing the checkout process

I'm doing a site for a client using WP e-Commerce and they are using it as a catalogue site, not a e-commerce site. One thing they wanted to be able to do wa...

I’m doing a site for a client using WP e-Commerce and they are using it as a catalogue site, not a e-commerce site. One thing they wanted to be able to do was to use the Product Downloads for hosting attachments for individual products, for example, a PDF info sheet. The built-in functionality of WP e-Commerce however is to only display the product downloads links once someone has purchased an item and gone through the checkout process. I found a guide on bloke.org showing how to do it in 3.7, but in version 3.8 they changed the way that the product downloads were stored and the old way no longer worked. After much head-scratching, I arrived at the following solution:

$args = array( ‘post_type’ => ‘wpsc-product-file’, ‘numberposts’ => -1, ‘post_parent’ => $post->ID );

$attachments = get_children($args);

if ($attachments) {

foreach ( $attachments as $attachment ) {

    echo "[$attachment->post\_title](<, $attachment-\>guid, >)";

}

}

Keep This Useful

Spotted something outdated or unclear?

If a step has changed, a screenshot no longer matches, or something here just does not work the way it should, get in touch and we will take a look.