For users who only want to solicit one specific pledge amount and nothing different

I've seen some users asking for directions on offering just one reward (i.e. $100 pledge only, and nothing different), in order to pre-check that pesky radio button: in template-functions.php, find the following code and add what I've made bold.

if(wdf_has_rewards($post_id) && isset($meta['wdf_levels'][0])) {
$content .= apply_filters('wdf_before_rewards_title','');
$level = maybe_unserialize($meta['wdf_levels'][0]);
foreach($level as $index => $data) {
$content .= '
<div class="wdf_reward_item">
<div class="wdf_reward_choice"><input type="radio" name="wdf_reward" checked=true value="'.$index.'" /><span class="wdf_level_amount" rel="'.$data['amount'].'">'.$wdf->format_currency('',$data['amount']).'</span></div>
<div class="wdf_reward_description">'.$data['description'].'</div>
</div>';

  • dannyo
    • Site Builder, Child of Zeus

    Update: Once my php edit, above, is implemented and the radio button shows as checked, the button itself can be hidden from browser displays using the CSS below. It cleans things up a lot.

    .wdf_reward_choice input[type="radio"] {
    visibility: hidden;
    }

    Note, that display:none works too, but according to what I read online might be problematic with browsers interpreting display:none as the element itself not existing. Stick with visibility:hidden.

  • dannyo
    • Site Builder, Child of Zeus

    Cole,

    Thanks for the points.

    I'm not so sure a more permanent solution would be in order, despite that functionality being asked for a few times in your forums here.

    I suppose, however, to implement that on a more permanent basis would be made only to the Fundraiser Panel Widget where;

    - If fundraiser is using advanced crowdfunding, with rewards, and only one reward is specified -- then (a) hide the 'none' option, (b) pre-check the radio and (c) hide the radio.

    However, if tweaking only the Panel Widget is done there may be some holes left over on other pages associated with the transaction. Personally, I don't recommend adding that into a revision. It indeed is the way I run your plugin but I'm willing to cut the code with each revision to accommodate my own specific needs. 2c.

    Danny

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.