コード例 #1
0
 /**
  * Sends product to Fortnox API
  *
  * @access public
  * @param $productId
  * @internal param int $productId
  */
 public function send_product_to_fortnox($productId)
 {
     include_once "class-woo-fortnox-controller.php";
     $controller = new WC_Fortnox_Controller();
     $controller->send_product_to_fortnox($productId);
 }
コード例 #2
0
function sync_product_callback()
{
    global $wpdb;
    // this is how you get access to the database
    include_once "class-woo-fortnox-controller.php";
    check_ajax_referer('fortnox_woocommerce', 'security');
    $controller = new WC_Fortnox_Controller();
    $message = $controller->send_product_to_fortnox($_POST['product_id']);
    echo json_encode($message);
    die;
    // this is required to return a proper result
}
コード例 #3
0
<?php

require_once 'wp-load.php';
include_once 'wp-content/plugins/woocommerce-fortnox-integration/class-woo-fortnox-controller.php';
$fortnox_interface = new WC_Fortnox_Controller();
$fortnox_interface->run_inventory_cron_job();