title: Prestashop 1.7 template not pass variable
body: <p>I have a problem that I can not solve.
  in prestashop 1.7 I have a tpl file called product.tpl where inside, besides the various data, I call a file with the following code:</p>
  
  <pre><code>&lt;div class="product-actions"&gt;
            {block name='product_buy'}
              &lt;form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh"&gt;
                &lt;input type="hidden" name="token" value="{$static_token}"&gt;
                &lt;input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id"&gt;
                &lt;input type="hidden" name="id_customization" value="{$product.customization_id}" id="product_customization_id"&gt;
  
                {block name='product_variants'}
                  {include file='catalog/_partials/product-variants.tpl'}
                {/block}
  
                {block name='product_pack'}
                  {if $packItems}
                    &lt;section class="product-pack"&gt;
                      &lt;h3 class="h4"&gt;{l s='This pack contains' d='Shop.Theme.Catalog'}&lt;/h3&gt;
                      {foreach from=$packItems item="product_pack"}
                        {block name='product_miniature'}
                          {include file='catalog/_partials/miniatures/pack-product.tpl' product=$product_pack}
                        {/block}
                      {/foreach}
                  &lt;/section&gt;
                  {/if}
                {/block}
  
                {block name='product_discounts'}
                  {include file='catalog/_partials/product-discounts.tpl'}
                {/block}
  
                {block name='product_add_to_cart'}
                  {include file='catalog/_partials/product-add-to-cart.tpl'}
                {/block}
  
                {block name='product_additional_info'}
                  {include file='catalog/_partials/product-additional-info.tpl'}
                {/block}
  
                {block name='product_refresh'}
                  &lt;input class="product-refresh ps-hidden-by-js" name="refresh" type="submit" value="{l s='Refresh' d='Shop.Theme.Actions'}"&gt;
                {/block}
              &lt;/form&gt;
            {/block}
  
          &lt;/div&gt;
  </code></pre>
  
  <p>and everything works correctly.</p>
  
  <p>what interests me most specifically is the portion of code referred to in this block</p>
  
  <pre><code>{block name='product_variants'}
                  {include file='catalog/_partials/product-variants.tpl'}
                {/block}
  </code></pre>
  
  <p>The code is: </p>
  
  <pre><code>&lt;div class="product-variants"&gt;
    {foreach from=$groups key=id_attribute_group item=group}
      &lt;div class="clearfix product-variants-item"&gt;
        &lt;span class="control-label"&gt;{$group.name}&lt;/span&gt;
        {if $group.group_type == 'select'}
          &lt;select
            class="form-control form-control-select"
            id="group_{$id_attribute_group}"
            data-product-attribute="{$id_attribute_group}"
            name="group[{$id_attribute_group}]"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}&gt;{$group_attribute.name}&lt;/option&gt;
            {/foreach}
          &lt;/select&gt;
        {elseif $group.group_type == 'color'}
          &lt;ul id="group_{$id_attribute_group}"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;li class="float-xs-left input-container"&gt;
                &lt;label&gt;
                  &lt;input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}&gt;
                  &lt;span
                    {if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
                    {if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
                  &gt;&lt;span class="sr-only"&gt;{$group_attribute.name}&lt;/span&gt;&lt;/span&gt;
                &lt;/label&gt;
              &lt;/li&gt;
            {/foreach}
          &lt;/ul&gt;
        {elseif $group.group_type == 'radio'}
          &lt;ul id="group_{$id_attribute_group}"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;li class="input-container float-xs-left"&gt;
                &lt;label&gt;
                  &lt;input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}&gt;
                  &lt;span class="radio-label"&gt;{$group_attribute.name}&lt;/span&gt;
                &lt;/label&gt;
              &lt;/li&gt;
            {/foreach}
          &lt;/ul&gt;
        {/if}
      &lt;/div&gt;
    {/foreach}
  &lt;/div&gt;
  </code></pre>
  
  <p>then I modified the tpl file of the module ps_featuredproducts and inside the main file "ps_featuredproducts.tpl", inside the foreach I inserted a part of the code to display the variants and some product html design.</p>
  
  <p>what happens is that I visualize perfectly the formatting but all the values ​​of the variants do not let me see them, specifically this portion of code does not work</p>
  
  <pre><code>&lt;div class="product-variants"&gt;
    {foreach from=$groups key=id_attribute_group item=group}
      &lt;div class="clearfix product-variants-item"&gt;
        &lt;span class="control-label"&gt;{$group.name}&lt;/span&gt;
        {if $group.group_type == 'select'}
          &lt;select
            class="form-control form-control-select"
            id="group_{$id_attribute_group}"
            data-product-attribute="{$id_attribute_group}"
            name="group[{$id_attribute_group}]"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}&gt;{$group_attribute.name}&lt;/option&gt;
            {/foreach}
          &lt;/select&gt;
        {elseif $group.group_type == 'color'}
          &lt;ul id="group_{$id_attribute_group}"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;li class="float-xs-left input-container"&gt;
                &lt;label&gt;
                  &lt;input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}&gt;
                  &lt;span
                    {if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
                    {if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
                  &gt;&lt;span class="sr-only"&gt;{$group_attribute.name}&lt;/span&gt;&lt;/span&gt;
                &lt;/label&gt;
              &lt;/li&gt;
            {/foreach}
          &lt;/ul&gt;
        {elseif $group.group_type == 'radio'}
          &lt;ul id="group_{$id_attribute_group}"&gt;
            {foreach from=$group.attributes key=id_attribute item=group_attribute}
              &lt;li class="input-container float-xs-left"&gt;
                &lt;label&gt;
                  &lt;input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}&gt;
                  &lt;span class="radio-label"&gt;{$group_attribute.name}&lt;/span&gt;
                &lt;/label&gt;
              &lt;/li&gt;
            {/foreach}
          &lt;/ul&gt;
        {/if}
      &lt;/div&gt;
    {/foreach}
  &lt;/div&gt;
  </code></pre>
  
  <p>Obviously the same code in the product page recalls all the variables, while in the home where I recall the contents on the homepage I can not recover them. Where am I wrong? I put hands on prestashop only a few weeks ago and I think I have a  confused ideas.
  I hope little I have been clear, thanks to those who have the patience to answer.</p>