Integrate Wordpress with Oracle

Asked

Viewed 605 times

0

I will develop a "E-commerce" services in Wordpress, known as Woocommerce, except that I need to integrate it with Oracle, in addition to the Mysql itself that it will run...

Example: When someone hires a service, I need them to send some information from this purchase to my Oracle bank.

Do you know how I can do this? Is there a plugin or will I have to study architecture and make my own adaptations of what I need? There is another tool that you indicate other than Wordpress itself?

  • You want to keep Mysql for WP stuff and record some information on a separate Oracle basis, that’s it?

  • That’s right, I just want to send you some user information after you’ve made your purchase.

1 answer

0


Use the hook save_post for this. It runs immediately after a post has been recorded in the bank, and loads the information that has been sent. Then you connect to Oracle using PDO and follows as if it were a common PHP application:

add_action( 'save_post', 'enviar_dados_pro_oracle', 10, 3 );
function enviar_dados_pro_oracle( $post_id, $post, $update ) {

    /* faça sua validação aqui, permissões de acesso, nonces, etc */

    if ( wp_is_post_revision( $post_id ) )
        return;

    $pdo = new PDO();
    /** todo o resto da sua rotina com PDO aqui */

}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.