Hi,
I’ve made a custom query trying to get the amount of products sold:
{exp:query sql="SELECT SUM(field_id_111) AS total_sold FROM exp_weblog_data WHERE field_id_110 = '{embed:emb_entry_id}' AND weblog_id = 17"}
{if no_results}
0
{/if}
{total_sold}
{/exp:query}field_id_111 - quantity field
field_id_110 - item id field
this query works fine, as soon as there is field_id_111 or field_id_110… but if they are empty it will display {total_sold} instead of “0”
here’s the corresponding thread:
http://cartthrob.com/forums/viewthread/2175/P0/
does anybody knows why it’s displaying {total_sold} instead of “0”?
cheers
stefan