View Product Page

Donation Form and shortcode

You can add a donation form in any sidebar of your site using the widget “YITH Donations for WooCommerce”.


If you want to add the form to the page content, you can use the shortcode available. Click on the dedicated button of your WordPress visual editor or enter it in textual mode: [yith_wcds_donations].

Visual editor (automatically created)


By clicking on this button, you can fill out the fields of the popup.

shortcode popup

And the according shortcode is created automatically.

Textual shortcode (manually created)

The shortcode attributes are the following:

  • donation_amount: enter pre-set amounts separated by a vertical bar ( | ). Leave empty if you want to let your users enter a custom amount.
  • donation_amount_style: choose the style of the pre-set amounts: it can be either label or radio.
  • show_extra_desc: set to “on” if you want add an extra field to the donation form.
  • extra_desc_label: enter here the title of the extra field.

For example, if you build the shortcode like this:

[yith_wcds_donations donation_amount="10|20|30" donation_amount_style="radio" show_extra_desc="on" extra_desc_label="Tell us more about why you are donating, we are so grateful!"]

this is how it will look like on the Shop page:

shortcode on page

The plugin gives you the opportunity to enter the form also into the detail page of one or more products. Read more about this here.

If you want to customize the style of the button “Enter a Donation” displayed both in the widget and with the shortcode, go to plugin options panel and edit settings included in section “Settings”.

Choose WooCommerce Style if you want to inherit WooCommerce basic features.

button settings

Or choose Custom style if you want to set it up as you prefer. You’ll be able to customize the typography options (font size, format and case format), the button text color, the button color and colors on mouseover.

custom button settings