Hopefully a nice simple question to start the day...
In success.phtml
, I would like to achieve the following using PHP:
$_commissionGroupCode = [If $_voucher is empty, echo "DEFAULT". Else echo "VOUCHER"]
Below is a snippet of my code so far:
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$_products = $order->getAllItems();
$_totalData = $order->getData();
$_discount = $_totalData['discount_amount'];
$_voucher = $_totalData['coupon_code'];
$_commissionGroupCode = ANSWER GOES HERE
You will notice I already have $_voucher to call the voucher code