Page 1 of 1

Second Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 10:42 am
by burt
This update will add in a True/False (default: False) selector in the cd_matc module which will allow shopowner to choose whether the MATC is needed in the checkout_confirmation.php page.

Re: First Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 10:43 am
by burt
Fileset Changes

/includes/modules/customer_data/cd_matc.php
- add new True False option
- add extra line of logic to display hook only if True

Summary

1 modified file

Re: First Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 10:46 am
by burt
Please test to destruction on a TEST site. I have done minimal testing, but it looks OK..

Have the MATC (checkout) turned TRUE, does it stop the checkout until the shopper clicks. Any problems ?
Have the MATC (checkout) FALSE - it should not show and should therefore allow a checkout. Any problems ?
Have the MATC turned off on all of the customer pages, but turned on in the checkout. Any problems ?

AND:
Does the MATC still show on selected customer pages?

Re: First Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 11:18 am
by heatherbell
Have the MATC (checkout) turned TRUE, does it stop the checkout until the shopper clicks. Any problems ?
No
Have the MATC (checkout) FALSE - it should not show and should therefore allow a checkout. Any problems ?
No
Have the MATC turned off on all of the customer pages, but turned on in the checkout. Any problems ?
No
Does the MATC still show on selected customer pages?
Yes

However, disable the module and MATC still shows on checkout which I find unexpected.

Re: First Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 11:27 am
by burt
Second Attempt, which should keep all previous the same but also fix the "status = disabled" problem;

Bughunt - MATC - Second Attempt.zip

Re: First Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 11:35 am
by heatherbell
burt wrote: Thu Nov 09, 2023 11:27 am fix the "status = disabled" problem
Which it does 😀

Re: Second Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 11:43 am
by burt
TY for testing. As it's in a CD module I'd like Matt @ecartz to have a quick glance at it to ensure that these minor changes make no unintended consequences - I'm pretty sure it's all fine..

Re: Second Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 1:02 pm
by ecartz
This would work, but is unnecessary. Rather than make the hook always run on checkout confirmation and only sometimes display, just delete the hook if you don't want it and add it if you do. I.e. let the hook be the configuration.

Re: Second Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 4:27 pm
by burt
ecartz wrote: Thu Nov 09, 2023 1:02 pm This would work, but is unnecessary. Rather than make the hook always run on checkout confirmation and only sometimes display, just delete the hook if you don't want it and add it if you do. I.e. let the hook be the configuration.
Yes, I think I said similar in the original bug report - delete the hook deletes the checkout matc.

However;
Delving into the DB is never ideal for Joe Average.

Re: Second Attempt: MATC on checkout_confirmation

Posted: Thu Nov 09, 2023 8:54 pm
by Kofod95
burt wrote: Thu Nov 09, 2023 4:27 pm However;
Delving into the DB is never ideal for Joe Average.
Very much agree!
Would it be possible to use the configuration to add/delete the hook in the DB?
Something like

Code: Select all

function save(){
  if($_POST['MODULE_CUSTOMER_DATA_MATC_CHECKOUT'] == 'True' && !defined(MODULE_CUSTOMER_DATA_MATC_CHECKOUT)) $db->query("INSERT ...
Of course it needs to insert when needed, delete when needed and do nothing the rest of the time, so might just be too much for too little, now you have made a simpler solution that works well :)

//Daniel