Site icon Hip-Hop Website Design and Development

get_posts solely getting most up-to-date product

I had a web site constructed on Woocommerce for me, however now not have entry to the Developer. I am not a programmer so something past CSS adjustments offers me fairly a little bit of issues. There’s a piece of code that was working high-quality, however I’ve added an extra merchandise to the location and now it solely will fetch the latest merchandise added. I imagine the issue is that get_posts is simply accumulating the newest product and I would like it to gather all of them. Fairly certain I’ve narrowed it down to those two strains:

$merchandise = get_posts(array('post_type' => 'product'));

$product = wc_get_product($merchandise[0]->ID);

Does this want a loop? Sorry, I am actually not outfitted to take care of this and it is actually exhausting to search out somebody who may help me with a single query like this.