PCGUY Posted January 6, 2009 Share Posted January 6, 2009 I currently have this mod running on an internal warehouse shopping website for a company. http://addons.oscommerce.com/info/5710 I installed this mod since we use PO's to pay for everything. A PO is the only payment option I have available, but due to the way this mod is written there is no way to set that a PO number is required! We are having visitors make orders and leaving the PO number box blank on accident. How can I make it stop a visitor from checking out without something filled in the PO box? :huh: Thanks. Quote Link to comment Share on other sites More sharing options...
assembler Posted January 6, 2009 Share Posted January 6, 2009 I'll check it out. Are you having any trouble with the results posting into the database? Some other users are reporting trouble. Quote My Contributions Link to comment Share on other sites More sharing options...
assembler Posted January 6, 2009 Share Posted January 6, 2009 I currently have this mod running on an internal warehouse shopping website for a company. http://addons.oscommerce.com/info/5710 I installed this mod since we use PO's to pay for everything. A PO is the only payment option I have available, but due to the way this mod is written there is no way to set that a PO number is required! We are having visitors make orders and leaving the PO number box blank on accident. How can I make it stop a visitor from checking out without something filled in the PO box? :huh: Thanks. Find this in catalog/includes/modules/payment/po.php function before_process() { global $HTTP_POST_VARS, $order; Add this directly after $error = ''; if (strlen($_POST['po_owner']) < 1) { $error = 'Please enter a valid Company Name'; } elseif(strlen($_POST['po_number']) < 1){ $error = 'Please enter a valid Purchase Order Number'; } if ($error != '') { $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); } I'll set it up with language file support and upload it to the contributions in the morning. I'll also add the cronjob that reminds people to send a hardcopy. Quote My Contributions Link to comment Share on other sites More sharing options...
assembler Posted January 7, 2009 Share Posted January 7, 2009 This is now posted in the contributions. http://addons.oscommerce.com/info/5710 Quote My Contributions Link to comment Share on other sites More sharing options...
PCGUY Posted January 7, 2009 Author Share Posted January 7, 2009 Thank you very much for the help! I am still having a small issue however. It seems that it does indeed not let someone checkout when they have not filled out the PO number, however it seems that the error message never pops up anywhere, it just reloads the page. I am not sure how the error message was intended to show, but I suggest making it a javascript alert to match the rest of the character length check errors in oscommerce. Quote Link to comment Share on other sites More sharing options...
assembler Posted January 9, 2009 Share Posted January 9, 2009 Thank you very much for the help! I am still having a small issue however. It seems that it does indeed not let someone checkout when they have not filled out the PO number, however it seems that the error message never pops up anywhere, it just reloads the page. I am not sure how the error message was intended to show, but I suggest making it a javascript alert to match the rest of the character length check errors in oscommerce. It should bring you back to the page where you select your payment method (checkout_payment.php) - and the message shows at the top of the page like all the other payment modules. Quote My Contributions Link to comment Share on other sites More sharing options...
PCGUY Posted January 12, 2009 Author Share Posted January 12, 2009 Humm, maybe this is not working for me since I have the Simple Template System installed? Any idea on how to make it compatible? I have looked through your code and I see where the error message is called for, and where it is in the language file, but I do not understand how it is displayed. Quote Link to comment Share on other sites More sharing options...
assembler Posted January 12, 2009 Share Posted January 12, 2009 Humm, maybe this is not working for me since I have the Simple Template System installed? Any idea on how to make it compatible? I have looked through your code and I see where the error message is called for, and where it is in the language file, but I do not understand how it is displayed. It may be because of STS - I am unfamiliar with that contribution. Do payment errors work on any payment modules for you? If so, you should see how they are displayed with the the module. This module uses the stock oscommerce way of displaying the error with this code: if ($error != '') { $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false)); } It redirects the user to the page where you select the payment options, and displays the error text at the top of the page. Quote My Contributions Link to comment Share on other sites More sharing options...
PCGUY Posted January 13, 2009 Author Share Posted January 13, 2009 Ah, apparently none of my payment modules will product errors. I installed something that makes it skip past the Payment Options screen and just puts the place for the PO number on the confirmation page, and this apparently will not produce any error messages now that I have done that. Thanks for your help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.