{% if guest.extension_is_on({ "mod": "formbuilder" }) %}
    {% set form = guest.formbuilder_get({ "id": product.form_id }) %}
    <div class="card mb-3 mt-3">
    {% if form.style.show_title != "0" %}
        <div class="card-header">
            <legend>{{ form.name }}</legend>
        </div>
    {% endif %}

    <div class="card-body">
        <fieldset>
            {% for field in form.fields %}
                {% if form.style.type == 'horizontal' %}
                    <div class="mb-3 row">
                {% endif %}
                {% if field.hide_label != 1 %}
                    <label {% if form.style.type == 'horizontal' %}class="col-sm-2 col-form-label"{% else %}class="form-label"{% endif %} for="{{ field.name }}">{{ field.label }}</label>
                {% endif %}
                {% if form.style.type == 'horizontal' %}
                    <div class="col-sm-10">
                {% endif %}

                {% if field.type == "text" %}
                    {% if field.prefix is not empty or field.suffix is not empty %}
                        <div class="input-group">
                            {% if field.prefix is not empty %}<span class="input-group-text">{{ field.prefix }}</span>{% endif %}
                            <input type="text" class="form-control" name="{{ field.name }}" value="{{ field.default_value }}"
                                {% if field.required==1 %}required="required"{% endif %}
                                {% if field.readonly==1 %}readonly="readonly"{% endif %}
                            />
                            {% if field.suffix is not empty %}<span class="input-group-text">{{ field.suffix }}</span>{% endif %}
                        </div>
                    {% else %}
                        <input type="text" class="form-control" name="{{ field.name }}" value="{{ field.default_value }}"
                            {% if field.required==1 %}required="required"{% endif %}
                            {% if field.readonly==1 %}readonly="readonly"{% endif %}
                        />
                    {% endif %}

                {% elseif field.type == "select" %}
                    <select class="form-select" name="{{ field.name }}" required="required">
                        {% for k,v in field.options %}
                            <option value="{{v}}" {% if v == field.default_value %}selected="selected"{% endif %}>{{ k }}</option>
                        {% endfor %}
                    </select>

                {% elseif field.type == "checkbox" %}
                    {% for k,v in field.options %}
                        <div class="form-check">
                            <input class="form-check-input" type="checkbox" name="{{ field.name }}[]" value="{{ v }}"
                                {% if field.readonly==1 %}readonly="readonly"{% endif %}
                                {% if v in field.default_value %}checked="checked"{% endif %}
                            />
                            <label class="form-check-label">{{k}}</label>
                        </div>
                    {% endfor %}

                {% elseif field.type == "radio" %}
                    {% for k,v in field.options %}
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="{{ field.name }}" value="{{ v }}"
                                {% if field.default_value == v %}checked{% endif %}
                                {% if field.required==1 %}required="required"{% endif %}
                                {% if field.readonly==1 %}readonly="readonly"{% endif %}
                            />
                            <label class="form-check-label">{{k}}</label>
                        </div>
                    {% endfor %}

                {% elseif field.type == "textarea" %}
                    <textarea class="form-control" id="{{ field.name }}" name="{{ field.name }}" cols="{{ field.options.cols }}" rows="{{ field.options.rows }}"
                        {% if field.required==1 %}required="required"{% endif %}
                        {% if field.readonly==1 %}readonly="readonly"{% endif %}
                    >{{field.default_value}}</textarea>
                {% endif %}
                <div class="form-text">{{field.description}}</div>

                {% if form.style.type == 'horizontal' %}
                    </div>
                {% endif %}
                {% if form.style.type == 'horizontal' %}
                    </div>
                {% endif %}
            {% endfor %}
        </fieldset>
        <input type="hidden" name="form_id" value="{{ form.id }}" />
        <input type="hidden" name="id" value="{{ product.id }}" />
    </div>
    </div>
{% endif %}
