Product Short Description¶
Availability:
Use product_short_description module to insert a short description of the currently viewed product on a page. This module uses the product_short_description macro which can also be used on it's own for more flexibility. This module is available only within a product card.
Configuration parameters¶
none
Module source code¶
{% from "@macros/product_short_description.twig" import product_short_description %}
{% set product = ObjectApi.getProduct(product_id) %}
{% set hasEditorSettingsAppearance = moduleConfig.moduleAppearance == 'editorSettings' %}
{% if product.shortDescription|length > 0 %}
{{ product_short_description(product.shortDescription, { hasEditorSettingsAppearance, showLink: true }) }}
{% if ObjectApi.getFeatureFlag("dev_storefront_ai_seo").isEnabled and product.description is empty %}
{% set shopUrls = ObjectApi.getShopUrls() %}
<script type="application/ld+json">
{
"@context": [
"http://schema.org/",
{ "@base": "{{ shopUrls.mainPageUrl.absolute }}" }
],
"@id": "{{ product.url.relative }}",
"description": {{ product.shortDescription | striptags | json_encode(constant('JSON_UNESCAPED_UNICODE')) | raw }}
}
</script>
{% endif %}
{% endif %}
Macros reference¶
Module configuration schema¶
[
{
"state": "unfolded",
"label": "General settings",
"elements": [
{
"type": "radio",
"name": "moduleAppearance",
"label": "The module content appearance is determined by:",
"defaultValue": "editorSettings",
"options": {
"radioOptions": [
{
"key": "editorSettings",
"label": "only by the settings from the text editor"
},
{
"key": "editorAndSkinSettings",
"label": "text editor and store theme style",
"hint": "If you do not change the appearance of the content (e.g. text size and color) in the text editor, the module will use the store theme styles."
}
]
}
}
]
}
]