GithubHelp home page GithubHelp logo

jfoc / integration-tools-between-amelia-and-woocommerce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from craigt543/craigt543

0.0 1.0 0.0 34 KB

Integration tools for Amelia - WordPress Appointment and Event Booking Plugin and Woocommerce

License: GNU General Public License v3.0

PHP 100.00%

integration-tools-between-amelia-and-woocommerce's Introduction

CraigT543

Integration tools for Amelia - WordPress Appointment and Event Booking Plugin and Woocommerce

I am sharing some functions that help more completely integrate Amelia with Woocommerce. Out of the box Amelia does ok if a client books on their own. But if payment is recieved in the office there is no integration. One must record the payment in both Amelia and in Woocommerce if you need your clients to have access to a pay invoices on line.

The amilia-users-update.zip WP Plugin

I am a solo practitioner and not a clinic. So this works great in that context. If you plan to impliment the functions for your clinic, adjustments may need to be made. These tools presuppose that you have a website that requires log in prior to booking an appointment. In my case I have a client portal that clients must log in to use. So, the wordpress User ID needs to be linked to the Amelia User ID and the Woocommerce User ID for all existing clients and for new registers. The first item I have developped is a plugin to migrate all existing wordpress users to be Amelia users: amilia-users-update.zip. You essentially use this plug in once and you are done you can delete it when it has finished. Load it manually. Activate it. And you will then see it in the settings portion of your wp-admin dashboard as "Amelia User Update". When you click into that you will be brought to a page with one button that says "Update Amelia Users Table". Push that button and then all current wp users are now imported into Amelia as users. You now can deactivate and delete the plug in.

WP functions.php

In the functions.php file I have a group of functions that can be pasted into your child theme's functions.php file. Or you can make it into a plug in. Both will work. I recommend the plugin method.

TABLE OF CONTENTS

  1. Add users on login
  2. Schedule Hook to Run update_my_wc_orders() at least daily
  3. My Amelia Orders Webhook Endpoint
  4. Function to Update WC Orders to Reflect Amelia Appointments Payment Status -- update_my_wc_orders()
  5. Function to Update Amelia Orders to Reflect Customer On-line Payment

The first function, add_users_on_login() will make any new regestered user an Amelia user as well. The schedule hook assumes that you are running WP-Cron (recommended but not required). The Amelia Orders Webhook requires that you add the webhook into Amelia's admin pannel at settings>integrations>webhooks. Fill in the form thus:

Click to save this and it will run when an appointment booking is completed. Webhooks have a bit of a delay so wait a few minutes and you will see the order created in Woocommerce. If you have WP-Cron running, every night it will update any changes that you have made in your appointments durring the day. And it will update any time you enter payments in amelia on the admin pannel and mark them as paid. This will then be reflected in Woocommerce.

The last function updates Amelia if a customer makes an on-line payment to the Wordpress Orders Pannel

integration-tools-between-amelia-and-woocommerce's People

Contributors

craigt543 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.