• Resolved dti06

    (@dti06)


    Hi,

    I’m using the plugin Flexible Checkout Fields to add 2 extra fields in the customer billing form.
    Then I tried to add the code bellow after the last PHP if “get_billing_email”.

    <?php
    if ( !empty($customer->get_billing_email())) {
    echo esc_html( $customer->get_billing_email() );
    echo "<br>";
    }
    ?>
    // my 2 extra fields
    <?php
    if ( !empty($customer->get_billing_n_rcs())) {
    echo esc_html( $customer->get_billing_n_rcs() );
    echo "<br>";
    }
    ?>
    <?php
    if ( !empty($customer->get_billing_n_tva_intracommunautaire())) {
    echo esc_html( $customer->get_billing_n_tva_intracommunautaire() );
    echo "<br>";
    }
    ?>

    I get a critical wordpress error when clicking on the pdf cart button.
    Can you help with this issue?

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Jensen

    (@dkjensen)

    Hi @dti06

    Those methods wont exist on the WC_Customer object. Instead it’s likely stored in the user meta somewhere, in which case you could try and access it like this instead:

    $customer->get_meta( 'billing_n_rcs' ); // May need to adjust the meta key.

    But that would only work if those checkout fields are stored in the customers user meta. It sounds like these fields are present during checkout, and if they are stored on the order you would need to have them save to the cart data somehow as well.

    Thread Starter dti06

    (@dti06)

    Thank you very much for your quick reply/solution, it works perfectly! As you said, luckily data from those fields are stored in the customer user meta so your code works fine.

    Plugin Author David Jensen

    (@dkjensen)

    Great glad you could get that working!

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

The topic ‘Issue with Flexible Checkout Fields plugin’ is closed to new replies.