Hello,
I’m trying to filter products by their material (cotton, silk, etc). The filter works but how I can show the translated values in the frontend? Currently the output is: milksatin and cotton, but I would like to show the translated values GOTS Milk Satin and Cotton or their german counterparts.
blueprint:
material:
label: Material
type: tags
options:
"milksatin":
en: GOTS Milk Satin
de: GOTS Milch Seide
"cotton":
en: Cotton
de: Baumwolle
template for the filter checkbox:
<?php $products = $page->children()->listed();
$materials = $products->pluck('material', ',', true) ?>
<?php foreach ($materials as $material):?>
<div>
<input class="checkbox" type="checkbox" id="checkbox-<?= $material ?>" data-filter="<?= $material ?>">
<label for="checkbox-<?= $material ?>"><?= $material ?></label>
</div>
<?php endforeach ?>
Thanks for helping me!