I also use the same code for one of my project,
PHP Code:
'<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a> ';
However I found an issue, when the product is out of stock the 'Buy now' button still show up, of course because I don't put any IF statement for it.
Can somebody help me to share what the IF statement we shall put to check whether the stock is 'sold out' or not? So zencart can replace the Buy now button with Sold Out button if the item is out of stock.
I tried to figure out but couldn't find it... really appreciate all helps
Thanks!