Advertisement:

Author Topic: Successful payment flash message  (Read 765 times)

goodisme

  • Newbie
  • *
  • Posts: 24
Successful payment flash message
« on: October 14, 2017, 07:50:31 pm »
Hi guys, i am trying to create a payment success flash message for pack purchases:

i first defined variables:
Code: [Select]
$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:

Code: [Select]
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?
« Last Edit: October 14, 2017, 10:52:41 pm by goodisme »