Jump to content

Developers filters - Performing calculations with fields


Luca

Recommended Posts

Hi,

I have to calculate a custom field before stored in the database.
I thought of using filters.
I created a filter but it doesn't work
suggestion please?

 

<?php
defined('MVC_FRAMEWORK') or die;

function listing_save_pre($imponibile,$iva,$totale) 
{

   $imponibile = 'jr_serviceprice';
   $iva = ($imponibile * 22)/100;
   $totale = ($imponibile + $iva);


 return $totale;

}
Clickfwd\Hook\Filter::add('listing_save_pre', 'listing_save_pre', 10);

 

Link to comment
×
×
  • Create New...