inboundnow / retired-leads

Track visitor activity, capture and manage incoming leads, and send collected emails to your email service provider for WordPress
http://www.inboundnow.com/leads/
11 stars 3 forks source link

Checkbox & Radio values not being mapped via js mapped_fields #147

Open atwellpub opened 8 years ago

atwellpub commented 8 years ago

Checkbox values are not being included in the lead map when adding a new lead.

I tried mapping to a custom field and to a core field. Neither one carried over to the Lead profile or showed in the array of mappable data.

Related Support:

http://support.inboundnow.com/support/topic/mapping-checkbox-values-to-textarea/

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28168158-checkbox-radio-values-not-being-mapped-via-js-mapped_fields?utm_campaign=plugin&utm_content=tracker%2F260752&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F260752&utm_medium=issues&utm_source=github).
atwellpub commented 8 years ago

@DavidWells

Hey David I believe this issue is a priority issue for us. I have two customers wanting to leverage custom mapping with checkboxes and radios but they are not making it through. Will you look into this one for us?

DavidWells commented 8 years ago

Haven't touched this in a while. Can you give me the code to create the custom mapping you are using?

The name/values sounds like they aren't matching up with the custom meta field

atwellpub commented 8 years ago

Try adding this to your local's functions.php and changing the type to checkbox: http://docs.inboundnow.com/guide/add-additional-lead-profile-fields-lead-records-map-form-fields/

I do not think the js detects and maps the checkboxes/radios.

atwellpub commented 8 years ago

ping on this one

DavidWells commented 8 years ago

The form ajax is pushing the data through in the raw params.

wpleads_upper_company=choice-1 is in the raw params and was a checkbox field.

This is the data sent in the ajax POST. action:inbound_lead_store email:david%40helloclicky.com full_name:false first_name: last_name: raw_params:test=test&email=david%40helloclicky.com&wpleads_upper_company=choice-1&inbound_form_n=Form%20Name&inbound_form_id=119429&inbound_current_page_url=http%3A%2F%2Fwpdev.dev%2Fgo%2Ftest-sbtle%2F%3Flp-variation-id%3D0&inbound_furl=aHR0cDovL3dwZGV2LmRldi8%3D&inbound_notify=ZGF2aWRAaW5ib3VuZG5vdy5jb20%3D mapped_params:email=david%40helloclicky.com&company=choice-1 url_params:{"wp-cta-variation-id":"0","inbound-customizer":"on","cache_bust":"pBeJdDTCyI","inbound-preview":"true","wmode":"opaque","lp-variation-id":"0","dt":"2015082218","dont_save":"1","template-customize":"on","live-preview-area":"txWi65wkVwhr6fFFb7sBXNyArEE3mUnbAtB","inbound-editor":"true","post_type":"landing-page","p":"119500","page_id":"11","drafts_for_friends":"baba_8A5KTEJ","post":"","sc":"[inbound_form id=\"119429\" name=\"Form Name\" lists=\"\" redirect=\"http://wpdev.dev/\" notify=\"david@inboundnow.com\" notify_subject=\"{{site-name}} {{form-name}} - New Lead Conversion\" layout=\"vertical\" font_size=\"16\" labels=\"top\" icon=\"\" submit=\"Submit\" submit=\"Submit\" submit_colors=\"off\" submit_text_color=\"#434242\" submit_bg_color=\"#e9e9e9\" width=\"\"][inbound_field label=\"Test\" type=\"text\" description=\"\" required=\"0\" exclude_tracking=0 dropdown=\"\" radio=\"\" checkbox=\"\" range=\"\" placeholder=\"\" field_container_class=\"\" field_input_class=\"\" html=\"\" dynamic=\"\" default=\"\" map_to=\"\" divider_options=\"\"]\n[inbound_field label=\"email\" type=\"text\" description=\"\" required=\"0\" exclude_tracking=0 dropdown=\"\" radio=\"\" checkbox=\"\" range=\"\" placeholder=\"\" field_container_class=\"\" field_input_class=\"\" html=\"\" dynamic=\"\" default=\"\" map_to=\"\" divider_options=\"\"]\n[inbound_field label=\"Uppercompany\" type=\"radio\" description=\"\" required=\"0\" exclude_tracking=0 dropdown=\"\" radio=\"Choice 1, Choice 2\" checkbox=\"\" range=\"\" placeholder=\"\" field_container_class=\"\" field_input_class=\"\" html=\"\" dynamic=\"\" default=\"\" map_to=\"wpleads_upper_company\" divider_options=\"\"]\n[/inbound_form]","iframe_window":"on","post_id":"119400","TB_iframe":"true","width":"640","height":"703","amp;lp-variation-id":"0","amp;inbound-preview":"true","amp;wmode":"opaque","ver":"4.3","preview":"true"} search_data:test page_views:{"60":["2015/12/01 00:27:52"],"119500":["2015/12/01 00:28:01"]} post_type:landing-page page_id:119500 variation:0 source:Direct Traffic

Raw form data is not being saved and is not being looped over https://github.com/inboundnow/leads/blob/master/shared/classes/class.lead-storage.php#L171. @atwellpub did you turn this off?

This https://github.com/inboundnow/leads/blob/master/shared/classes/class.lead-storage.php#L462-L464 never runs and the custom values are not saved from the raw form params.

Turn it back on and the radio works.

atwellpub commented 8 years ago

Thank you for the help. With this I was able get it working.