@boasey,
One way is to copy and modify the test gateway to have a little extra code in it that tests the conditions you want to test before making the payment option available. Pretty straight forward.
Jeff
Thread Starter
boasey
(@boasey)
Might be for you Jeff, but I wouldn’t know how to do that π I know I’d have to copy and modify testmode.merchant.php but that’s where I’d get stuck. Wouldn’t know what code to put in there. Can you advise please Jeff and thanks for your quick reply.
John
Hi John,
Here is a link to the solution wrapped in a plugin. It will show an additional payment gateway called administrative payment if the user is an admin.
It also has a feature that will let the administrator log in as any registered user. You can use this if you have a registered shopper that puts items in a cart and then wants to give you payment in some way other than checkout.
Let me know if it works for you.
Jeff
Thread Starter
boasey
(@boasey)
Wow! thanks Jeff. I’ll have ago with that tomorrow.
Would I be able to change the administrative user to say an editor rather than admin as I have page redirects setup for different users except admin.
Thanks again!
Regards
John
A very good solution, for sure.
If you need something simpler and just want to hide the test gateway unless a user is logged in and has a specific role, you could simply filter the custom gateway options.
https://gist.github.com/JustinSainton/ccf7a7bee6e9fe005e6c
boasey,
if you want to change the capability to editors, you can change “manage_options” in either solution to “edit_pages”.
Line 7 in the gist, Lines 18 and 26 in pbci-wpec-administrative-payment.php.
Thread Starter
boasey
(@boasey)
Hi Justin,
I’ll being giving both a go…thanks! Again would I be able to hide the gateway for say an editor user rather than admin as I have page redirects setup for different users except admin.
Thanks
John
Thread Starter
boasey
(@boasey)
I see how that works now…cheers Justin!
Thread Starter
boasey
(@boasey)
Jeff and Justin,
Both options worked a treat…thank you! and changing “manage_options” to “edit_pages” also worked.
Thanks guys!
You wouldn’t have a solution to my other question would you:
How can I get the Customer Purchase Receipt in the Admin tab of wp e-commerce to show not only the product title but also the full product description?
Thanks again!