Hi guys, i am trying to create a payment success flash message for pack purchases:
i first defined variables:
$wallet = ModelPaymentPro::newInstance()->getWallet(osc_logged_user_id());
$wallet_amount = osc_format_price($wallet['i_amount'], payment_pro_currency());
$purchase_amount = osc_format_price($pack['i_amount'], payment_pro_currency());
$new_amount = osc_format_price($pack['i_amount']+$wallet['i_amount'], payment_pro_currency());
then the message:
osc_add_flash_ok_message(sprintf(__('<i class="fa fa-info-circle" style="margin-right:2px ;"></i>Congrats! %s has been purchased successfully.Your new credit balance is %s','payment_pro'), $purchase_amount , $new_amount));
the outcome message is suppose to look like example:"Congrats! 10 units has been purchased successfully.Your new credit balance is 10units"
at the moment when i use '$purchase_amount', it gives zero and i think the problem lies with the "$pack['i_amount']".
can anyone help me with the proper code for the total quantity of packs being bought?