The Donation Platform for Woocommerce plugin comes with different URL parameters you can use to enhance and customize the user journey.
GET/POST Parameters
You can use these parameters either in a post/get request. This makes it easy to just share a link to custom donation forms.
To better understand how the different parameters work, it is recommended to use Style 4 and understand the parameters that are sent when you are redirected to the checkout.
GET/POST Parameter | Usage |
---|---|
postid | postid=Product-ID Specify a project on checkout page |
wcdp-donation-amount | wcdp-donation-amount=amount Specify the pre-selected donation amount If you use a the “button/radio selection” layout for your amount suggestion you should also set donation-amount |
Hash Propertys
Hash Property | Usage |
---|---|
#wcdp-form | Opens the modal for popup donation forms |
#wcdp | Scroll to the beginning of the Donation Form |
Custom Attributes for Variable Products
You can preselect options of variable products: attribute_xxx
Attention: exclusively for very advanced users! Custom Attributes refers to attributes of variable products. Please take a look at the post request that is used in style 4. It is then relatively easy to see which values can be used here.
Example:
You create a variable product with the custom meta “Project” and the values “Conservation” or “Planting”, so that supporters can choose which project they want to support: https://wc-donation.wcdp.jonh.eu/projects/variable-product-attribute-demo/
You can now preselect the buttons with the following URL parameters:
https://wc-donation.wcdp.jonh.eu/projects/variable-product-attribute-demo/?project=Planting&attribute_project=Planting
https://wc-donation.wcdp.jonh.eu/projects/variable-product-attribute-demo/?project=Conservation&attribute_project=Conservation
If any other parameter is used, it is simply ignored.