Community Documentation

Use with nodereference count

Last updated June 27, 2011. Created by Desi Raaj on June 27, 2011.
Log in to edit this page.

Additional Modules involved: www.drupal.org/project/Nodereference_count

Scenario: Add $50 to a customer's account if they hosted the party 3 times or more.

Fields: Nodereference Count -> counted how many times a person has been referenced in a party hosting event.

Computed Field:
if ($node->field_customer_times_hosted[0]['value'] >= 3) {
$node_field[0]['value'] = 50;
}

else

$node_field[0]['value'] = 0;

this is the first time I've ever used custom php code so please feel free to make corrections, but it works so far.

Page status

Needs technical review

Log in to edit this page

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here