Skip to content

Product Ask Questions

The product_ask_questions module is used to render a modal that enables asking questions about the product we are currently browsing.

Configuration parameters

legalNotice

string Legal notice text that includes important legal information about collecting the necessary data that users must read and acknowledge.

Module source code

{% from "@macros/icon.twig" import icon %}
{% from "@macros/product_ask_questions_modal_form.twig" import product_ask_questions_modal_form %}

{% set modalName = 'product-ask-questions-modal-' ~ moduleInstance %}

{% set product = ObjectApi.getProduct(product_id) %}

<div class="product-ask-questions">
    <h-modal-opener class="labeled-icon labeled-icon_horizontal" name="{{ modalName }}">
        {{ icon('icon-message-circle', {
            classNames: ['labeled-icon__icon', 'labeled-icon__icon_m']
        }) }}
        <span class="labeled-icon__signature labeled-icon__signature_secondary">{{ translate('Ask about the product') }}</span>
    </h-modal-opener>

    {{
        product_ask_questions_modal_form(
            product,
            {
                modalName,
                instanceId: moduleInstance,
                imageSize: systemConfig.sSize,
                legalNotice: moduleConfig.legalNotice
            }
        )
    }}
</div>

Macros reference

Used styles

Module configuration schema

[
    {
        "state": "unfolded",
        "label": "General settings",
        "elements": [
            {
                "type": "infobox",
                "name": "infobox",
                "options": {
                    "type": "blank",
                    "message": "#### Related settings in the admin panel%s- changing phrases in [translations](%s)",
                    "placeholderValues": [
                        "\n",
                        "\/admin\/configLanguages\/list"
                    ]
                }
            },
            {
                "type": "textarea",
                "name": "legalNotice",
                "label": "Legal notice",
                "defaultValue": "The personal data controller is {shop_company_name}. We process this data for the purpose of sending a response to the inquiry. More information regarding the processing of personal data can be found in <a href='\/pl\/i\/Polityka-prywatnosci\/11'>the privacy policy<\/a>.",
                "supportsTranslations": true
            }
        ]
    }
]