Product Producer¶
Use product_producer
module to insert a producer of the currently viewed product on a page. This module uses the product_producer macro which can also be used on it's own for more flexibility. This module is available only within a product card.
Configuration parameters¶
display¶
string
Displays producer's logo if set. Otherwise, its name will be displayed. Values are 'logo' and 'name'.
moveTo¶
string
If the website link is set up clicking on the producer will direct a user to the website. Otherwise, it will direct them to the products page of the producer. Values are 'product_list' and 'url'.
Module source code¶
{% from "@macros/product_producer.twig" import product_producer %}
{% set product = ObjectApi.getProduct(product_id) %}
{% set shopUrls = ObjectApi.getShopUrls() %}
{{ product_producer(product, moduleConfig) }}
<script type="application/ld+json">
{
"@context": [
"http://schema.org/",
{ "@base": "{{ shopUrls.mainPageUrl.absolute }}" }
],
"@id": "{{ product.url.relative }}",
"brand": {
"@type": "Brand",
"name": "{{ product.producer.name }}",
"logo": "{{ product.producer.imageUrl.absolute ?? null }}"
}
}
</script>
The module uses JSON-LD and Microdata from schema.org to optimize search results in browsers.
Macros reference¶
Module configuration schema¶
[
{
"elements": [
{
"type": "infobox",
"name": "infobox",
"options": {
"type": "blank",
"message":"#### Related settings in the admin panel%s- Uploading vendor's logo in [vendor's settings](%s)",
"placeholderValues":["\n","\/admin\/producers\/list"]
}
},
{
"type": "radio",
"name": "display",
"label": "Display:",
"defaultValue": "logo",
"options": {
"radioOptions": [
{"key": "logo", "label": "vendor's logo (if added)", "hint": "If the vendor's logo hasn't been added, its name will be displayed"},
{"key": "name", "label": "vendor's name"}
]
}
},
{
"type": "radio",
"name": "moveTo",
"label": "After clicking on the vendor's name\/logo, move to:",
"defaultValue": "url",
"options": {
"radioOptions": [
{"key": "product_list", "label": "list of this vendor's products in the store (recommended)", "hint": "Customers can view the vendor's product offers without leaving your store."},
{"key": "url", "label": "URL address from vendor's settings (if added)", "hint": "If no URL has been added in the vendor's settings, the link will direct you to the list of its products in your store by default."}
]
}
}
],
"state": "unfolded",
"label": "General settings"
}
]