Well, in this case I want to use it for a wishlist, but I guess you also can use it for a kind e-commerce solution.
So I have a bunch of products, and I'd like to display them in a GF list, with product name in column A and the quantity in column B. The product names have to be pre-populated (based on the contents of the wishlist). The quantity can be entered by the user.
As far as I can see the (unserialized) "format" of the list data array (after submitting) is the following:
Array
(
[0] => Array
(
[Product] =>
[Quantity] => 200
)
[1] => Array
(
[Product] => Product 2
[Quantity] => 400
)
[2] => Array
(
[Product] => Product 3
[Quantity] => 300
)
)
However, I can't use this same format when populating the "choices" array in the gform_pre_render filter. So it would be great if we can :)
any other solutions are fine too, but I think it's the easiest if the format stays the same.
One backdraw however: for this method you need to know the exact name of the columns to use it for the array keys. Maybe it's better to just map it to a regular index.
Posted 13 years ago on Tuesday November 8, 2011 |
Permalink