LeeFoster Posted September 8, 2017 Share Posted September 8, 2017 If I do Quote CATALOG STEP = 4. open catalog/checkout_payment.php This will add the javascript alart checking the box for invalid character. As well as allow points to be used as payment method. **This step has 2 parts FIND: require('includes/template_top.php'); ?> ADD AFTER IT: /* BOF POINTS REWARDS BS */ var submitter = null; function submitFunction() { submitter = 1; } /* EOF POINTS REWARDS BS */ I just see plain text. If I put it inside ?> then I get the below Quote Parse error: syntax error, unexpected 'var' (T_VAR) in E:\xampp\htdocs\generic\checkout_payment.php on line 91 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 8, 2017 Share Posted September 8, 2017 @Tsimi I have a fix for error one. in admin/customer_points.php on line 162 Find if (isset($_POST['queue_add']) && ($_POST['queue_add'] == 'on')) { Replace with if (isset($_POST['queue_delete']) && ($_POST['queue_delete'] == 'on')) { Tsimi 1 Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted September 9, 2017 Share Posted September 9, 2017 Hello @Tsimi, I did a test installation on the latest EDGE under PHP 7.1. I stillget a bunch of undefined and other errors in: admin/customers_points.php admin/customers_points_pending.php admin/customers_points_referral.php I'll go step by step to clean up this. For now I revised the complete installation and checked what can be moved into header tag and hook. Here my comments: CATALOG STEP = 1. open catalog/includes/modules/pages/tp_account.php - add modified module open catalog/checkout_confirmation.php (should be step 2) CATALOG STEP = 3. this snippet of the replace code: if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) && (!$customer_shopping_points_spending) || (is_object($$payment) && ($$payment->enabled == false)) ) { tep_redirect(tep_href_link('checkout_payment.php', 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } should be updated to: if ( ($payment_modules->selected_module != $payment) || ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { tep_redirect(tep_href_link('checkout_payment.php', 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } The entire code could be moved to a header tag module. open catalog/checkout_payment.php CATALOG STEP = 4. missing <script> tags: <script> /* BOF POINTS REWARDS BS */ var submitter = null; function submitFunction() { submitter = 1; } /* EOF POINTS REWARDS BS */ </script> missing tags: </tbody> </table> </div> The entire code can be moved into a hook open catalog/checkout_process.php CATALOG STEP = 5. Can be moved into hooks (3 functions) open catalog/create_account.php CATALOG STEP = 6. Can be moved into hook open catalog/create_account_success.php CATALOG STEP = 7. find snippet is: <div class="contentContainer"> <div class="contentText"> <div class="alert alert-success"> <?php echo TEXT_ACCOUNT_CREATED; ?> Can be moved into hook open catalog/logoff.php CATALOG STEP = 8. clean indents (no indents) can be moved into header tag. CATALOG STEP = 11. open catalog/product_info.php Can be moved into hook CATALOG STEP = 12. open catalog/product_reviews.php Can be moved into hook CATALOG STEP = 13. open catalog/product_reviews_write.php first part can be moved into header tag second part into hook CATALOG STEP = 14. open catalog/reviews.php Can be moved into hook CATALOG STEP = 15. open catalog/includes/application_top.php needs to be tested, but should be possible to include in header tag CATALOG STEP = 16. open catalog/includes/modules/boxes/templates/information.php - missing indent - include modified box - better include in the footer information module CATALOG STEP = 17. open catalog/includes/modules/boxes/bm_shopping_cart.php(optional) - include modified box - better include in the navbar module CATALOG STEP = 18. open catalog/includes/classes/payment.php Maybe could be done with a drop in payment class extension instantiated in header tag CATALOG STEP 19-25 language definitions could be moved into header tag/hooks ADMIN: ADMIN STEP = 1. open admin/orders.php Can be moved into hooks ADMIN STEP = 2. open admin/includes/functions/general.php keep as is ADMIN STEP = 3. open admin/includes/languages/english.php keep as is ADMIN STEP = 4. open admin/includes/languages/english/orders.php move to hook NOTE: Hooks need still core file modifications for hook register and calls. But it could be done in a install script. I have one example for this in the sloppy words cleaner contribution. Please have a look how it is done there and let me know what you think about. Sloppy Words Cleaner reloaded If you agree I then begin to create the header tag and hooks. Be patient, it will need time. Rgds Rainer Dan Cole and Tsimi 2 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 10, 2017 Author Share Posted September 10, 2017 @raiwa Hi Rainer I had a look at your Sloppy Words Cleaner addon and boy that is some code you created there for the hooks. How the hell could you keep an overview, well done. Something like that would be fantastic. You mention a couple of header tags so you mean every code change will have its own header tags module or is all gonna fit into 1-2 header tags modules? Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted September 10, 2017 Share Posted September 10, 2017 Hello @Tsimi, 9 hours ago, Tsimi said: You mention a couple of header tags so you mean every code change will have its own header tags module or is all gonna fit into 1-2 header tags modules? I would fit all in one header tag and then use switch basename($PHP_SELF) to include the required code for the pages. The header tag would be the main module for the contribution, including all the configuration entries, installation scripts etc. I suggest to create a GIT HUB repository, starting with your BETA version and applying the already found bug fixes and so on. Steps proposal: - fixes for undefined errors (already partly done) - fixes for known bugs like the one posted by @LeeFoster - create header tag module: - add installation scripts for database - add configuration entries - add code for the pages where it is possible and remove from core files - add language definitions to header tag language file where possible - create hook: add functions for the pages where it makes sense and remove code changes from core files add language definitions to hook language file and remove from core language files - create modified content modules to replace core modules - revise all html tags for BS integration - add installation script to header tag module (hooks register and calls) Let me know what you and others think about. rgds Rainer Tsimi 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted September 10, 2017 Share Posted September 10, 2017 Here the GIT repository: https://github.com/raiwa/Points_Rewards_BS_BETA_GIT Omar_one and Tsimi 2 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 10, 2017 Author Share Posted September 10, 2017 (edited) @raiwa Sounds like a good and well thought out plan. So how do we proceed? You make the changes step by step and we test or should we also try to make some changes and send you a pull request? Edited September 10, 2017 by Tsimi Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted September 10, 2017 Share Posted September 10, 2017 @Tsimi, As you wish, have time and feel this is a job for you. I'm still "polishing" undefined errors. Just let a Note if you take over a task to avoid duplicate jobs. rgds Rainer Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥raiwa Posted September 10, 2017 Share Posted September 10, 2017 Added to GIT "To do" list (Readme file) with tasks asigend. Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 10, 2017 Author Share Posted September 10, 2017 (edited) @raiwa Please ignore my github stuff. I was just testing things out. Sorry about that. I don't know how to handle the github stuff so good yet. I wanted to merge your latest commits with my fork and eventually figured it out but my commits were uploaded with my other github account. I have 2 github accounts and want to keep them separated. At the end I just deleted everything and will start from scratch again. I will redo the changes tomorrow and add a pull request. I fix the manual step numbers, the missing script tag and the code fix inside the checkout confirmation and checkout payment. Btw. LeeFosters bug fix has two instances and I think both need to be replaced. Edited September 10, 2017 by Tsimi raiwa 1 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 10, 2017 Share Posted September 10, 2017 4 hours ago, Tsimi said: Btw. LeeFosters bug fix has two instances and I think both need to be replaced. No it's just the 2nd one that needs to be changed. Tsimi and raiwa 2 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 11, 2017 Share Posted September 11, 2017 I have managed to find a fix to bug 3. In admin/customers_points.php Find if ($pointstodel > 0) { if (isset($_POST['set_exp']) && ($_POST['set_exp'] == 'on') && ($balance > 0)) { $expire = date('Y-m-d', strtotime('+ '. POINTS_AUTO_EXPIRES .' month')); $expire_date = "\n" . sprintf(EMAIL_TEXT_EXPIRE, tep_date_short($expire)); tep_db_query("update customers set customers_shopping_points = customers_shopping_points - '". $pointstodel ."', customers_points_expires = '". $expire ."' where customers_id = '". (int)$customers_id ."'"); } else { $exp = ($balance > 0) ? $Cexpire_date : 'null'; tep_db_query("update customers set customers_shopping_points = customers_shopping_points - '". $pointstodel ."' where customers_id = '". (int)$customers_id ."'"); $expire_date = "\n" . sprintf(EMAIL_TEXT_EXPIRE, tep_date_short($_POST['customers_points_expires'])); } Replace with if ($pointstodel > 0) { if (isset($_POST['set_exp']) && ($_POST['set_exp'] == 'on') && ($balance > 0)) { $expire = date('Y-m-d', strtotime('+ '. POINTS_AUTO_EXPIRES .' month')); $expire_date = "\n" . sprintf(EMAIL_TEXT_EXPIRE, tep_date_short($expire)); tep_db_query("update customers set customers_shopping_points = customers_shopping_points - '". $pointstodel ."', customers_points_expires = '". $expire ."' where customers_id = '". (int)$customers_id ."'"); } else if (isset($_POST['set_exp']) && ($_POST['set_exp'] == 'on') && ($balance == '0')) { $expire = null; $expire_date = "\n" . sprintf(EMAIL_TEXT_EXPIRE, tep_date_short($expire)); tep_db_query("update customers set customers_shopping_points = customers_shopping_points - '". $pointstodel ."', customers_points_expires = '". $expire ."' where customers_id = '". (int)$customers_id ."'"); } else { $exp = ($balance > 0) ? $Cexpire_date : 'null'; tep_db_query("update customers set customers_shopping_points = customers_shopping_points - '". $pointstodel ."' where customers_id = '". (int)$customers_id ."'"); $expire_date = "\n" . sprintf(EMAIL_TEXT_EXPIRE, tep_date_short($_POST['customers_points_expires'])); } Tsimi and raiwa 2 Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted September 11, 2017 Share Posted September 11, 2017 @Tsimi, can you confirm and take care of it -> pull reuqest? Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 @raiwa Roger that. Will do. I am setting up Sourcetree and fork again as we speak. I just need to figure out how to keep my two github accounts separated when adding commits and pull requests. raiwa 1 Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) I couldn't figure out how to use my Tsimi78 github account so I just use my other one. I use the same avatar as in this forum. Edited September 11, 2017 by Tsimi Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 @LeeFoster The fix for bug #3 doesn't work for me. I still have the last set expire date showing even if the points are 0 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 11, 2017 Share Posted September 11, 2017 Just now, Tsimi said: @LeeFoster The fix for bug #3 doesn't work for me. I still have the last set expire date showing even if the points are 0 Can you check your database table for customer and make sure customer_id is both primary and auto increment. This was an issue for me but I just assumed it was my database. Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 Primary check Auto increment check All good there. Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 11, 2017 Share Posted September 11, 2017 (edited) That's a strange one then. Was the deduction for the exact same amount as there was points? Edited September 11, 2017 by LeeFoster Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 Never mind. It does work. I didn't click the "adjust" button, I used the "delete points" button DUH! Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 11, 2017 Share Posted September 11, 2017 Just now, Tsimi said: Never mind. It does work. I didn't click the "adjust" button, I used the "delete points" button DUH! Delete points should also do it. Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) Really? It doesn't work with delete points... but before I say something too early again let me try it out again. Edited September 11, 2017 by Tsimi Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 (edited) Yep, you're right it does work if you tick the new expire date checkbox. Well done. Code will be added to github. You sure are more skilled then you like to admit. 2 bugs down 1 last one to go for now. Edited September 11, 2017 by Tsimi raiwa 1 Quote Link to comment Share on other sites More sharing options...
LeeFoster Posted September 11, 2017 Share Posted September 11, 2017 4 minutes ago, Tsimi said: Yep, you're right it does work if you tick the new expire date checkbox. Well done. Code will be added to github. You sure are more skilled then you like to admit. 2 bugs down 1 last one to go for now. I'm OK at fixing other people's code but useless at writing my own. I'm looking at the last bug now, it looks like the java script isn't being triggered. raiwa and Tsimi 2 Quote Link to comment Share on other sites More sharing options...
♥Tsimi Posted September 11, 2017 Author Share Posted September 11, 2017 @raiwa Not sure if I do something wrong but it looks like I cannot add another pull request for the bug 1 and 3 fixes. Maybe if you accept the one that is currently open I can create a new one? Man that github is so damn complicate. 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.
Note: Your post will require moderator approval before it will be visible.