> 1. I'll start out with the idea that would result in the biggest
> structural change. I'm not sold on the field mapping UI for
> associating form fields with payables. I think it would be much
> more intuitive to create a "Payable Field" which could be added to
> the form, and which would let you select a payable to be listed.
> This payable field should optionally be able to set the price
> instead of the quantity for the payable (needed for our use case,
> where the user is making a donation of an arbitrary amount). The
> getpaid adapter would then be responsible for finding all the
> payable fields in the form and creating line items in the transient
> shopping cart, much like it currently does based on the field
> mapping stored on the adapter.
Just to flesh out a little more how I think this could be implemented:
1. Create a "Shopping Cart Items" PFG form field which lets you
- pick a set of existing payable items from the site using
something like the reference browser widget
- choose whether to allow the user to edit quantity, edit price,
pick one item (radio buttons), or pick multiple items (checkboxes)
2. Make a custom version of the LineItemFactory which adapts the
"shopping cart items" field and knows how to create cart line items
based on the above settings and what the user actually filled into the
form.
3. Change the form action adapter to loop through the form fields and
try to adapt each one to ILineItemFactory, rather than looping through
the field mappings that are used currently and adapting them.
The advantages to this arrangement are:
- more intutive configuration (imho)
- it's more extensible, as a completely different way of selecting
payable items could be implemented as yet another type of form field,
adapted to a different LineItemFactory
Thoughts?
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"getpaid-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/getpaid-dev?hl=en
-~----------~----~----~----~------~----~------~--~---