• This topic has 7 replies, 3 voices, and was last updated 6 years ago by Anonymous.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #57134
    Anonymous
    Inactive

    Franky – I’m trying to import a cvs discount code file and can’t get it to work. As far as I can see I’m doing everything right but I get an error “Not all required fields present”. This is the first two lines of the CSV File.
    “name”,”type”,”coupon”,”dgroup”,”value”,”maxcount”,”expire”,”strcase”
    “Prepaid Voucher”,”2”,”2018/001”,”tours”,”100”,”1”,”2018-12-31”,”0”

    Am I missing something obvious here? As far as I can tell I’m doing what the documentation says. I’ve created this file in MAC textedit.

    THANK YOU

    #57136
    Franky
    Keymaster

    Use correct double quotes (not word-like ones) and it will import just fine (just tried your lines here).

    #58015
    Anonymous
    Inactive

    Franky – this worked last time I tried it, but I’m trying to add more discounts and for some reason it’s not doing it. I’m sure I’ve got the right type of quotes now, but when I try I get “0 imports, 0 errors.” Is there an error log somewhere so I can try and diagnose?

    “name”,”coupon”,”type”,”value”,”dgroup”,”maxcount”,”expire”
    “PPVoucher01″,”2018005″,”2″,”100″,”tours”,”1″,”2018-12-31″
    “PPVoucher02″,”2018006″,”2″,”100″,”tours”,”1″,”2018-12-31″
    “PPVoucher03″,”2018007″,”2″,”100″,”tours”,”1″,”2018-12-31″

    Thank you

    #58016
    Anonymous
    Inactive

    Franky – forget this – I’ve cracked it now. It was a CR/LF issue in the text file.

    #58618
    Anonymous
    Inactive

    Having the same problem… can you specify what solved it?

    Should it be CR/LF?
    Just LF?
    Just CR?

    #58619
    Anonymous
    Inactive

    except “people” instead of discount codes. When you have the answer, it should probably be added to the documentation.

    #58621
    Franky
    Keymaster

    Just using unix line ending should work fine … I guess even windows line endings should be ok. PHP has a function that parses csv, but it is sensitive to line endings (like everything in php in fact). See also: https://stackoverflow.com/questions/4541749/fgetcsv-fails-to-read-line-ending-in-mac-formatted-csv-file-any-better-solution

    #58622
    Anonymous
    Inactive

    I couldn’t make it work using excel csv file but once I switched to a txt file (using a mac and the correct quote marks) it worked Ok. Hope that helps.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top