agregar traducciones del carrito en env
This commit is contained in:
parent
e86f14983b
commit
16a4226991
1 changed files with 15 additions and 0 deletions
15
env.js
15
env.js
|
@ -8,7 +8,22 @@ window.env = {
|
||||||
SPREE_URL: '{{ site.env.SPREE_URL }}'
|
SPREE_URL: '{{ site.env.SPREE_URL }}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{% comment %}
|
||||||
|
Genera un site.json con las traducciones del sitio y los datos de los
|
||||||
|
pasos del carrito. No los extraemos directamente con el filtro
|
||||||
|
`jsonify` porque extraen demasiada información y el JSON se rompe.
|
||||||
|
{% endcomment %}
|
||||||
|
{%- assign steps = 'cart,shipment,payment,confirmation' | split: ',' -%}
|
||||||
|
|
||||||
window.site = {
|
window.site = {
|
||||||
|
{%- for step in steps -%}
|
||||||
|
"{{ step }}": {
|
||||||
|
{%- for attribute in site.data.layouts[step] -%}
|
||||||
|
{%- assign attribute_key = attribute[0] -%}
|
||||||
|
"{{ attribute_key }}": {{ site[step][attribute_key] | jsonify }}{% unless forloop.last %},{% endunless %}
|
||||||
|
{%- endfor -%}
|
||||||
|
},
|
||||||
|
{%- endfor -%}
|
||||||
"i18n": {{ site.i18n | jsonify }}
|
"i18n": {{ site.i18n | jsonify }}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue