Connect woocommerce_form_field Select Dropdown to Salesforce PickList
-
I have a custom field added to my WooCommerce checkout called cgg_how_did_you_hear, being created with woocommerce_form_field:
add_action( 'woocommerce_after_order_notes', 'cgg_how_did_you_hear' ); function cgg_how_did_you_hear( $checkout ) { echo '<div><h3>' . __('How did you hear about us?') . '</h3>'; woocommerce_form_field('cgg_how_did_you_hear', array( 'type' => 'select', 'options' => array( 'Email' => __('Email'), 'Friend' => __('Friend'), 'Metro Volunteers' => __('Metro Volunteers'), 'Posting on University Site' => __('Posting on University Site'), 'Website' => __('Website'), 'Other' => __('Other'), ), 'class' => array( 'form-row-wide' ), 'default' => 'Email', 'label' => __('Fill in this field'), 'placeholder' => __('Enter something'), ), $checkout->get_value( 'cgg_how_did_you_hear' )); echo '</div>'; }
I am trying to send this data from the form to a SalesForce object using the Integration for WooCommerce and Salesforce plugin.
In the SalesForce Feed I am choosing the SF field I want to include (“How_Learned_About_CRC__c”), and clicking ‘Add Field’. Then for the field type I am choosing “Custom Field” and in the Custom Field field, I am adding cgg_how_did_you_hear.
Is this not the correct way to set this up? Or are there any docs / references as to how this should be set up anywhere online that I’m missing?
Thanks!
- The topic ‘Connect woocommerce_form_field Select Dropdown to Salesforce PickList’ is closed to new replies.