Download the PHP package tungsten/growdough without Composer
On this page you can find all versions of the php package tungsten/growdough. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package growdough
GrowDough plugin for Craft CMS 4.x
This plugin allows collecting donation designations in a Donations List that works similar to a shopping cart.
Requirements
This plugin requires Craft CMS 4.0.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require tungsten/growdough
- In the Control Panel, go to Settings → Plugins and click the “Install” button for GrowDough.
Settings
- Donations URL: Stores the full URL to the donations form for the account
- Test Mode Enabled: Allows to test the GrowDough integration with the Craft website. When enabled, the Test Mode is enabled during the checkout on GrowDough.
When the test mode is enabled, the following hidden input is added to the form:
Variables
getDonationItems
Retrieves the donation items stored in the session as a collection (array). Use the collection in a for loop to build the items list.
donationItemInList
Check if the donation item with the provided id is already in the list of donation items.
addDonationItemFormTag
Opening form tag to add a donation item to the donation items list.
Params
- itemId Unique id for the donation item
- itemTitle Donation item title that is used for display
- itemAttributes Donation item attributes array that will be stored as JSON
Example
formTag
Opening form tag to submit donation to GrowDough. Includes the GrowDough post URL and all hidden fields required for submission.
Options
- templateVariables Include the template variables that should be used in the GrowDough donation workflow (donation form, email receipt, thank you page, etc.) If not included, an empty JSON array will be submitted.
- donationItems Include an array of donation items to override the items in the donation list. If not included, an array of donation items will be automatically generated from the donation list.
- paymentMethod Include a predefined payment method (credit_card or giving_card) if the form is intended to use a pre-determined GrowDough donation form.
- donationAmount Include a predefined donation amount if the form is intended to use a pre-determined amount on the GrowDough donation form.
Most Common Use
The form tag will be most commonly used with templateVariables and paymentType.
Full Variable Syntax
getDonationItemsJson
Format the donation items list as an encoded JSON string.
donationsUrl
Retrieves the GrowDough donations URL from the plugin settings. The URL is used to post the donation to the GrowDough system for the particular account.
givingCardPurchaseUrl
Retrieves the GrowDough Giving Card purchase URL from the plugin settings. The URL is used to post the desired Giving Card amount to the GrowDough system for the particular account.
Actions
Add Donation Item to Dontation Items
Add a specific donation item to the Donations List. If an item with the provided itemId already exists in the list, it will NOT be added.
Example using addDonationItemFormTag
variable
Example using HTML form directly
Redirecting to another page upon submission
By default, upon form submission the plugin will automatically reload the current page.
To override this default behavior, include redirectInput
function after the PerForm addDonationItemFormTag
and specify your redirect destination.
OR
removeDonationItem
Remove a specific donation item from the Donations List. If an item with the provided itemId does not exist in the list, the action will be ignored.
Optional: Add a redirectUrl parameter if you'd like to redirect to a specific page after the item is added. If the parameter is omitted, the browser will redirect to the origin page (using http_referrer).
removeAllDonationItems
Remove all donation items from growDoughItems session variable. This is useful when checking out a multi-designation donation and the session needs to be remove so that it does not stick around after the donation is complete.
This action needs to be called via AJAX while the GrowDough form is being submitted.
Brought to you by Tungsten Creative Group