• Resolved e061070

    (@e061070)


    Hi, I installed the plugin and it works perfectly, I also have Snippets for woocommerce, but if I try to put the age field it doesn’t work, if I deactivate the plugin it does not give an error and I don’t understand what it is due to:

     add_filter( 'woocommerce_billing_fields', 'add_birth_date_billing_field', 20, 1 );
        function add_birth_date_billing_field($billing_fields) {
        
            $billing_fields['billing_birth_date'] = array(
                'type'        => 'date',
                'label'       => __('Birth date'),
                'class'       => array('form-row-wide'),
                'priority'    => 25,
                'required'    => true,
                'clear'       => true,
            );
            return $billing_fields;
        }
           
        
             add_action( 'woocommerce_checkout_update_customer', 'save_checkout_account_birthday_field', 10, 2 );
                function save_checkout_account_birthday_field( $customer, $data ){
                    if ( isset($_POST['billing_birth_date']) && ! empty($_POST['billing_birth_date']) ) {
                         $customer->update_meta_data( 'billing_birth_date', sanitize_text_field($_POST['billing_birth_date']) );
                    }
                }
    

    tnx

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author quadlayers

    (@quadlayers)

    Hello @e061070

    I don’t understand your issue

    Is this hook working without the plugin and not working with the plugin activated?

    Thread Starter e061070

    (@e061070)

    The plugin works perfectly but if I add a Custom Snippet it works, but if I add what I have attached no, did I do something wrong?
    tnx
    e.

    Plugin Author quadlayers

    (@quadlayers)

    what you mean with custom snipet?
    can you share the working code?

    Thread Starter e061070

    (@e061070)

    I have installed Code Snippets plugin, all the php codes I need I add them, the one I loaded in the request only works with Checkout Field Manager disabled, if it is active it does not work
    e.

    Plugin Author quadlayers

    (@quadlayers)

    please share screenthos of code snippets config, and the code inserted

    Thread Starter e061070

    (@e061070)

    Hi, view up (first message), I attach the code
    e.

    Plugin Author quadlayers

    (@quadlayers)

    Hello @e061070
    Please test this update
    Is version 6.0.7
    https://we.tl/t-SvDv6PHaGs
    Make sure you test the entire plugin features as we’ve changed the hooks priority to fix this issue and could affect other features

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom Snippet’ is closed to new replies.