The logic of this module didn't work for me to setup a donation page

Created on 12 March 2025, 2 months ago

Problem/Motivation

First I am setting this issue as a Support request per chance I didn't know how to set it up to accept donations.

I added this module on the site and created a product which "Allow-ed the user to set the price". Then I created multiple product variations for the amounts people could choose to donate. The products variations has prices as: NGN5,000, NGN10,000, NGN20,000, NGN50,000, NGN100,000, and NGN200,000. Then I enabled a 'Choose your price' field. The idea is one could select to donate any of those amounts or can also choose their own amount to donate.

After I set up the product I noticed some issues. If the product page loads, the first product variation will be selected as shown below, and the lowest amount being NGN5,000 prefilled in the 'Choose your price' field:

If I click the submit button without changing anything I get this error,

Whichever variation I select I will get that error,

To not get this error I have to manually edit the price in the Choose your price field to set it to a price greater than or equal to the second lowest price being NGN10,000. Once I do this the product will be added to cart.

This wasn't working for me.

Steps to reproduce

Proposed resolution

I made a patch to solve this, at least to get it to help us collect donations better. The patch did these:

  1. Make the Choose your price field optional
  2. Stop it from being prefilled with the least price when the product loads. Surprisingly, it prefills the least price but uses the second least price as limit for the chosen price.
  3. Use the least price as limit for the chosen price (instead of the second least price the module was using).

After I made the patch, the module worked better to allow someone donate any of the amounts in the variations or set a price of their own which must not be below the least price.

The fact that the Choose your price field does not have a default value, and the field is empty when the page loads, makes it clearer that a value is needed in it only when a custom price is desired.

I am posting my patch here in case it makes any sense to anyone.

For this patch to apply you have to apply it together with the patch from Add ability to change the label display when choosing the price. Add ability to change the label display when choosing the price Active

💬 Support request
Status

Active

Version

1.0

Component

Documentation

Created by

🇳🇬Nigeria chike Nigeria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024