Is it posible? can someone help me?? Thanks!
Joomla 3.6
VM 3
Please explain better what you want to do. http://forum.virtuemart.net/index.php?topic=104795.0
I wanted to allow HTML in the GTIN field, finally i edited the save function in controller and it works. Sorry for my english :)
function save($data = 0){
if($data===0)$data = vRequest::getRequest();
$user = JFactory::getUser();
if($user->authorise('core.admin','com_virtuemart') or $user->authorise('core.manage','com_virtuemart') or $user->authorise('vm.raw','com_virtuemart')){
$data['product_desc'] = vRequest::get('product_desc','');
$data['product_s_desc'] = vRequest::get('product_s_desc','');
$data['customtitle'] = vRequest::get('customtitle','');
$data['product_gtin'] = vRequest::get('product_gtin','');
if(isset($data['field'])){
$data['field'] = vRequest::get('field');
}
if(isset($data['childs'])){
foreach($data['childs'] as $k=>$v){
if($n = vRequest::get('product_name',false,FILTER_UNSAFE_RAW,FILTER_FLAG_NO_ENCODE,$data['childs'][$k])){
$data['childs'][$k]['product_name'] = $n;
}
}
}
} else {
if($user->authorise('vm.html','com_virtuemart')){
$data['product_desc'] = vRequest::getHtml('product_desc','');
$data['product_s_desc'] = vRequest::getHtml('product_s_desc','');
$data['customtitle'] = vRequest::getHtml('customtitle','');
$data['product_gtin'] = vRequest::getHtml('product_gtin','');
if(isset($data['field'])){
$data['field'] = vRequest::getHtml('field');
}
} else {
$data['product_desc'] = vRequest::getString('product_desc','');
$data['product_s_desc'] = vRequest::getString('product_s_desc','');
$data['customtitle'] = vRequest::getString('customtitle','');
$data['product_gtin'] = vRequest::getString('product_gtin','');
if(isset($data['field'])){
$data['field'] = vRequest::getString('field');
}
}
First, this is bad, secondly, you can certainly use a template overide and changes the code in front.
Suppose a day you need to change the HTML? You have tp modify all your gtin.
If you need to change some render, i think it's the badest way to do and this can be done with customfields directly and not use the gtin.
what are you trying to accomplish?
formatting? run functions on the string?