Create a table with the attributes of the product (Prestashop 1.6)

0

I am trying to show the attributes of a product (in this case the sizes) in a table format from which I can add them to the car as if they were independent articles (with their reference), but the most I have achieved is to create an empty table and above the attributes in the form of a radio button. I do not know why, but the code does not respect the cells in the table.

This is more or less what I want: link

And this is what I had until now. Any guidance?:

                                        <!-- attributes -->

                        {if isset($groups)}             
                        <div id="attributes2">
                            <div class="clearfix"></div>
                            {foreach from=$groups key=id_attribute_group item=group}
                                {if $group.attributes|@count}

                                    <fieldset class="attribute_fieldset">
                                        <label class="attribute_label" {if $group.group_type != 'color' && $group.group_type != 'radio'}for="group_{$id_attribute_group|intval}"{/if}>{$group.name|escape:'html':'UTF-8'}&nbsp;</label>
                                        {assign var="groupName" value="group_$id_attribute_group"}


                                <table style="width:100%; background-color:black;">
                                <tr style="background-color:red; padding:20px;">
                                    <th style="color:white; padding:20px;">
                                    <b>REFERENCIA</b>
                                    </th>
                                    <th style="color:white; padding:20px;">
                                    <b>DESCRIPCION</b>
                                    </th>   
                                    <th style="color:white; padding:20px;">
                                    <b>PVP</b>
                                    </th>
                                    <th style="color:white; padding:20px;">
                                    <b>PRECIO SOCIO</b>
                                    </th>
                                    <th style="color:white; padding:20px;">
                                    <b>CANTIDAD</b>
                                    </th>                                       
                                </tr>
                                     {foreach from=$group.attributes key=id_attribute item=group_attribute}                                 
                                <tr>
        <span id="product_reference"{if empty($product->reference) || !$product->reference} style="display: none;"{/if}>
            <label>{l s='Referencia:'} </label>
            <span class="editable" itemprop="sku"{if !empty($product->reference) && $product->reference} content="{$product->reference}"{/if}>{if !isset($groups)}{$product->reference|escape:'html':'UTF-8'}{/if}</span>
        </span>

                                    <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} />
                                    <span>{$group_attribute|escape:'html':'UTF-8'}</span>

                    <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
                        <label for="quantity_wanted">{l s='Quantity'}</label>
                        <input type="text" min="1" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" />
                        <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down">
                            <span><i class="icon-minus"></i></span>
                        </a>
                        <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up">
                            <span><i class="icon-plus"></i></span>
                        </a>
                        <span class="clearfix"></span>
                    </p>

                                </tr>




                                {/foreach}

                                </table>

                                        </div> <!-- end attribute_list -->
                                    </fieldset>
                                {/if}
                            {/foreach}
                        </div> <!-- end attributes -->
    
asked by Javier Ramos 04.04.2018 в 15:32
source

0 answers