Hello, Alex We need to add an extra column in both membmembers table and membproducts table. It's an additional feature of the product: "max_search". If user choose different product, they are given a different number of search. Is that possible to add a function to update the max_search column upon successful payment? Thank you.
Here is example of code you requested: file amember/site.inc.php (create if not exists): Code: <? add_member_field('max_search', 'Max Search', 'text', ''); add_product_field('max_search', 'Max Search', 'text', ''); function ums($payment_id){ global $db; $p = $db->get_payment($payment_id); $c = 0; foreach ($db->get_user_payments($p['member_id'], 1) as $p){ $pr = $db->get_product($p['product_id']); $c += $pr['max_search']; } $u = $db->get_user($p['member_id']); $u['data']['max_search'] = $c; $db->update_user($u['member_id'], $u); } setup_plugin_hook('finish_waiting_payment', 'ums'); ?> something like that...