I have Suite CRM 7.7.9.
I want to have new field as a total product line amount that equals the quantity twice product unit price (by default there is no such field).
So I added product_value field as on the pic and the following files:
[root@crm AOS_Products_Quotes]# pwd
/var/www/html/crm/custom/modules/AOS_Products_Quotes
[root@crm AOS_Products_Quotes]# ls -l
total 8
drwxrws--- 3 apache apache 21 Feb 9 17:50 Ext
drwxrws--- 2 apache apache 28 Feb 9 17:50 language
-rwxr-xr-x 1 apache apache 225 Feb 18 20:58 logic_hooks.php
drwxrws--- 2 apache apache 81 Feb 9 18:04 metadata
-rwxr-xr-x 1 apache apache 299 Feb 20 10:21 product.php
[root@crm AOS_Products_Quotes]# more logic_hooks.php
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_save'] = Array();
$hook_array['after_save'][] = Array(1, 'Product Value', 'custom/modules/AOS_Products_Quotes/product.php', 'product', 'product_value');
?>
[root@crm AOS_Products_Quotes]# more product.php
<?php
//prevents directly accessing this file from a web browser
if (!defined('sugarEntry') ||!sugarEntry) die('Not A Valid Entry Point');
class product {
function product_value ($bean, $event, $arguments) {
$bean->product_value_c = $bean->$product_unit_price * $bean->product_qty;
}
}
?>
The product_value_c is not calculated properly in a generated quote that uses this field. I have ā0ā amount.
What else should I do to make this working?