Code not looping over all products of a given category

The default number of posts for WP_Query is ten posts per page.

Try adding 'posts_per_page' => -1 to your $wpec_args:

$wpec_args = array(
    'post_status' => 'publish',
    'post_type'   => 'wpsc-product',
    'posts_per_page' => -1,
    'wpsc_product_category' => $wpec_term_slug
);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)