Second Attempt: MATC on checkout_confirmation

Open to all! Ask other shopowners for help.
Post Reply
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Second Attempt: MATC on checkout_confirmation

Post 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.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: First Attempt: MATC on checkout_confirmation

Post 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
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: First Attempt: MATC on checkout_confirmation

Post 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?
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: First Attempt: MATC on checkout_confirmation

Post 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.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: First Attempt: MATC on checkout_confirmation

Post by burt »

Second Attempt, which should keep all previous the same but also fix the "status = disabled" problem;

Bughunt - MATC - Second Attempt.zip
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: First Attempt: MATC on checkout_confirmation

Post by heatherbell »

burt wrote: Thu Nov 09, 2023 11:27 am fix the "status = disabled" problem
Which it does 😀
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Second Attempt: MATC on checkout_confirmation

Post 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..
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Second Attempt: MATC on checkout_confirmation

Post 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.
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Re: Second Attempt: MATC on checkout_confirmation

Post 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.
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
Kofod95
Senior Contributor
Posts: 749
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Second Attempt: MATC on checkout_confirmation

Post 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
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply