I need to display custom messages when products in certain product groups are purchased.
I put {debug} at the bottom of complete.tpl and unfortunately the purchased products are not directly available as variables. The only thing that looks useful in the debug window is $orderid.
So first of all, I assume that I'm going to need to enable {php} in my templates under the General - Security tab since the data I need isn't available in complete.tpl.
Can anyone tell me what whmcs api functions I should use to fetch the order by $orderid and check if it contains any products from productgroup id 5?
I know php well but am very new to the whmcs api. Someone who could sketch out the process with whmcs function names would be my hero.