alwayspaws Posted January 3, 2018 Author Posted January 3, 2018 @zimmer-media said in How to edit field separators used for back office CSV imports: Can you please give me your code? At least you have the comma for the multiple value separator, which should be in mine in the back office CSV import section, but it is not. It is a semicolon even though the code I posted clearly shows it is a comma. My updated field separator code and updated multiple value separator code is as follows: {l s=‘Field separator’} {l s='e.g. '} 1, Blouse, 129.90, 5 {l s=‘Multiple value separator’} {l s='e.g. '} red.jpg; blue.jpg; green.jpg Thank you.
zimmer-media Posted January 3, 2018 Posted January 3, 2018 @alwayspaws Sorry Stephanie. I did not change the code at my core. My CSV files are set since Prestashop so that the field separator is a semicolon and a comma for multiple values. Therefore, I only exchange the two fields when importing. The default is a comma as a field separator and a semicolon as a multiple value. No matter if I work with Excel or eg OpenOffice. I only exchange the two details before importing (as in the picture). Anything else would just be extra work for me.
alwayspaws Posted January 3, 2018 Author Posted January 3, 2018 @zimmer-media I am not asking if you changed it. I'm asking if you have this file: admin folder \themes\default\template\controllers\import\helpers\form\form.tpl Can you copy and paste here the code you have for this? In other words if you have the file, the code should be there. {l s=‘Multiple value separator’} {l s='e.g. '} red.jpg; blue.jpg; green.jpg zimmer-media Posted January 3, 2018 Posted January 3, 2018 @alwayspaws I do not use a custom code for this. It is the original TB file. alwayspaws Posted January 3, 2018 Author Posted January 3, 2018 That is what I would like please zimmer-media Posted January 4, 2018 Posted January 4, 2018 @alwayspaws standard file tb 1.0.3 01515024061407form.tpl alwayspaws Posted January 4, 2018 Author Posted January 4, 2018 Thank you! I'll post if this helped. zimmer-media Posted January 4, 2018 Posted January 4, 2018 @alwayspaws Have you ever tried the import with your own separator without changing this file? I do not know if it works. Since TB it is possible to import csv as well as .xls, .xlsx, .xlst, .ods, .ots. Since I myself do not need any changes, I did not concern myself with it. For the import with special separator I think (guess) that a change of this one file is not enough. I guess that is responsible for another file. In my view, it is a small but important form for import. I assume that at least one more file for import is at the core. alwayspaws Posted January 4, 2018 Author Posted January 4, 2018 @zimmer-media said in How to edit field separators used for back office CSV imports: For the import with special separator I think (guess) that a change of this one file is not enough. I guess that is responsible for another file. In my view, it is a small but important form for import. I assume that at least one more file for import is at the core. Exactly what I am trying to get at. I want to know what other file(s) I need to edit to change the field separator and multiple value separator. I just uploaded your form.tpl and the result is still wrong. It still shows the multiple value separator as a semicolon but your screenshot shows it as a comma. Thank you for the help. I'm going to try to "recruit" other tb users to help me with this. @lesley @Traumflug @mdekker @Nemo Please look at this for me. What files are needed to change the default field separators used for back office CSV imports? form.tpl and what else? Thanks, Stephanie alwayspaws Posted January 5, 2018 Author Posted January 5, 2018 Why this is important to me: I spend the bulk of my time importing products with combinations. With so many coders here, I don’t understand why this topic hasn’t been answered. I especially want to know why everyone has the multiple value separator as a comma in the csv import page and I have a semicolon even though I’m using the original form.tpl for thirty bees that @zimmer-media very kindly gave me. Looking forward to the solution so this can finally be solved. In the meantime I’ll keep looking for the answer. datakick Posted January 5, 2018 Posted January 5, 2018 @alwayspaws if you want to change default separator, you don't really have to modify form.tpl. Try change line #570 in /controllers/admin/AdminImportController.php you want to change the character at the end of the line, ie: $this->multiple_value_separator = ($separator = Tools::substr(strval(trim(Tools::getValue('multiple_value_separator'))), 0, 1)) ? $separator : '^'; alwayspaws Posted January 5, 2018 Author Posted January 5, 2018 @datakick Where have YOU been all my thirty bees life? :) This was absolutely perfect. I really appreciate it. Sending a hug (because I can. I can do anything I want. lol) For others: I changed the field separator and multiple value separator for the back office CSV imports by following @datakick's example: Edited this file: /controllers/admin/AdminImportController.php Line 568 Changed the comma to a caret (^) Line 570 Changed the semicolon to a comma as follows: $this->separator = ($separator = Tools::substr(strval(trim(Tools::getValue('separator'))), 0, 1)) ? $separator : '^'; $this->convert = false; $this->multiplevalueseparator = ($separator = Tools::substr(strval(trim(Tools::getValue('multiplevalueseparator'))), 0, 1)) ? $separator : ','; } Prev 1 2 Next Page 2 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share https://forum.thirtybees.com/topic/413-413/solved-how-to-edit-field-separators-used-for-back-office-csv-imports/ More sharing options... Followers 2 Go to topic listing
zimmer-media Posted January 3, 2018 Posted January 3, 2018 @alwayspaws I do not use a custom code for this. It is the original TB file.
zimmer-media Posted January 4, 2018 Posted January 4, 2018 @alwayspaws standard file tb 1.0.3 01515024061407form.tpl
zimmer-media Posted January 4, 2018 Posted January 4, 2018 @alwayspaws Have you ever tried the import with your own separator without changing this file? I do not know if it works. Since TB it is possible to import csv as well as .xls, .xlsx, .xlst, .ods, .ots. Since I myself do not need any changes, I did not concern myself with it. For the import with special separator I think (guess) that a change of this one file is not enough. I guess that is responsible for another file. In my view, it is a small but important form for import. I assume that at least one more file for import is at the core.
alwayspaws Posted January 4, 2018 Author Posted January 4, 2018 @zimmer-media said in How to edit field separators used for back office CSV imports: For the import with special separator I think (guess) that a change of this one file is not enough. I guess that is responsible for another file. In my view, it is a small but important form for import. I assume that at least one more file for import is at the core. Exactly what I am trying to get at. I want to know what other file(s) I need to edit to change the field separator and multiple value separator. I just uploaded your form.tpl and the result is still wrong. It still shows the multiple value separator as a semicolon but your screenshot shows it as a comma. Thank you for the help. I'm going to try to "recruit" other tb users to help me with this. @lesley @Traumflug @mdekker @Nemo Please look at this for me. What files are needed to change the default field separators used for back office CSV imports? form.tpl and what else? Thanks, Stephanie
alwayspaws Posted January 5, 2018 Author Posted January 5, 2018 Why this is important to me: I spend the bulk of my time importing products with combinations. With so many coders here, I don’t understand why this topic hasn’t been answered. I especially want to know why everyone has the multiple value separator as a comma in the csv import page and I have a semicolon even though I’m using the original form.tpl for thirty bees that @zimmer-media very kindly gave me. Looking forward to the solution so this can finally be solved. In the meantime I’ll keep looking for the answer.
datakick Posted January 5, 2018 Posted January 5, 2018 @alwayspaws if you want to change default separator, you don't really have to modify form.tpl. Try change line #570 in /controllers/admin/AdminImportController.php you want to change the character at the end of the line, ie: $this->multiple_value_separator = ($separator = Tools::substr(strval(trim(Tools::getValue('multiple_value_separator'))), 0, 1)) ? $separator : '^';
alwayspaws Posted January 5, 2018 Author Posted January 5, 2018 @datakick Where have YOU been all my thirty bees life? :) This was absolutely perfect. I really appreciate it. Sending a hug (because I can. I can do anything I want. lol) For others: I changed the field separator and multiple value separator for the back office CSV imports by following @datakick's example: Edited this file: /controllers/admin/AdminImportController.php Line 568 Changed the comma to a caret (^) Line 570 Changed the semicolon to a comma as follows: $this->separator = ($separator = Tools::substr(strval(trim(Tools::getValue('separator'))), 0, 1)) ? $separator : '^'; $this->convert = false; $this->multiplevalueseparator = ($separator = Tools::substr(strval(trim(Tools::getValue('multiplevalueseparator'))), 0, 1)) ? $separator : ','; }
Recommended Posts