Osclass forums
Support forums => Plugins => Plugin Payments => Topic started by: ezybusy on June 01, 2016, 03:29:31 am
-
Hi everyone,
i am using the plugin Payment pro on my website. I have turned on the option Allow users's wallets which is the only payment option for my website that allow users to set their ads as premium.
Now i want to display users credit balance on the user dashboard, so that they can have a constant look at their credit balance anytime they log into their account. Something similar to the following:
- You have $100 of premium credit into your account. (To display if the user has credit)
- Insufficient premium credit, contact the admin to load your account. (To display in case the user credit is 0).
I contacted the support team for the plugin regarding the above, and got the following answer:
You could use the following code to display user's credit:
$wallet = ModelPaymentPro::newInstance()->getWallet(osc_logged_user_id());
if(isset($wallet['i_amount']) && $wallet['i_amount']>0) {
$credit_msg = sprintf(__('Your current credit is %s', 'payment_pro'), osc_format_price($wallet['i_amount'], osc_get_preference('currency', 'payment_pro')));
} else {
$credit_msg = __('Your wallet is empty. Buy some credits.', 'payment_pro');
}
[/b]
Then i tried inserting the above code on the user-dashboard.php page as a php code (in between <?php and ?>) but got an error.
Upon contacting the support team to let them know about the error, i was told the following:
You need to later print/echo the $credit_msg variable to display the text.
However i don't know how to do the above. Can someone help me out?
regards,
-
With
echo $credit_msg;
-
Thank you for the reply _CONEJO .
Can you please describe the whole process of what I have to do.
Where do I place the code that the support tem gave me?
Where do I place the single line of code that you gave me?
-
First, It was me who gave you support, as it's me who did the plugin. We offer support for bugs and errors, but we can not offer customization work for free.
If you don't know the very basic of PHP, your best shot is to hire a professional to do the changes for you, less time waste.
You could put the code wherever you want it to appear,, be it user-dashboard.php if or any other file in your theme.
$wallet = ModelPaymentPro::newInstance()->getWallet(osc_logged_user_id());
if(isset($wallet['i_amount']) && $wallet['i_amount']>0) {
$credit_msg = sprintf(__('Your current credit is %s', 'payment_pro'), osc_format_price($wallet['i_amount'], osc_get_preference('currency', 'payment_pro')));
} else {
$credit_msg = __('Your wallet is empty. Buy some credits.', 'payment_pro');
}
echo $credit_msg;
-
Alright _CONEJO.
Thank you for your help.
-
Thanks, it works!!!
-
Dear webhostpune,
Please, do not hijack a thread to ask questions not related to it, open a new one.
Payments Pro doesn't include PayuMoney, but there's already a plugin in the market for it, take a look a : https://market.osclass.org/plugins/payments/payumoney_549
Regards