Jack_mcs Posted June 9, 2018 Share Posted June 9, 2018 (edited) This addon is a replacement for the previous MATC module. It is fully compatible with all community edition versions of oscommerce but it does require raiwa's modular checkout pages addon to be installed.. Once installed, it will place a check box on the create account, checkout payment or checkout confirmation pages, depending upon the settings in the module. The check box prevents the customer from proceeding unless they check that box. If the check box is to appear on the create account page, a few file edits are requited. Otherwise, it all works with the installation of modules. Edited June 10, 2018 by Jack_mcs valquiria23 and raiwa 2 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
valquiria23 Posted June 9, 2018 Share Posted June 9, 2018 Dear jack @Jack_mcs Is this addon only compatible with the Frozen version? Best regards. Valqui Quote Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 10, 2018 Author Share Posted June 10, 2018 It is compatible with any of the CE versions but it does require raiwa's modular checkout addon to be installed. Also, if a shop has the old MATC installed, it has to be uninstalled. I apologize for not clarifying those points. I have changed the text in my posting above to mention the required addon. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
inra311 Posted June 11, 2018 Share Posted June 11, 2018 I set the MATC to checkout_confirmation. It works fine it seems but I get the following error warnings when calling up checkout_confirmation.php (PHP 7.1): PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 350 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 353 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 354 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 357 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 367 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 375 PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 394 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 11, 2018 Author Share Posted June 11, 2018 I don't have this installed in a shop running 7.0 so I can't say for sure but it is most likely due to passing the ID for the button. In 7.0, strict mode is set by default and it reports things like this. In this case, and probably in all cases, they are harmless and can be ignored. I may look at this at some point but I suggest changing the error_reporting line near the top of includes/application_top.php to the following: error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_DEPRECATED); Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
inra311 Posted June 12, 2018 Share Posted June 12, 2018 Unfortunately I don't really understand what the code does but I can confirm that the error seems to be related to the 5th parameter of tep_draw_button which is 'id="TheSubmitButton"' When I change tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', 'id="TheSubmitButton"', 'btn-success'); to tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', null, 'btn-success'); it does not produce the error, and still seems to work (I don't have the popup or textarea option enabled, is the parameter needed for some javascript for these??) ... but as said I don't really understand what I am doing there so probably not a good idea?! Also I found that 'id="TheSubmitButton"' does not appear in any core files, neither in the addon except within the tep_draw_button. Shouldn't it be defined somewhere? error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_DEPRECATED); This did not change anything (the error is in the error log, not onscreen) Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 12, 2018 Author Share Posted June 12, 2018 First, to be clear, it is a warning, not an error. There is a big difference been the two. When the strict mode is enabled in php, it checks that a variable is declared before using it. So there can't be code like $var['this'] = 'a'; It has to be $var = array('this'); $var['this'] = 'a'; It is a way for the php interpreter to check for possible problems. It can be very useful when developing a piece of code but not when the code is running. In this case, the ID being passed has not been declared as required for that function but the code in the function doesn't care about that and it works fine. So while it should be fixed as a technical issue, as a practical one it is not worth the bother. The line I gave you to disable strict mode won't work on all servers. You would need to ask your host to recompile php with strict mode disabled. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
inra311 Posted June 15, 2018 Share Posted June 15, 2018 I found a problem with the MATC module on the create_account page. When the customer enters data incorrectly so that the Continue button does not lead to the success page but reloads the page with an error warning , the MATC module bevaves weird. (I am talking about the case when there is a warning box on top of the page, small or first (?) errors like too short entries sometimes just open a pop-up hint, no problem in this case) The problem: all entered data is still there and the matc checkbox is still checked (which is alright) BUT the Continue button is hidden. The button will be shown when you UNCHECK the checkbox now!! A click on the button will reload the page with the error note that you must check the checkbox! At least then the checkbox is again unchecked, when you check it the button appears and this time the account will be succesfully created. Apparently, the customer's data and the state of the check box were recovered when reloading the create_account page after the first error but the button is hidden by the code on top of matc.php nevertheless. So the button state (show/hide) does not match the state (checked/unchecked) of the checkbox. I found a solution for me but it is probably not the ideal one. Maybe anyone better in coding can sort out how to fix it properly (maybe to set 'checked' always to false whenever the page is loaded) (My solution was to show the button always, by removing the script on top of matc.php. I am fine with this as it is the way it is on many websites. I had to paste in the script in the template of the buy button on checkout_confirmation instead as otherwise you could buy there without checking the MATC checkbox) Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 15, 2018 Author Share Posted June 15, 2018 I just tried creating an account here but made a mistake on the form, like not entering the city, and when the page reloaded the checkbox was checked and the button was present. In your situation, does it matter which browser you are using? What php version are you using? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
inra311 Posted June 15, 2018 Share Posted June 15, 2018 I used Firefox, PHP 7.1 I made some little cosmetic changes to some files, like replacing the text next to the box with one with two html links (to conditions and to privacy_policy), and I set the check box left of the text instead of right. But I also tried with the original, unmodified files (I hope all...) to make sure that the problem was not related to my changes, and it was still there. Maybe I missed something? Will check again tomorrow. Quote Link to comment Share on other sites More sharing options...
inra311 Posted June 16, 2018 Share Posted June 16, 2018 I checked again and this time I made 100% sure I have only original files. The problem is still there! (Tested with Firefox and Microsoft Edge) 21 hours ago, Jack_mcs said: ...like not entering the city, and when the page reloaded the checkbox was checked and the button was present. I guess you missed it because of this: There seem to be (at least) two different 'error levels'. With just a 'minor' mistake the page 'reloads' like in the screenshot, with a popup note. No problem in this case, the MATC behaves correctly: Sometimes however the page reloads with a WARNING ON TOP (like password errors? or multiple errors? repeated errors? not sure why and when this is in contrast to the first error type): In this case the MATC button seems to be 'offset' with the checkbox (which is checked but no button): Unchecking will show the button now, 'Continue' will result in a MATC error: "you need to agree with the T & Cs.." Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 16, 2018 Author Share Posted June 16, 2018 Thank you for testing it. You are correct. The code doesn't work correctly when a non-javascript error occurs. Please try this change to see if it fixes it. Find <div class="buttonSet matc-button-wrapper"> <?php echo '<div class="text-right">' . tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-user', null, 'primary', 'id="TheSubmitButton"', 'btn-success'); ?></div> </div> and place this below it <?php if ($error) { echo '<script type="text/javascript">$(function() { $(".matc-button-wrapper").show(); }); </script>'; } ?> Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
inra311 Posted June 16, 2018 Share Posted June 16, 2018 Works fine now ! Quote Link to comment Share on other sites More sharing options...
♥Heatherbell Posted March 24, 2019 Share Posted March 24, 2019 @Jack_mcs Getting the same on screen warnings on checkout confirmation as another user posted above PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 350 etc. Changing application top does nothing and servers are unhelpful. Please do you know if you are posting update to this addon to fix this as we are keen to use it. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 24, 2019 Author Share Posted March 24, 2019 5 hours ago, Heatherbell said: PHP Warning: Illegal string offset 'type' in .../includes/functions/html_output.php on line 350 etc. This is caused by the code in the core file, the tep_draw_button function specifically. Here is a fix for this addon but the warnings will appear for any addon that uses the params parameter in the use of that function. In the includes/modules/content/checkout_payment/templates/tpl_cm_cp_continue_button_matc.php, change ?> <div class="col-sm-<?php echo $content_width; ?> cm-cp-continue-button-matc"> <div class="buttonSet matc-button-wrapper"> <?php echo '<div class="text-' . MODULE_CONTENT_CHECKOUT_PAYMENT_CONTINUE_BUTTON_MATC_ALIGNMENT . '">' . tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', 'id="TheSubmitButton"', 'btn-success'); ?></div> to $params = array(); $params['newwindow'] = ''; $params['params'] = 'id="TheSubmitButton"'; $params['type'] = ''; ?> <div class="col-sm-<?php echo $content_width; ?> cm-cp-continue-button-matc"> <div class="buttonSet matc-button-wrapper"> <?php echo '<div class="text-' . MODULE_CONTENT_CHECKOUT_PAYMENT_CONTINUE_BUTTON_MATC_ALIGNMENT . '">' . tep_draw_button(IMAGE_BUTTON_CONTINUE, 'fa fa-angle-right', null, 'primary', $params, 'btn-success'); ?></div> The above is for the MATC button on the payment page. If you use a different page, that code will have to be changed too. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥Heatherbell Posted March 29, 2019 Share Posted March 29, 2019 @Jack_mcs Thank you that worked. Quote Link to comment Share on other sites More sharing options...
♥Heatherbell Posted April 2, 2019 Share Posted April 2, 2019 @Jack_mcs Working but getting error Uncaught TypeError: Cannot set property 'onclick' of null Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 4, 2019 Author Share Posted April 4, 2019 On 4/2/2019 at 1:51 PM, Heatherbell said: Uncaught TypeError: Cannot set property 'onclick' of null How do I duplicate that error? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥Heatherbell Posted April 4, 2019 Share Posted April 4, 2019 @Jack_mcs Sorry I don't know what I'm doing, just a shop owner. Only just converted our shop to Frozen from Gold and still trying to get it to work like we had the Gold shop working. I was using Chrome to check my page https://cornishhoney.co.uk/checkout_confirmation.php (right click on page and click inspect and code screen opens on right - somebody showed me this - don't know what it is!) and see a white cross in a red circle in the code screen indicating 1 error which I guess might be a bad thing but as I said, the answer you gave in previous post made the MATC work. The error says: Uncaught TypeError: Cannot set property 'onclick' of null at checkout_confirmation.php:359(anonymous) @ checkout_confirmation.php:359 We also had your Article Manager working on our old Gold site but can't get it going on Frozen - I've made a load of extra information pages to replace it but would prefer Articles. Thanks so much for taking the time to even read this. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 5, 2019 Author Share Posted April 5, 2019 @HeatherbellNo need to apologize. What you provided was enough for me to see the problem. To fix it, find this in the includes/modules/matc.php file var modal = document.getElementById('matc-modal'); and add this above it var isModal = '<?php echo (MATC_SHOW_POPUP == 'True' ? 1 : 0); ?>'; if (isModal == 1) { Then a little lower in the file, find </script> and add this above it } I tested the above under 7.1 and it worked without error. There is a known problem with using the popup and not the text area option. That has been fixed in the next version. This doesn't have anything to do with this problem but I thought I would mention it in case you found that next. Regarding Article Manager, it has not been updated in almost three years so it won't work for newer php and CE versions. A new version is close to being released but it still might be a month or more before I can get to it. Heatherbell 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥Heatherbell Posted April 5, 2019 Share Posted April 5, 2019 Just did that and the scary white cross in a red circle error disappeared - yay! Glad to hear that Articles Manager will be reborn. Thank you so much for your time and help (and kind patience) - your hard work and ever friendly advice helps keep our family business going which is a big deal to us. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 5, 2019 Author Share Posted April 5, 2019 Always glad to hear my effort helps. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
♥Heatherbell Posted April 20, 2019 Share Posted April 20, 2019 @Jack_mcs How can I make the check box bigger? Quote Link to comment Share on other sites More sharing options...
♥Heatherbell Posted April 20, 2019 Share Posted April 20, 2019 Just noticed that the checkbox has an id="TermsAgree" in parameters so found a solution that works but I am not a coder so maybe not the best one: In includes/modules/matc.php near bottom of page before closing </style> add: #TermsAgree {height: 30px; width:30px} Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 20, 2019 Author Share Posted April 20, 2019 6 hours ago, Heatherbell said: Just noticed that the checkbox has an id="TermsAgree" in parameters so found a solution that works but I am not a coder so maybe not the best one: Good job. Heatherbell 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons 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.