Query Products & Store IDs in array
Couple of things – avoid query_posts, use a new query object or the get_posts function (read all about it). And the_ID() echo’s the ID, use get_the_ID() instead. However, you can save some memory and processing by simply iterating over an array of posts (i.e. not using a proper “loop” and setting up the global post), … Read more