Order API questions

This is an archive of old posting to the User Forum

Order API questions

Postby Allen Murdock » Sun Mar 09, 2003 5:40 am

All -

I'm trying to use the Order API to produce output from ShopSite that will
work with my client's order management system. The client uses Mail Order
Manager (M.O.M.).

The biggest problem I have identified so far is that SS uses only one field
for the customer name, and M.O.M. uses two. Parsing using spaces won't work
when a customer's name is, for example, Dick Van Dyke.

The other difficulty is that M.O.M. represents countries as lists of
numbers, but SS uses two letter country codes.

Has anyone out there been able to get around these issues? I'd really
appreciate some help.

- Allen
Allen Murdock
 

Re: Order API questions

Postby Barney Stone » Sun Mar 09, 2003 1:22 pm

We have a program that imports orders from ShopSite and converts them to the
correct format for import into M.O.M., including dealing with country codes,
parsing out the first and last name, order options, etc. Give me a call
during the week and I will tell you more about it.

- Barney Stone, President
Stone Edge Technologies, Inc.
215-641-1837
www.ECommerceUtilities.com


"Allen Murdock" <murdock@spam-me-not.clamco.com> wrote in message
news:b4f9av$duj$1@support.shopsite.com...
All -

I'm trying to use the Order API to produce output from ShopSite that will
work with my client's order management system. The client uses Mail Order
Manager (M.O.M.).

The biggest problem I have identified so far is that SS uses only one
field
for the customer name, and M.O.M. uses two. Parsing using spaces won't
work
when a customer's name is, for example, Dick Van Dyke.

The other difficulty is that M.O.M. represents countries as lists of
numbers, but SS uses two letter country codes.

Has anyone out there been able to get around these issues? I'd really
appreciate some help.

- Allen

Barney Stone
 

Re: Order API questions

Postby Rob » Sun Mar 09, 2003 2:16 pm

The biggest problem I have identified so far is that SS uses only one
field
for the customer name, and M.O.M. uses two. Parsing using spaces won't
work
when a customer's name is, for example, Dick Van Dyke.

If you're using perl, just use split and a little string manipulation to get
it to work:
$name = <shopsite name field>;
($first, $last1, $last2, $last3) = split (/\s+/,$name);
$last = $last1;
if ($last2 ne "") {$last .= " " . $last2;}
if ($last3 ne "") {$last .= " " . $last3;}

The other difficulty is that M.O.M. represents countries as lists of
numbers, but SS uses two letter country codes.

You could use a simple case / if lookup to convert names to numbers if you
have a list of the country numbers in M.O.M.

HTH

Rob
Rob
 

Re: Order API questions

Postby Allen Murdock » Mon Mar 10, 2003 12:08 am

Rob -

Thanks for the suggestion. Seems that would probalby work for most names.

I had considered just using grep to lookup numeric country codes from a text
file. It wouldn't be elegant, but it would work.

- Allen

On 3/9/03 12:16 PM, in article b4g7f6$fjq$1@support.shopsite.com, "Rob"
<rob@mangiafico.net> wrote:

$name = <shopsite name field>;
($first, $last1, $last2, $last3) = split (/\s+/,$name);
$last = $last1;
if ($last2 ne "") {$last .= " " . $last2;}
if ($last3 ne "") {$last .= " " . $last3;}
Allen Murdock
 

Re: Order API questions

Postby Dan Coutu » Mon Mar 10, 2003 1:25 pm

Allen Murdock wrote:
All -

The biggest problem I have identified so far is that SS uses only one field
for the customer name, and M.O.M. uses two. Parsing using spaces won't work
when a customer's name is, for example, Dick Van Dyke.


You are not going to find a reliable algorithm for this one. All you can do
is establish a rule and use it. But it *will* result in the name getting
split wrong sometimes. Consider these names:

Mary Ann Jones, she considers her *first* name to be "Mary Ann". Her middle
name is Elizabeth.

Your example, Dick van Dyke, is a two word *last* name. There are also
three word last names such as "van der Meer".

Some people have many names, in some countries is not unusual for a person
to have from four to eight names.

The other difficulty is that M.O.M. represents countries as lists of
numbers, but SS uses two letter country codes.


I'm betting that M.O.M. uses the ISO numeric country codes where ShopSite
uses the ISO alphabetic country codes. This is a simple hash array lookup.
You just need the mapping between the two and you're all set. This is not a
hack but rather is the proper way to do this.

Dan
Dan Coutu
 

Re: Order API questions

Postby Allen Murdock » Mon Mar 10, 2003 2:00 pm

Dan -

Thanks for the response. I see your point about the name parsing.
Obviously, even if the system offered first, middle, and last name fields,
there would still be times when it wouldn't be right.

I'm happy to live with getting it right most of the time and managing by
exception.

As a nearly clue-free guy who is not a real programmer, I thought grepping a
text file to look up the country code number was a klugey idea. Thanks for
telling me that the "hash lookup array" is a normal procedure. It makes me
feel better about using that approach. ;-)

- Allen


On 3/10/03 11:25 AM, in article 3E6CE695.1010009@snowy-owl.com, "Dan Coutu"
<coutu@snowy-owl.com> wrote:

Allen Murdock wrote:
All -

The biggest problem I have identified so far is that SS uses only one field
for the customer name, and M.O.M. uses two. Parsing using spaces won't work
when a customer's name is, for example, Dick Van Dyke.


You are not going to find a reliable algorithm for this one. All you can do
is establish a rule and use it. But it *will* result in the name getting
split wrong sometimes. Consider these names:

Mary Ann Jones, she considers her *first* name to be "Mary Ann". Her middle
name is Elizabeth.

Your example, Dick van Dyke, is a two word *last* name. There are also
three word last names such as "van der Meer".

Some people have many names, in some countries is not unusual for a person
to have from four to eight names.

The other difficulty is that M.O.M. represents countries as lists of
numbers, but SS uses two letter country codes.


I'm betting that M.O.M. uses the ISO numeric country codes where ShopSite
uses the ISO alphabetic country codes. This is a simple hash array lookup.
You just need the mapping between the two and you're all set. This is not a
hack but rather is the proper way to do this.

Dan
Allen Murdock
 


Return to User Forum Archive

Who is online

Users browsing this forum: No registered users and 61 guests