buzzworm Posted December 15, 2013 Share Posted December 15, 2013 Hi everybody, what I'm looking for seems simple but after a couple hours of research I can't find the answer. I want to use PrestaShop's back office "create order" feature to sell products in our physical store (in addition to online). So for the in-store sales, I want to be able to mark orders as paid by cash, check, or credit card (in-store, processed via terminal) but not show these options for the online customers. They need to be visible in the back-office "create order" page only. Online customers will only use the standard online payment options of credit card (i.e. Authorize.net) or PayPal. e.g. when I enable the Check module, it appears in both the front-office and back-office but I only want it to appear in the back office. I supposed if I can get that figured out, I can duplicate it for the other modules I need (cash, in-store cards). I'm thinking it may be related to hooks but I'm just learning about them. I see the hookPayment and hookPaymentReturn functions in cheque.php but I'm not sure if it's possible to specify front vs. back office or if I'm barking up the wrong tree altogether. Thanks for any advice! 1 Link to comment Share on other sites More sharing options...
jeremyeguzman Posted January 25, 2014 Share Posted January 25, 2014 Bumping this as I also need a cash option for back office use only. Link to comment Share on other sites More sharing options...
El Patron Posted January 26, 2014 Share Posted January 26, 2014 If you do not want a module to be shown (but still installed/enabled) then you would unhook it. It would still be available for services that do not require the hook for display, i.e. back office. -----the above in incorrect see post below http://www.prestashop.com/forums/topic/295940-need-cash-check-and-credit-card-payment-methods-for-back-office-only/?p=1619348 Link to comment Share on other sites More sharing options...
whish Posted March 31, 2014 Share Posted March 31, 2014 (edited) Hi, We are looking for the same functionality (having a payment method usable in the back office only through the Orders->Add New screen). I have tried removing the hooks for the payment module in question and while this does remove the module from the cart it also seems to remove it from the back office order screen. Does anyone know if there is a setting or a way to modify the module in question to behave in the desired fashion? Thanks. Edited March 31, 2014 by whish (see edit history) Link to comment Share on other sites More sharing options...
dioniz Posted March 31, 2014 Share Posted March 31, 2014 Maybe the simplest solution would be to hide those options in FO with css Link to comment Share on other sites More sharing options...
El Patron Posted March 31, 2014 Share Posted March 31, 2014 Hi, We are looking for the same functionality (having a payment method usable in the back office only through the Orders->Add New screen). I have tried removing the hooks for the payment module in question and while this does remove the module from the cart it also seems to remove it from the back office order screen. Does anyone know if there is a setting or a way to modify the module in question to behave in the desired fashion? Thanks. You are correct, just tested which I should have done in my original post... if I remove the hook, it is not available in back office add order payment option. here is a very simple way to modify your payment module hooks to not display unless from back office, (tested with bank wire) add these two lines to see if _PS_ADMIN_DIR_ (only defined when in back office) public function hookPayment($params) { if (!defined('_PS_ADMIN_DIR_')) return; Link to comment Share on other sites More sharing options...
whish Posted April 1, 2014 Share Posted April 1, 2014 You are correct, just tested which I should have done in my original post... if I remove the hook, it is not available in back office add order payment option. here is a very simple way to modify your payment module hooks to not display unless from back office, (tested with bank wire) add these two lines to see if _PS_ADMIN_DIR_ (only defined when in back office) public function hookPayment($params) { if (!defined('_PS_ADMIN_DIR_')) return; Thanks a lot! Works brilliantly. 1 Link to comment Share on other sites More sharing options...
Steam Posted November 11, 2014 Share Posted November 11, 2014 You are correct, just tested which I should have done in my original post... if I remove the hook, it is not available in back office add order payment option. here is a very simple way to modify your payment module hooks to not display unless from back office, (tested with bank wire) add these two lines to see if _PS_ADMIN_DIR_ (only defined when in back office) public function hookPayment($params) { if (!defined('_PS_ADMIN_DIR_')) return; I have tried the above instructions to no avail. I am not 100% sure which file to edit and where to insert the lines mentioned. I think my problem may be with the bolded red text in the quote above. I have tried adding the mentioned lines to cashondelivery.php file right after "public function hookPayment($params)" as mentioned. But this does nothing for me. Any help would be grealty appreciated. Link to comment Share on other sites More sharing options...
Webshop VTSSN Posted August 28, 2017 Share Posted August 28, 2017 Works fine in PS 1.7 , thx! Search in modules/ps_wirepayment/ps_wirepayment.php for public function hookPaymentOptions($params) { And add if (!defined('_PS_ADMIN_DIR_')) return; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now