Zen Cart Logo
Forums / General Questions / Need alert for duplicate part numbers

Need alert for duplicate part numbers

Locked

Views: 1,784

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
26 May 2009, 11:27 PM
#1
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Need alert for duplicate part numbers

Is there a way to make Zencart recognize that you may be loading/using a duplicate part number?

We're loading products and every so often, whether due to 'fat fingering' or misreading a number, or whatever, we assigned a part number to the new product and then realize that we entered a part number that was already used.

There should be an alert that a part number is already being used.
Can this be done?

Part number = sku number = model number (however you want to phrase it)

27 May 2009, 4:47 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Need alert for duplicate part numbers

beyre:

Is there a way to make Zencart recognize that you may be loading/using a duplicate part number?

We're loading products and every so often, whether due to 'fat fingering' or misreading a number, or whatever, we assigned a part number to the new product and then realize that we entered a part number that was already used.

There should be an alert that a part number is already being used.
Can this be done?

Part number = sku number = model number (however you want to phrase it)

Probably the easiest way to do this is via the SQL database rather than zencart itself.

The way to do this would be to use your favourite SQL interface (eg, phpMyAdmin), locate the table and field that holds your part numbers, and set it to 'unique'.

Cheers
RodG

27 May 2009, 4:53 AM
#3
default1001 avatar

default1001

New Zenner

Join Date:
May 2009
Location:
Tacoma, WA
Posts:
10
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

RodG:

Probably the easiest way to do this is via the SQL database rather than zencart itself.

The way to do this would be to use your favourite SQL interface (eg, phpMyAdmin), locate the table and field that holds your part numbers, and set it to 'unique'.

Cheers
RodG

True, but wouldn't that fail silently? I think the poster wanted some way to alert whoever was inputting that id..

27 May 2009, 5:15 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Need alert for duplicate part numbers

default1001:

True, but wouldn't that fail silently?

To be perfectly honest, I'm not 100% sure.
What makes you think it will fail silently?
I'm working under the assumption that since this will produce an unexpected error (something that by definition zencart isn't coded to gracefully handle) it will probably produce an onscreen error.

I could be wrong, and it'll only take a second to prove/disprove either way, but I'm not on my home computer at the moment so I can't personally verify.

Cheers
Rod

27 May 2009, 1:18 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

Rod's solution may also present problems with DUPLICATED and LINKED products - a core zencart feature...

27 May 2009, 3:02 PM
#6
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

Schoolboy - are you saying that Rod's solution is a correct one then, or that it will open another set of problems?

27 May 2009, 3:13 PM
#7
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

Or is there another solution?

27 May 2009, 3:22 PM
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Need alert for duplicate part numbers

schoolboy:

Rod's solution may also present problems with DUPLICATED and LINKED products - a core zencart feature...

I agree that there may be many possible problems caused by my suggestion, but what are the alternatives?

Ideally the best solution to the problem would be to hack the the zencart code to perform a check and produce a nice controlled error if the product already exists, but this is going to take more time and will require php skills to implement.

I believe that my suggestion is still worth a try on the basis that it will be quick and easy and doesn't require any coding skills or code changes. If it does cause a problem (which is yet to be confirmed) nothing will have been lost by trying it.

Hopefully unless someone comes up with a better idea beyre will at least give it a go and report the findings. It'd be a real shame if s/he didn't even give it a go simply because people are concentrating on possible problems and reasons why it may not work. Lets not kill the idea without further data.

Cheers
Rod

27 May 2009, 3:29 PM
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Need alert for duplicate part numbers

beyre:

Schoolboy - are you saying that Rod's solution is a correct one then, or that it will open another set of problems?

It is neither correct nor incorrect. It is simply a suggestion as to what I would be trying first before considering more complex solutions. If it works as I expect your problem is solved. If it doesn't work, or causes other problems then your only other option will be to hack the zencart code itself.

If you already have duplicated products in your database you may not even be able to make my suggested change until the duplicates are removed.

Cheers
Rod

27 May 2009, 4:06 PM
#10
beyre avatar

beyre

Zen Follower

Join Date:
Feb 2009
Posts:
422
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

Rod,

Thanks so much for the further explanation.

I will ask my database guru to do this for me. Databases and I are not friends grins

~ Barbara

27 May 2009, 4:13 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Need alert for duplicate part numbers

Here's a thought...

Zencart already has the ability to recognise if a customer's email address exists in the database, and if a customer tries to register using an email address that already exists, the system throws up an "alert" saying that the address already exists. It does not complete the registration unless:

  1. A different email address is used.
  2. The customer uses that address to login to the existing account.

It may be possible to "clone" this function so that the same alert comes up if your input clerk enters a product code that already exists in the database.

Ideally, you would like a system that generates an alert, but allows the user to force an override... it may be INTENTIONAL that the clerk is trying to input a duplicate number (duplicated/linked products), so that in an event where the duplicate is actually intended, it can still be written to the database.