Skip to content

Instantly share code, notes, and snippets.

Limitations

  1. A contribution cannot have multiple line-items which share same price_field_id and/or price_field_value_id because there is a unique key defined for line-item table which expects unique combination of these attributes
  2. A contribution cannot have multiple line-items linked with price fields of different price-sets, otherwise it will cause a issue while doing 'Record Payment' as I tested on local by relaxing the crieria to allow user to add line-item linked to price fields of different price sets. Add after paying the additional due amount, this leads to incorrect financial entries and Contribution status still kept to 'Partially Paid'.

Objectives

  1. Avoid polluting user experience with (a large number of) price field or price set entries that the user should not change and doesn't need to know about.
  2. Avoid creating a large number of entries in config tables like price set and price field when

Limitations

  1. A contribution cannot have multiple line-items which share same price_field_id and/or price_field_value_id because there is a unique key defined for line-item table which expects unique combination of these attributes
  2. A contribution cannot have multiple line-items linked with price fields of different price-sets, otherwise it will cause a issue while doing 'Record Payment' as I tested on local by relaxing the crieria to allow user to add line-item linked to price fields of different price sets. Add after paying the addtional due amount, leads to incorrect financial entries and Contribution status still kept to 'Partially Paid'.

Proposal

Keeping in mind both the limitations here's what my approach to support add multiple line-items.

New Contribution with quick-config price field