V5 Bulk Product Importer problem,pervious method does not work now

hi guys ,i step by step fellow this method to import bulk product, unfortunately, its not work now.

SambaPOS4 Bulk Product Importer

any one can make a now script for V5 version? Thanks a lot.

One option is you can now import products using YAML. Read here for more info

If you already have product data in Excel or CSV format, you can use a formula in Excel to convert data into YAML:

This is not a version 5 issue. This is highly customized user made script and likely there is something in the script needs updated by you.

Issue category is for Sambapos errors or problems that are not configuration mistakes that should work but are not.

1 Like

@weebo To fix that error you need to change the php so it puts 0 in table dbo.ScreenMenuItems and dbo.ScreenMenuCategories for column Appearance instead of NULL

PS: There might be few more areas we need to tweak. This is the one negative side to custom solutions like this, often changes may be made to the structure of the database that would need to also be made in the script. If you do not know or understand how the php is working then perhaps you might want to implement a different solution like what @markjw suggested.

Even though small changes may be needed from time to time for this php to continue working this still does not mean it is a SambaPOS issue. SambaPOS is doing exactly what its supposed to do.

1 Like

Thanks markjw,I try this method before,this method just can import product list,but I want import product list and inventory item together,bcz I have 341data need to import,the price was show in product list and the cost show in inventory items.so for me,I need a tool to import those thinks together.so I found this method working in V5 very well but no is doesn’t work in V5

Thank you for reporting the problem with the PHP script.

Kendash has answered your question:

If I have time, I might update the PHP so that it works properly.

1 Like

Thanks for your replay, today i try to modify the PHP, if working perfect, i will let you know,thanks a lot.

1 Like

After i modify the PHP script, the importing function was working, but also had a little i really don’t know how to solve now.


From <'FOX’S CRYSTAL CLEAR FRUIT> until end can not to import, so i delete pervious items and reimport again, still can not, same error message “Executing SQL directly; no cursor.”
After i google it, one guy say i should put "sqlsrv_configure(“WarningsReturnAsErrors”, 0);"in the script, after i done this, the problem still there, so i really dont know how to do it now.

I think because the product has a quote character ' in the name (Fox's) and because the string is quoted with single quotes, any quote characters need to be escaped (I haven’t looked at the code myself). What do you think @QMcKay ?

2 Likes

Yes, very likely the issue.

Even though I updated the script(s) to be more modular, and to accommodate newer fields in SambaPOS5 DB Tables, the script is far from perfect. We should be escaping such things, and using prepared statements, both of which would make this issue moot.

In any case, the quick fix is to fix the data… remove any single quotes found in any of the the CSV fields and try again.

1 Like

Thanks a lot, i already fix the issue, after i modify your script according DB Tables, and also deleted the <’>from my excel file.By the way, Thank you so much.

2 Likes

Are there any samples of prepared statements for importing products from csv?
I was going to try using the v4 bulk importer but if there is a better method I would like to try that.

Basically I would like a similar setup to the v4 script with options to create inventory items, add to menus etc.

No. I am talking about the PHP code. It could be revised to use prepared statements rather than concatenated strings. It should alleviate the need to escape certain things like single quotes.

There is no better method at this time. The bulk importer is the “most complete” method for doing this. It inserts Products, Menu Items, Inventory Items, and Recipes for 1-to-1 products, all in one shot, very quickly and efficiently.

V5 Bulk Importer has been updated …

1 Like