Please Log in to join the conversation.
That's basically a family subscription usecase, which we don't cover. The best I can suggest is using either of the below methods to try and force this.Is it possible for one parent to register for their three children's (for instance) subscriptions, with he one set of login details?
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Yes that would work. You however will need a CB Code Field as well since you'll need to count the repeat rows. The below should work fine for this.I could probably occomplish what I need with maybe some repeated fields at point of registration, with each section of repeated fields being a child i.e. First name, surname, dob etc, and the subscription price could be (cost * number of repeats).
Does this sound as though it would be do able?
return count( json_decode( '[FIELD_NAME]' ) );
$children = count( json_decode( '[FIELD_NAME]' ) );
if ( ! $children ) {
return 0;
}
return ( $children * 30 );
This makes it significantly more complicated. Now you'll need to loop through the JSON data and check against their type so you can adjust the price more accurately. Example as follows.Based in the screenshot attached, I'd like the subscription cost for this subscription to be set based on the Licence Type Dropdown. i.e. Adults £20 & Juniors U18 £15
So if we have three repeated sections and each related section has a Junior U18 licence type selected this would be a £45 subscription.
I need a running total of the value coming from the LicenceType field
i.e. 3 X Junior U18 Repeats = £45, 3 X Adult Repeats = £60, 2 X Junior U18, and 1 x Adult Repeats = £50
$adult = 0;
$junior = 0;
$price = 0;
foreach ( json_decode( '[FIELD_NAME]', true ) as $child ) {
if ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'adult' ) {
$adult++;
} elseif ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'junior' ) {
$junior++;
}
}
if ( $adult ) {
$price += ( $adult * 20 );
}
if ( $junior ) {
$price += ( $junior * 15 );
}
return $price;
$adult = 0;
foreach ( json_decode( '[FIELD_NAME]', true ) as $child ) {
if ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'adult' ) {
$adult++;
}
}
return $adult;
$adult = 0;
foreach ( json_decode( '[FIELD_NAME]', true ) as $child ) {
if ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'adult' ) {
$adult++;
}
}
if ( ! $adult ) {
return 0;
}
return ( $adult * 20 );
$junior = 0;
foreach ( json_decode( '[FIELD_NAME]', true ) as $child ) {
if ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'junior' ) {
$junior++;
}
}
return $junior;
$junior = 0;
foreach ( json_decode( '[FIELD_NAME]', true ) as $child ) {
if ( $child['FIELDGROUP_NAME_FIELDTYPE_NAME'] == 'junior' ) {
$junior++;
}
}
if ( ! $junior ) {
return 0;
}
return ( $junior * 15 );
Please Log in to join the conversation.
Please Log in to join the conversation.