I want to enable the online-bank payment option only when admin orders as customer via place order button .
IS IT possible ? IF it is , then what is the process /logic ?
Please Advice ,
Thanks in advance
Regards
Diptimoy
I want to enable the online-bank payment option only when admin orders as customer via place order button .
IS IT possible ? IF it is , then what is the process /logic ?
Please Advice ,
Thanks in advance
Regards
Diptimoy
Modify the payment module to only be enabled when the IP address is that of the admin.
As a quick fix you can hard code it directly into the module...
----------
As a better more flexible version
I add a new key to the module to hold a list of admin IP addressesThen I add something like this to the module to disable if not from an admin IPPHP Code:$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Admin IP\'s to allow access', 'MODULE_PAYMENT_PHONEORDER_ADMINIP', '123.123.123.123', 'Enter the Admin IP\'s that are allowed to access this module.<br />Separate multiple IP\'s with a comma.<br />No Spaces.', '6', '60', now());");
nb: You need to edit the code to suit your module, cannot use as itPHP Code:// disable if NOT accessed from an ADMIN IP address
if (!in_array($_SESSION['customers_ip_address'], explode(',',MODULE_PAYMENT_PHONEORDER_ADMINIP))) {
$this->enabled = false;
}
Well the admin users IP has to be listed in the mod for it to work
Dynamic IP suggests you get a different IP each time you connect to the internet
That would be difficult to work with.
I have an ADSL line that is listed as a Dynamic IP
It has never altered in the 10 years I have had it
Whereas my mobile phone get different IP addresses all the time
I access admin allways from my laptop.
it is from an ADSL connection yes. Not a mobile phone. It is a fixed computer.
Mostly two locations..but when i am abroad on a trip i need it there also.
OK, thanks
I use the IP address as I want to "confine" access to specific computers in a specific room.
You could still use this while you are "home"
While "away" you would need to change the IP address for the mod. Takes about 30 seconds as it is visible in the admin header, so you could cut and paste this IP address and paste it into the payment module via the admin.
Otherwise I would suggest setting a session variable in the "login as customer" mod
So when you use this mod this session variable is "set"
and then this can be checked against a set value in the payment module, similar to the code above.
This ties the payment module to the use of the login as customer module (anywhere)
It is do-able but I have NOT tried this as I don't require it.