subscriptionid as $addon.code in smarty if (!defined("WHMCS")) die("This file cannot be accessed directly"); add_hook('ClientAreaProductDetailsPreModuleTemplate', 1, function($vars) { foreach($vars['addons'] as $addon) { $servicecode[$addon['id']] = Capsule::table('tblhostingaddons') ->where('id', $addon['id']) ->value('subscriptionid'); } return array('servicecodes' => $servicecode); });