The Volusion API can be integrated with the Google Gadget API. Google Gadgets API consists of a few simple building blocks: XML, HTML, and JavaScript. The easiest way to get started writing gadgets is to use the Google Gadgets Editor (GGE). GGE lets you edit gadget specs and click Preview to see the live results of your changes, without even leaving the Developer Guide. You can also use GGE to save, host, and publish gadgets.

To test this gadget all you need to do is add a Gadget in Google Desktop or iGoogle.

Remember to edit the settings with your store's URL and user info.

Sample Google Gadget

This sample gadget retrieves and displays new orders.

<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
<ModulePrefs title="Volusion New Orders" height="220" width="175"
scrolling="false" author="Volusion, Inc." author_email=""
screenshot=""
description="Volusion New Order Alert"
thumbnail="http://www.volusion.com/assets/images/volusion_apps/volusionapp_default_icon.gif" />
<UserPref name="s_url" display_name="URL" required="false" />
<UserPref name="s_email" display_name="Login Email" required="false" />
<UserPref name="s_password" display_name="Encrypted Password" required="false" />
<UserPref name="s_interval" display_name="Seconds" required="false" />
<Content type="html">
<![CDATA[
  <style type="text/css">
    body {
      width:200;
      height:230;
      background-repeat: no-repeat;
    }

    .regular {
      font-family: calibri;
      font-size: 12px;
      color: #000000;
    }
  </style>

  <script type="text/javascript">
    var chkConn;
    var s_url = "";
    var s_email = "";
    var s_password = "";
    var s_interval = "";

    function load_gadget() {
      if (isNaN(s_interval) == true || s_interval == "") {s_interval = 5;}
      load_settings();
      chkConn = setInterval(download_orders, 5000);
    }

    function load_settings() {
      var prefs = new _IG_Prefs();

      s_url = prefs.getString("s_url");
      s_email = prefs.getString("s_email");
      s_password = prefs.getString("s_password");
      s_interval = prefs.getString("s_interval");
    }

    function download_orders() {
      try {
        var api_url = "http://" + s_url + "/net/WebService.aspx?
        Login=" + s_email + "&EncryptedPassword=" + s_password +
        "&API_Name=Generic\\Orders&SELECT_Columns=o.OrderID,o.OrderStatus,od.TotalPrice&
        WHERE_Column=o.OrderStatus&WHERE_Value=New&random=" + Math.random();
   
        var xmlhttp;
        var api_response = "";

        _IG_FetchContent(api_url, function (response) {
          if (s_url == "" || s_email == "" || s_password == "") {
            content_area.innerHTML = "Check settings";
          } else {
            display_orders(response);
          }
        },
        1
        );
      } catch(err) {
        if (s_url == "" || s_email == "" || s_password == "") {
          content_area.innerHTML = "Check settings";
        } else {
          content_area.innerHTML = "Unable to connect";
        }
      }
    }

    function display_orders(api_response) {
      var xml_api;
      var xml_order;
      var xml_order_detail;
      var node_order_details;
      var i = 0, j = 0;
      var order_id = "";
      var total_price = 0;
      var order_price = 0.0;
      var html_orders = "";
      var order_count = 0;

             
      html_orders = html_orders + "<table border=0 cellpadding=0 cellspacing=0 width=110>";
      html_orders = html_orders + "<tr><td><font style=\"color:#000000;font-family:calibri;
      font-size:12px;\"><b>Order ID</b></font></td><td align=right><font style=\"color:#000000;
      font-family:calibri;font-size:12px;\"><b>Total</b></font></td></tr>";
       

      try {
        xml_api = new ActiveXObject("MSXML2.DOMDocument");
        xml_api.loadXML(api_response);
        node_orders = xml_api.getElementsByTagName("Orders");

        xml_order = new ActiveXObject("MSXML2.DOMDocument");
        xml_order_detail = new ActiveXObject("MSXML2.DOMDocument");

        if (node_orders.length > 0) {
          for (i = node_orders.length - 1; i > -1; i--) {
            xml_order.loadXML(node_orders.item(i).xml);
            order_id = get_node_text(xml_order, "Orders/OrderID");
            order_price = 0.0;
            node_order_details = xml_order.getElementsByTagName("Orders/OrderDetails");
            if (node_order_details.length > 0) {
              for (j = 0; j < node_order_details.length; j++) {
                xml_order_detail.loadXML(node_order_details.item(j).xml);
                total_price = get_node_text(xml_order_detail, "OrderDetails/TotalPrice");
                if (isNaN(total_price) == false) {
                  order_price = parseFloat(order_price) + parseFloat(total_price);
                }
              }
            }
            html_orders = html_orders + "<tr><td>" + order_id + "
            </td><td align=right>$" +
            (Math.round(order_price * 100) / 100).toFixed(2) + "</td></tr>";
            order_count++;
            if (order_count > 10) {break;}
          }
        }
      } catch(err) {
        //error parsing xml
      }
      html_orders = html_orders + "</table>";
      content_area.innerHTML = html_orders;
    }

    function get_node_text(xml_doc, node_name) {
      var current_node;
      var node_text;
      current_node = xml_doc.getElementsByTagName(node_name);
      if (current_node.length > 0) {node_text = current_node.item(0).text;}
      return node_text;
    }
  </script>

  <body onload="load_gadget()" style="margin:0px;" >
   
     <center>
       <table border=0 cellpadding=0 cellspacing=0 style="margin:0px">
         <tr><td><div style="margin:0px;" x="1" y="1" id="content_area">
           <font style="color:#000000;font-family:calibri;font-size:12px;\">Loading...</font></div>
         </td></tr>
       </table>
     </center>
     
  </body>
]]>
</Content>
</Module>
Did this answer your question?