Loyalty Product Title¶
loyalty_product_title
module is used to display a product title in a loyalty program context. It has an additional tag element indicating that we are within a loyalty program context.
Configuration parameters¶
none
Module source code¶
{% from "@macros/section_title.twig" import section_title %}
{% from "@macros/product_title_tag_group.twig" import product_title_tag_group %}
{% set product = ObjectApi.getProduct(product_id) %}
{% set shopUrls = ObjectApi.getShopUrls() %}
{{ section_title(product.name, { cssClasses: "loyalty-section-title" }) }}
{{ product_title_tag_group(product, { loyalty: true, bundle: true, digital: true, cssClasses: "mt-xs-1" }) }}
<script type="application/ld+json">
{
"@context": [
"http://schema.org/",
{ "@base": "{{ shopUrls.mainPageUrl.absolute }}" }
],
"@id": "{{ product.url.relative }}",
"@type": "http://schema.org/Product",
"offers": {
"@id": "{{ product.url.relative }}",
"@type": "Offer",
"url": "{{ product.url.absolute }}"
}
}
</script>
<script type="application/ld+json">
{
"@context": [
"http://schema.org/",
{ "@base": "{{ shopUrls.mainPageUrl.absolute }}" }
],
"@id": "{{ product.url.relative }}",
"name": "{{ product.name }}"
}
</script>
The module uses JSON-LD and Microdata from schema.org to optimize search results in browsers.