View Full Version : Product Code Restrictions
pnjfksx
04-05-06, 08:03 PM
I just upgraded a 4.12 store to 4.24 and am having problems with product codes. Our entire database is made up of product codes like M1234/40, but when we try to do anything to the product and update we get an error saying "Codes can only contain letters, numbers, underscores and dashes". How do I override this behavior?
Vic - WolfPaw Computers
04-05-06, 08:19 PM
Under domain settings, turn off Strict Validation.
I must warn you however, this is NOT a very good idea.
There is a reason MIVA restricts product and category codes from having some special characters in them...browsers do funky things when they encounter those.
I would strongly suggest you leave the strict validation on and change your codes to use underscores or dashes instead.
dotCOM_host
04-05-06, 08:20 PM
That is correct. Product codes, category codes, etc, should never contain any special characters that may be interpreted by the web browser differently from what you intended. For example, looking at your product code M1234/40 - it contains a forward slash. This product code will be included in URLs that display the link to the product itself. As you most likely know, the forward slash is used in web browsers to differentiate between directory paths. So, if you display a URL with this product code, SOME web browsers will see the forward slash and treat that as a separate directory, which in your case would be incorrect, and display a "fatal error page" instead.
Having said that, there is an option to disable Strict Code Validation in your store and allow these "bad" characters to be used. Your old v4.12 store wasn't checking for these characters and allowed them without problems, but newer versions of Merchant now check for these to prevent any problems. It's not advisable to turn off that feature, it would be better to change the product codes instead, to avoid any problems down the road. But, you can turn that feature off under your Domain Settings section in the store admin.
Vic - WolfPaw Computers
04-05-06, 08:30 PM
Your old v4.12 store wasn't checking for these characters and allowed them without problems, but newer versions of Merchant now check for these to prevent any problems.
Actually, the restriction can be circumvented in any version of Merchant when you import your products from a flat file.
Unfortunately, the import utility does not enforce strict validation - and is the most common reason product and category codes wind up in Merchant with disallowed characters even with strict validation turned on.
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.