alwayspaws Posted June 15, 2017 Posted June 15, 2017 I use openoffice calc and save new spreadsheets with the .ods file extension until I'm ready to convert it to a .csv file. Every time I go to import in admin I have to keep changing the field separator and multivalue separator depending on whether I'm importing categories, products or combinations. Screenshot shows field delimiter and text delimiter when exporting from .ods to .csv @spidawebs can you help me out please?
Nemo Posted June 16, 2017 Posted June 16, 2017 You mean you want to change the default setting in the import page?
alwayspaws Posted June 16, 2017 Author Posted June 16, 2017 Yes, please, but also need to know what to enter on the csv so they match.
Nemo Posted June 16, 2017 Posted June 16, 2017 The defaults are semicolon for the fields, and comma for multiple values. They should actually stay the same across entities admin: themes\default\template\controllers\import\helpers\form\form.tpl Holds the defaults when there is none set yet in the cookie
alwayspaws Posted June 16, 2017 Author Posted June 16, 2017 The defaults are m for the fields, m? Can you please edit your post so it all stays together unless you meant "m"? Thank you very much. I can do this!
alwayspaws Posted June 16, 2017 Author Posted June 16, 2017 @Nemo thanks - lets delete those last two posts. :)
alwayspaws Posted June 16, 2017 Author Posted June 16, 2017 @Nemo Thanks so much for making it easy to follow! It works perfectly.
alwayspaws Posted December 3, 2017 Author Posted December 3, 2017 @Nemo I have been using new field separators for a long while now with great success. Can you please tell me how to edit the code so that these are the default separators? Field separator: ^ (caret above #6 on keyboard) Multiple value separator: comma Thank you, Stephanie
Nemo Posted December 6, 2017 Posted December 6, 2017 Stephanie, Could you clarify? You mean setting them as default in the configuration? admin folder \themes\default\template\controllers\import\helpers\form\form.tpl They are hardcoded in there, just search the labels, they are if statements
alwayspaws Posted December 6, 2017 Author Posted December 6, 2017 @Nemo Yes, I want to set the defaults but I don’t understand how to edit / update what the below is from the last time we did this: The image in the first post is where I want to change the settings again. I can see the quote mark but somehow can’t see where to put the other setting. I’ll try again tomorrow with a fresh view. Thanks, Stephanie
moy2010 Posted December 6, 2017 Posted December 6, 2017 This part: value="{if isset($separatorselected)}{$separatorselected|escape:‘html’:‘UTF-8’}{else};{/if}" Reads like this: "If the user selected a separator, use that selected separator, otherwise use semicolon (;)." So, you only have to change this part that sets the semicolon as the default separator: {else};{/if}
alwayspaws Posted December 6, 2017 Author Posted December 6, 2017 @Nemo I saw the code much easier in Sublime than in my text editor, so that was great. @moy2010 Thank you for translating it so I would understand it. :) Between the two of you, I believe I now know what I am doing. Unfortunately, it is still not working. In the form.tpl file, I changed the field separator as follows: {else}^{/if} (caret) The multiple value separator was how I wanted it: {else},{/if} (comma) I updated the Field and Multiple Value Separators in the form.tpl but the admin csv separators will not update. They stay at: field separator is a comma and the multiple value separator is a semicolon. 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 </div> This screenshot is from my file manager on my host because I wanted to confirm the file was actually updated. (I used Filezilla to download the file, edited it with Sublime and uploaded it with Filezilla.) This screenshot shows the settings have not changed in the admin - CSV import section: This screenshot is the updated form.tpl file: I use CSV uploads very regularly. Anyone with suggestions as to why the form.tpl does not change the csv upload default parameters? Thanks, Stephanie
alwayspaws Posted December 15, 2017 Author Posted December 15, 2017 Can someone please see what may be wrong with the code? Even the multiple value separator doesn’t work and I didn’t have to change it. Is there anywhere else the defaults can be changed for these csv import separators in admin?
zimmer-media Posted December 15, 2017 Posted December 15, 2017 @alwayspaws Why do you want to change the code in the script? My best experiences with the CSV files are field separators as a semicolon and the separator for multi-valued fields as a comma. Before the import, I only have to turn each time in the two input fields so that it works. But it works great with me.
alwayspaws Posted December 16, 2017 Author Posted December 16, 2017 @zimmer-media Remember this? https://forum.thirtybees.com/topic/931/solved-how-to-use-csv-import-for-many-colors-sizes-for-a-single-product/115 - I’m not going through that again. My csv’s work perfectly. I just want to change the separators in the admin csv import section. Someone here has to know why the updated form.tpl doesn’t work. @Traumflug Any ideas, please? Thanks.
moy2010 Posted December 16, 2017 Posted December 16, 2017 Everything seems to be alright in the code; have you cleared both smarty and your browser' cache?
alwayspaws Posted December 16, 2017 Author Posted December 16, 2017 Yes. And tried with three browsers.
alwayspaws Posted December 30, 2017 Author Posted December 30, 2017 I'm still trying to change the default field separator and multiple value separator in the back office for CSV imports. I want the field separator to be a caret which is this symbol: ^ and the multiple value separator to be a comma. It's been two weeks since I updated ONE CHARACTER in the code and uploaded the edited form.tpl so, supposedly, any cache that was stuck should be cleared by now if it is cache I cannot clear myself in admin or my three browsers. The only change to the existing code was to change the comma to a caret for the field separator. The multiple value separator was already a comma, so it did not need changing, however, it still has the multiple value separator as a semicolon in the CSV import section in the back office. That, in itself, means something else needs to be updated. What can it be, please? Here is the field separator code: ** and here is the multiple value separator code: ** and here is the screenshot of the updated form.tpl: Here it shows the latest updated file exists on my host: @SLiCK_303 Maybe you can help me figure this out. You're great at finding solutions.
SLiCK_303 Posted December 30, 2017 Posted December 30, 2017 @alwayspaws , I'm afraid I know nothing about csv imports or exports, or any code that controls it. Sorry...
alwayspaws Posted December 30, 2017 Author Posted December 30, 2017 @SLiCK_303 Ok, thanks. Happy Weekend!
alwayspaws Posted January 3, 2018 Author Posted January 3, 2018 @anybody? How could something like this be so difficult?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now