get latest purchase in WP E-commerce

Just a small piece of code to get the ID of the latest purchase in wp e-commerce:

global $wpdb;
$sql = "SELECT id
        FROM `".$wpdb->prefix."wpsc_purchase_logs`
        ORDER BY id DESC
        LIMIT 1";
$latest_purchase_id = $wpdb->get_var($sql);

I hope it will be useful to anybody else…

Just a small piece of code to get the ID of the latest purchase in wp e-commerce:

global $wpdb;
$sql = "SELECT id
        FROM `".$wpdb->prefix."wpsc_purchase_logs`
        ORDER BY id DESC
        LIMIT 1";
$latest_purchase_id = $wpdb->get_var($sql);

I hope it will be useful to anybody else…

2 Responses to “get latest purchase in WP E-commerce”

Leave a Reply