| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
My solution to product imports using column names | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
My solution to product imports using column names
My Problem:
My product database has some extra fields not used by x-cart, and lacks some fields that are used by x-cart. The "Get column names from the first row of the CSV file" option was not working for me and I received an error complaining about the format of my field name header. It's not convenient for me to create a separate feed just for xcart because I have other needs for the feed, and prefer working with the same file for all applications. My feed's layout (\t used to indicate a tab; truncated to simplify example): product \t desc \t productcode \t field_not_used_by_xcart \t price X-cart's import facility seems to be extremely picky, and doesn't like the feed's format. I commented out the section of the code that checks the header for correct column names. I believe their code would require you to have every column included and none extra, which is why it was killing my feed. Since the code is not checking your columns for correctness, it's important that you do so! Here's the code to comment out: Code:
the /* ... */ pair is how you comment out the code. Creating the header: For nulls, don't actually type NULL, just leave a blank field. For example, my header for my example looks like product \t desc \t productcode \t \t price Notice I just left an extra tab where my extra field was. This worked fine for me, but as with all code-hacks, I'd be careful using this on a live site. Test it out on a test install first if you can. |
|||||||
#2
|
|||||||
|
|||||||
Moving to Custom Mods...or else this will just get lost in the Product Management forum. Thanks for contributing!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|