[{assign var="sEnclosure" value='"'}]
[{assign var="sLineSeparator" value="@new_line@"}]
[{assign var="sFieldSeparator" value=","}]

[{*** special chars ***************}]
[{*  new line    => "@new_line@"  *}]
[{*  tab         => "@tab@"       *}]
[{*  white space => "@space@"     *}]
[{*********************************}]

[{strip}]
    [{capture assign="sHeadArea"}]
        [{block name="d3ordermanager_exporttemplate_csv_head"}]
            [{if $aFieldList}]
                [{foreach name="fieldlist" key="key" from=$aFieldList item="sFieldName"}]
                    [{block name="d3ordermanager_exporttemplate_csv_headfieldname"}]
                        [{$sEnclosure}][{$sFieldName}][{$sEnclosure}]
                    [{/block}]
                    [{if $smarty.foreach.fieldlist.last eq false}]
                        [{$sFieldSeparator}]
                    [{else}]
                        [{$sLineSeparator}]
                    [{/if}]
                [{/foreach}]
            [{/if}]
        [{/block}]
    [{/capture}]
[{/strip}]

[{strip}]
    [{capture assign="sContentArea"}]
        [{block name="d3ordermanager_exporttemplate_csv_content"}]
            [{if $aContentList}]
                [{foreach name="contentlist" key="contentlistkey" from=$aContentList item="sContent"}]
                    [{block name="d3ordermanager_exporttemplate_csv_contentfield"}]
                        [{$sEnclosure}][{$sContent}][{$sEnclosure}]
                    [{/block}]
                    [{if $smarty.foreach.contentlist.last eq false}]
                        [{$sFieldSeparator}]
                    [{else}]
                        [{$sLineSeparator}]
                    [{/if}]
                [{/foreach}]
            [{/if}]
        [{/block}]
    [{/capture}]
[{/strip}]
