T: 773-433-8114

  • Home
  • Business Services
  • Technology Services
  • Resources
  • Blog
  • Contact us

June 5, 2015 By wbadmin

Business Catalyst Custom Order Fields

I have been doing a lot of work lately in Adobe Business Catalyst.  I am not sure that I would recommend this product to anyone, since there are many problems with the system and the lack of proper customer support.  However, I don’t want to get into that now.

One of the problems that I have been trying to solve is as follows.  Customer service at a company that I work for uses the same order entry system as the end user.  The bring up the external website and walk the customer through the process over the phone.  The problem is that we cannot track phone orders back to the referral source and therefore have no way of knowing the true number of acquisitions through adwords, for instance.

I wanted to add a checkbox to the check out form that asks if this order is customer service assisted.  This checkbox should only show up for orders originating from the company IP address.

Here are the challenges:

IP Address

Getting the user’s IP address in BC is straight forward.  There is a BC tag {module_visitoripaddress} for that purpose.  However, I did not want to have our IP address visible in the code, so I included a hash function.  The following code illustrates the approach using jquery:

String.prototype.hashCode = function() {
  if (Array.prototype.reduce) {
    return this.split("").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); 
  } else {
    var hash = 0, i, chr, len;
    if (this.length == 0) return hash;
    for (i = 0, len = this.length; i < len; i++) {
      chr = this.charCodeAt(i);
      hash = ((hash << 5) - hash) + chr;
      hash |= 0; // Convert to 32bit integer
    }
    return hash;
  }
};

Then insert the following in the $(document).ready function (replace the hashcode below with your own):

if("{module_visitoripaddress}".hashCode() == <hashcode for your ip address>) {
  $(".phone-order").css("visibility", "visible");
}

Attaching the field to an Order

The next challenge is to add a field to the order.  First, we need to extend the database by going to CRM->Extend CRM Database, and adding a new CRM form.  Put the additional fields into that form.

One thing that is not obvious in building a Business Catalyst site is that the Online Store Template for Registration – Buy uses a form defined in the Web Forms tab for submitting an order.  So, to add another field to the order,  you need to add the new CRM form to that web form (it may be called Check Out).  From there, you can copy the field from the generated HTML into the Registration – Buy template and, Voila!, you have a new field in your order.  Make sure to surround the new field with a div that has the phone-order class so that the above javascript will work.

(Unfortunately, the form HTML is not well formatted, so it is hard to find the right field.  One way to fix this is to copy the HTML from BC and paste it into dirtymarkup.com and click Clean.)

Adding a Survey Post Order

You can also add more details to the order on the Receipt – Buy page after the order has been processed.  The process is similar to above.  1.  Create a new CRM form with the information you want to capture and, this time, make sure to apply this form to the Order entity in the last tab of the CRM form creation process.  Because the form is submitted with an Order ID (&OID={module_oid}), BC will attach the data to that order.  2.  Create a web form and copy the code into the Receipt – Buy page.

 

Filed Under: Business Catalyst, Process Automation

May 12, 2015 By wbadmin

Automating File Downloads Using Existing Tools

Background

Recently, I started regularly examining some log files from a manufacturing plant in South Korea. We have two computers, one Dell and one Sony, at that manufacturing facility that run through a test procedure at the end of the manufacturing process. The software that automates this test procedure writes out an extensive log of everything it does into dated files in a folder on that computer.

The Problem

Every few days I would remotely log onto the computers at the manufacturing facility, navigate to the folders with the logs and transfer the logs to my own computer for examination.  Due to slower network speeds and the manual steps involved in the process, I could easily spend 10 minutes getting the files before I even started to examine them.

There must be a simpler way to get these logs automatically so that I could spend my time on more productive tasks.  So, the question was: how do I use off-the-shelf software to get the files to my computer without writing software or scripts?

The Solution

After examining several different options, I implemented a solution using the following tools:

  • Dropbox – for synchronizing the files.
  • SyncToy – for copying the log files into the correct Dropbox folder.  The help file describes how to schedule SyncToy to run automatically with the Task Scheduler in Windows.

To implement the solution, I did the following:

  1. Created a new Dropbox account so that other work files were not mistakenly synchronized to the computers at the manufacturing facility.
  2. Installed Dropbox on one of the manufacturing computers and created  Logs\Dell and Logs\Sony folders under the Dropbox folder.
  3. After confirming the email address for the new Dropbox account, I shared the Logs folder with the Dropbox account that I use on my computer.
  4. Installed SyncToy on that computer and created a folder pair as follows:
    1. The original logs folder is the Left Folder and the Dropbox\Logs\Sony folder is the Right Folder.
    2. In the second step, selected “Echo,” which echos changes from the Left Folder into the Right Folder.  This allows for the changes to only go one way.  Mistakenly making changes in the Dropbox folder will not affect the original files.
    3. Gave the pair a name and finished creating the pair.
    4. Once the pair was created, I clicked on the “Change options…” link and selected “Check file contents” since we want any changes in the content of files to be echoed to the Dropbox folder.
  5. Followed instructions in the help file to set up an automated task to run SyncToy at midnight.  Here are the instructions from the help file:

Windows Vista/ Win7

To schedule a task using the operating system:

  1. From the Start menu, select All Programs – Accessories – System Tools – Task Scheduler.
  2. Select Create Basic Task in the Actions pane on the right.
  3. Add a Name and Description and select Next.
  4. Choose when you want the task to start and select Next.
  5. Choose date/times (if applicable) to run task and select Next.
  6. Choose Start a Program option and select Next.
  7. Select Browse and locate the SyncToyCmd.exe.
  8. Type “-R” in the Add Arguments textbox. –R all by itself will run all folder pairs that are active for run all. If you want to run just a single folder pair, add –R “My Pair” to the end of the command line.

On Windows 8/8.1, you can find the Task Scheduler by pressing <WindowsKey> + x, selecting Control Panel, selecting Administrative Tools, then Task Scheduler.

I repeated the installation of Dropbox and SyncToy on the other computer and set up the folder pair and task scheduling.

Viola! Every night at midnight (South Korea time), files are copied from the Logs folder on both computers at the manufacturing facility to the appropriate folder in Dropbox.  Dropbox then synchronizes the files to my computer and I have access to the files without the manual work.

If you would like me to automate manual tasks for you please contact me at wbayever(at)wboptimum.com or 773-433-8114.  I look forward to helping you become more productive!

Filed Under: Process Automation Tagged With: process automation

Helpful Articles

  • Business Catalyst (1)
  • Consistent Customer Service (1)
  • Process Automation (2)
  • Uncategorized (2)

About Company

WB Optimum was established to help business owners get their operations under control, reduce stress, and spend time on the appropriate tasks.

Location

Chicago, IL
T: 773-819-0471

Copyright © 2023 · Wboptimum