Allow the user to add any donation amount to the price of a product. Can also be used to sell products, where the buyer determines the price.
This is a Virtuemart 2 plugin that lets the user add a custom amount to the price of a product. It will display an input box next to the "Add to Cart" button:
Typical use cases are:
- Let users add a custom donation amount the product's price
- Let a user completely define the price of a product
Configuration & How the plugin works
First, install the plugin with Joomla's extension manager. It will automatically be enabled.
Now, set up a Custom Field ("Products" -> "Custom Fields"):
- Create a new field (the green + button in the top right corner)
- Select "Plug-ins" as Custom Field Type
- Enter the title (will be shown in front of the price input box)
- Set "Cart Attribute" to "Yes"
- Select "VM Donation" as the plugin
Now you can add this custom field to any product you like:
- Open the product in the VirtueMart backend, go to the "Custom Fields" tab and add the field you just created. There you can also add a maximum or minimum value allowed for the added amount. In particular, the default lower value of 0.0 prohibits entering discounts. If you remove the lower bound, the user can also enter a negative value and thus reduce the price. If the user enters a price modifier (donation) that is outside the allowed range, the closest value inside the range will be used (e.g. if the upper bound is 100 and the user enters 9999, a value of 100 will be added)
- To sell a product with a fixed price and an optional additional donation, simply set the price for the product and add this custom field.
- To let the user completely specify the price of a product, set the product's price to 0.00001 (not 0, since then no "Add to cart" button will be displayed!) and add this custom field.
- The product page will now display an entry box, where the user can enter the donation amount they want to add to the product price:
- The cart (and the order confirmation and the invoice) will also display the donation amount that the user entered:
This plugin is licenced unter the GNU GPLv3. It is also free to download, and you automatically obtain all the rights and duties that the GPL gives you, without any payment. If you find the plugin useful, it would still be nice if you could donate a certain amount.
2013-11-15: Version 1.1 (add upper/lower limit for the entered value)
2013-03-02: Version 1.0 (First release)