Wordpress Hooks and WooCommerce

I'm setting up a WooCommerce interface in our Wordpress site for the purpose of collecting online donations, etc.  We're using Authorize.net as the payment gateway and their compliance guide states that we should have some sort of statement in the checkout process for users to confirm their intentions.  Something along the lines of   "By clicking the button below, I authorize [merchant’s name] to charge my bank account starting on [month, day, year] and on the [day of the month] of each month following through [month, date year] for the amount of [$XX.XX] for [description of the transaction]."

However, the checkout process does not seem to offer anything like that with the Authorize.net plugins out of the box.  How can I integrate this type of verbiage to ensure compliance?  Yes, I could add a "Terms of Service" page, but that wouldn't be in their face nor would it have dynamic/unique info relevant to their transaction like the suggested verbiage articulates.

I checked with WooCommerce support and they just pointed me to "woocommerce_review_order_after_submit" WooCommerce action to add this text.  However, I'm not really experienced with Hooks yet, though I'm anxious to learn.  I suspect this is simple for someone with experience and knowledge in this area, but I'm just not there yet.  Any assistance would be appreciated.
benjaminfamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

William NettmannPHP Web DeveloperCommented:
Hi,

Here is a starting point: In your theme's functions.php file, add the following:
// define the woocommerce_review_order_after_submit callback
function action_woocommerce_review_order_after_submit(  ) 
{
    // make action magic happen here, e.g.
  global $post;
  $currentOrder = new WC_Order($post->ID);
   echo "By clicking the button below, I authorize [merchant’s name] to charge my bank account starting on [month, day, year] and on the [day of the month] of each month following through [month, date year] for the amount of ${$currentOrder->order_total} for [description of the transaction].";
};
        
// add the action
add_action( 'woocommerce_review_order_after_submit',  action_woocommerce_review_order_after_submit', 10, 0 );

Open in new window

A bit of research may be required to find the other values you need from the order.

BTW, the code is a suggested starting point, and is not tested.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
benjaminfamAuthor Commented:
Thanks for your help.  This surely helps me to get on my way with figuring this out.  Like you said, I still have some other details to work out, but this gives me a jump start.  Much appreciated.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.