[-] FO : Customized meesage with carriage return follow up #962
This commit is contained in:
+2
-1
@@ -1088,8 +1088,9 @@ class CartCore extends ObjectModel
|
|||||||
$id_customization = Db::getInstance()->Insert_ID();
|
$id_customization = Db::getInstance()->Insert_ID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$field = preg_replace("/\<br\s*\/?\>/i", "\n", $field);
|
||||||
$query = 'INSERT INTO `'._DB_PREFIX_.'customized_data` (`id_customization`, `type`, `index`, `value`)
|
$query = 'INSERT INTO `'._DB_PREFIX_.'customized_data` (`id_customization`, `type`, `index`, `value`)
|
||||||
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSql($field).'\')';
|
VALUES ('.(int)$id_customization.', '.(int)$type.', '.(int)$index.', \''.pSQL($field).'\')';
|
||||||
|
|
||||||
if (!Db::getInstance()->execute($query))
|
if (!Db::getInstance()->execute($query))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -61,8 +61,8 @@
|
|||||||
{foreach from=$datas key='index' item='data' name='datas'}
|
{foreach from=$datas key='index' item='data' name='datas'}
|
||||||
{ldelim}
|
{ldelim}
|
||||||
"index": {$index},
|
"index": {$index},
|
||||||
"value": "{$data.value|addslashes|replace: '\\\'':'\''}",
|
"value": "{Tools::nl2br($data.value|addslashes|replace: '\\\'':'\'')}",
|
||||||
"truncatedValue": "{$data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\''}"
|
"truncatedValue": "{Tools::nl2br($data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\'')}"
|
||||||
{rdelim}{if !$smarty.foreach.datas.last},{/if}
|
{rdelim}{if !$smarty.foreach.datas.last},{/if}
|
||||||
{/foreach}]
|
{/foreach}]
|
||||||
{rdelim}{if !$smarty.foreach.customization.last},{/if}
|
{rdelim}{if !$smarty.foreach.customization.last},{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user