We need an extra filed at costumer address to integrate with zapier

Hi, we are integrating foxy with zapier, one of the integrations (Boleto simples) demands the costumers neighborhood.

How can we create this extra field at costumers address?

Thank you

Romero Lins
  • fc_marijafc_marija FoxyCart Team
    Hi @leaodonorte -

    You can create this field by adding some html to your checkout template:

    • In the "checkout template" textarea, look for {% endembed %} near the bottom, and paste this html right above that line:

    {% block customer_billing %}
    {{ parent() }}
    <div class="fc-form-group fc-custom-field__neighborhood-container">
    <div class="col-sm-3"></div>
    <div class="col-sm-8 col-xs-12">
    <input type="text" placeholder="Neighborhood" name="neighborhood" id="neighborhood" aria-required="false" autocomplete="off" class="fc-form-control" value="{{ neighborhood }}" />
    {% endblock %}

    • Save the checkout template

    Then, to reposition the field to a better location, you'll put a script on your custom footer in the configuration:
    • Head to the "configuration" section
    • Paste the contents below at the bottom of the "custom footer" textarea of the "Add custom header and footer code to your templates" option:

    {% if context == "checkout" %}
    FC.client.on("ready.done", reposition);
    FC.client.on("render.done", reposition);

    function reposition() {
    $(".fc-form-group.fc-custom-field__neighborhood-container").insertAfter(".fc-checkout__section--customer-billing-address .fc-address-entry__address-container");
    {% endif %}

    • Save the configuration.

    Note that this will add the "Neighborhood" field to the receipt under the "Additional Fields" heading. If you want this to appear differently, let us know how you'd like it to appear.

    You'll then access that value using {{ custom_fields.neighborhood.value }}

    Hope that helps.
  • Thank you!
Sign In or Register to comment.