Skip to content

Commit

Permalink
[-] FO : Customized meesage with carriage return follow up #962
Browse files Browse the repository at this point in the history
  • Loading branch information
gRoussac committed Nov 12, 2013
1 parent cd83ec9 commit c196902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions classes/Cart.php
Expand Up @@ -1087,9 +1087,10 @@ public function _addCustomization($id_product, $id_product_attribute, $index, $t
);
$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`)
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))
return false;
Expand Down
4 changes: 2 additions & 2 deletions modules/blockcart/blockcart-json.tpl
Expand Up @@ -61,8 +61,8 @@
{foreach from=$datas key='index' item='data' name='datas'}
{ldelim}
"index": {$index},
"value": "{$data.value|addslashes|replace: '\\\'':'\''}",
"truncatedValue": "{$data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\''}"
"value": "{Tools::nl2br($data.value|addslashes|replace: '\\\'':'\'')}",
"truncatedValue": "{Tools::nl2br($data.value|truncate:28:'...'|addslashes|replace: '\\\'':'\'')}"
{rdelim}{if !$smarty.foreach.datas.last},{/if}
{/foreach}]
{rdelim}{if !$smarty.foreach.customization.last},{/if}
Expand Down

0 comments on commit c196902

Please sign in to comment.