Skip to content

Instantly share code, notes, and snippets.

@joeydsmith
Created October 22, 2014 18:19
Show Gist options
  • Save joeydsmith/7a34e4278ce6cc24ab3b to your computer and use it in GitHub Desktop.
Save joeydsmith/7a34e4278ce6cc24ab3b to your computer and use it in GitHub Desktop.
// If donation levels
if ( is_array( $donation_levels ) ) {
echo '<div class="donation_levels">';
// Loop through each donation level and output a radio button
$i = 0;
foreach ( $donation_levels as $donation_level ) {
?>
<div class="convio_api-donationLevel">
<div class="convion_api-defaults">
<span><?php echo $donation_level->name; ?></span>
<span><?php echo $donation_level->amount->formatted; ?></span>
</div>
<div class="convio_api-customs">
<table>
<tr>
<td>
<input type="text" name="donate_form['donationlevels'][<?php echo $i; ?>]['name']" value="<?php echo $donation_level->name; ?>" />
<input type="text" name="donate_form['donationlevels'][<?php echo $i; ?>]['amount']['formatted']" value="<?php echo $donation_level->amount->formatted; ?>"/>
<input type="text" name="donate_form['donationlevels'][<?php echo $i; ?>]['amount']['decimal']" value="<?php echo $donation_level->amount->decimal; ?>" readonly="readonly" />
</td>
</tr>
</table>
</div>
</div>
<?
$i++;
}
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment