Skip to content

Favourites Button

Use favourites_button to render a button allowing to enter a view with favourite products.

Configuration parameters

none

Module source code

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

{% set shopUrls = ObjectApi.getShopUrls() %}

<a class="favourites-button labeled-icon" href="{{ shopUrls.userFavouriteProductsUrl }}">
    {{ icon('icon-heart', {
        classNames: ['favourites-button__icon', 'labeled-icon__icon']
    }) }}
    <span class="favourites-button__signature labeled-icon__signature">{{ translate('Wishlist') }}</span>
</a>

Macros reference

Used Object Api methods

Used styles

Module configuration schema

[
    {
        "state": "unfolded",
        "label": "General settings",
        "elements": [
            {
                "type": "infobox",
                "name": "infobox",
                "options": {
                    "type": "blank",
                    "message": "%s Related settings%s**in the admin panel**%s- changing phrases in [translations](%s)%s%s**in the Shoper Visual Editor:**%s- enabling the addition of new products to favorites in the \"Add to cart\/wishlist\" module",
                    "placeholderValues": [
                        "####",
                        "\n",
                        "\n",
                        "\/admin\/configLanguages\/list",
                        "\n",
                        "\n",
                        "\n"
                    ]
                }
            }
        ]
    }
]