I tried 10+ WooCommerce Product Addon plugins and custom fields plugins and they work fine for normal WooCommerce product but when I make it a donation product, the options disappear and don’t work for donation forms.
I can’t continue using this plugin until and unless it provides me some custom fields as it is my project requirements that are mandatory.
Regards,
]]>I am unable to recreate the custom html demo although I added the function in functions.php and selected custom display option while editing the product.
Thanks
]]>The custom form field was added as a snippet:
// Frontend: Display the custom billing fields (in checkout and my account)
add_filter( 'woocommerce_billing_fields' ,'add_custom_billing_fields', 20, 1 );
function add_custom_billing_fields( $fields ) {
$fields['billing_aspire'] = array(
'label' => __( 'My Aspire Number', 'woocommerce' ),
'placeholder' => _x('Aspire Number', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);
return $fields;
}
// Save the custom billing fields (once order is placed)
add_action( 'woocommerce_checkout_create_order', 'save_custom_billingt_fields', 20, 2 );
function save_custom_billingt_fields( $order, $data ) {
if ( isset( $_POST['billing_aspire'] ) && ! empty( $_POST['billing_aspire'] ) ) {
$order->update_meta_data('_billing_aspire', sanitize_text_field( $_POST['billing_aspire'] ) );
update_user_meta( $order->get_customer_id(), 'billing_aspire', sanitize_text_field( $_POST['billing_aspire'] ) );
}
}
// Display in emails
add_action( 'woocommerce_email_after_order_table', 'display_new_checkout_fields_in_emails', 20, 4 );
function display_new_checkout_fields_in_emails( $order, $sent_to_admin, $plain_text, $email ) {
if ( get_post_meta( $order->get_id(),
'_billing_aspire', true ) )
echo '<p><strong>Aspire Number:</strong> '
. get_post_meta( $order->get_id(), '_billing_aspire', true ) . '</p>';
}
// Backend: Display editable custom billing fields
add_filter( 'woocommerce_admin_billing_fields' , 'order_admin_custom_fields' );
function order_admin_custom_fields( $fields ) {
global $the_order;
$fields['billing_aspire'] = array(
'label' => __( 'Aspire Number', 'woocommerce' ),
'show' => true,
'wrapper_class' => 'form-field-wide',
'style' => '',
);
return $fields;
}
]]>I have one little question: I need the custom form fields’ placeholder names to change depending on the website’s language. I’m using WPML to handle the languages, but it seems like it can only translate the plugin itself, not my own custom input. Is there a way to either translate it or to use different field configurations depending on the language?
Thank you for your help!
]]>The email notification that we receive when a new user registers shows incomplete info. Specifically, the {submitted_registration} tag is not pulling in the information provided in the form.
Instead I end up with:
Date Submitted: (empty)
Form: (empty)
Any assistance or guidance is appreciated.
]]>Can I add billing address using the same snippet:
https://github.com/impress-org/givewp-snippet-library/blob/master/donors/add-donor-meta.phpc
I am searching high and low for finding how to extract the data that gets collected using the custom form fields in a registration form in the Ultimate member plugin.
What am I not finding?
Thanks
]]>Great plugin.
I have three questions:
1. How do I edit and/or delete Custom Forms Fields that are *not* required fields?
2. Can the calendar *only* show available days instead of showing all of the days of the week? I have the days set in the Connections area and even tried adding days when not working, but all of the days of the week still show.
3. Where in the CSS guide for this plugin? I got a bit of the code, but a lot of it I’ve spent time doing guesswork on and still can’t get the setting to work.
Thanks!
]]>Please note that I have a local installation on MAMP and really struggling to make this work. Any leads to solve the issue would be greatly appreciated.
]]>