Yii 1.1: donatebutton

Paypal button to Donate
8 followers

donatebutton extension add to your site a box with a message and a button for donations through paypal.

You can optate for a fix or variable amount to be donated. For variable amount, there will be two selectors, one for amount and one for currencies.

You can set donatebutton box to be displayed vertical or horizontal, to easy integrate in your site.

donatebutton have a nice predefined box with transparent background, which you can choose to use or not.

Extension is XHTML valid.

Requirements

Tested with Yii 1.1.7.

Install

- Download the latest release package
- Unpack it in /protected/extensions/ folder

Usage

If you wish to use a variable amount place in your page next code:

<?php $this->widget('application.extensions.donatebutton.donatebutton', 
     array(
           'vertical' => false,
           'show_frame' => false,
           'biggerbutton' => false,
           'fix_amount' => false,
           'alt_button' => 'Donate',
           'business' => 'user@email.com',
       'item_name' => 'Support Your Business',
       'message' => 'If you like our work, you may throw us some cookies. Donate ',
       'selectable_amount' => array(
            'min_amount'=>3,
            'max_amount'=>10,
            'selected_amount'=>5,
            'selected_currency'=>'EUR',
            'currencies'=>array('EUR', 'USD'),//or leave ''
        )
      )
);?>

If you wish to have a fixed amount use next code:

<?php $this->widget('application.extensions.donatebutton.donatebutton', 
     array(
           'vertical' => false,
           'show_frame' => false,
           'biggerbutton' => false,
           'fix_amount' => true,
           'alt_button' => 'Donate',
           'business' => 'user@email.com',
           'item_name' => 'Support Your Business',
           'message' => 'If you like our work, you may throw us some cookies. Donate ',
       'donation' => array(
            'currency_code'=>'EUR',
            'amount'=>5
        )
      )
);?>

Usual parameters

  • vertical: display extension as a vertical box(boolean: false, true)
  • show_frame: display a frame to extension's box(boolean: false,true)
  • biggerbutton: use a larger button(boolean:false,true)
  • fix_amount: will use a fix amount(false,true)
  • alt_button':alt tag for paypal button(string:'Donate')
  • business: email address used for your paypal account(string:'user@email.com')
  • item_name: Item description in paypal cart(string:'Support Your Business')
  • message: text to be diplayed over button(string:'If you like our work, you may throw us some cookies. Donate ')
  • donation: when use a fixed amount, here set values of currency and amount to be donated'(array('currency_code'=>'EUR','amount'=>5))
  • currency_code: the currency for donation('EUR', 'USD')
  • amount: amount to be donate(integer:5)
  • selectable_amount: when use a variable amount, here will be values(array('min_amount'=>3,'max_amount'=>10,'selected_amount'=>5,'selected_currency'=>'EUR','currencies'=>array('EUR', 'USD')))
  • min_amount:minim amount to be donated (integer:3)
  • max_amount:maxim amount to be donated(integer:10)
  • selected_currency:default currency for donation(string:'USD')
  • currencies: currencies accepted for donation. If you don't set this, will be used selected_currency as unique currency(array('EUR', 'USD'))

Hint. Default values are marked as bold. If you needed values are same as default, you don't need to specify them in your code.

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension