Apoi daca doriti ca atributele sa apara langa brand, model si celelalte, mutati codul atributelor din tabul attributes langa model.
Exemplificare pentru opencart 2.x direct, usor de adaptat si pentru 156x:
In catalog/view/theme/tema-ta/template/product/product.tpl trebuie sa inlaturi codul:
Code: Select all
<?php if ($attribute_groups) { ?>
<div class="tab-pane" id="tab-specification">
<table class="table table-bordered">
<?php foreach ($attribute_groups as $attribute_group) { ?>
<thead>
<tr>
<td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
<td><?php echo $attribute['name']; ?></td>
<td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
</tbody>
<?php } ?>
</table>
</div>
<?php } ?>
Code: Select all
<?php if ($attribute_groups) { ?>
<li><a href="#tab-specification" data-toggle="tab"><?php echo $tab_attribute; ?></a></li>
<?php } ?>
Code: Select all
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
Code: Select all
<?php if ($attribute_groups) { ?>
<?php foreach ($attribute_groups as $attribute_group) { ?>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<li><?php echo $attribute['name']; ?>: <?php echo $attribute['text']; ?></li>
<?php } ?>
<?php } ?>
<?php } ?>
Asta ar fii o varianta, folositi aceasta varianta daca nu aveti nevoie si de tabul Specificatii (adica cel cu atribute).
Daca doriti sa aveti si tabul specificatii cu anumite atribute in el si alte campuri (informatii) afisate langa model si brand, puteti face in asa fel incat langa brand si model sa afiseze atributele dintrun anumit grup de atribute, iar restul in tabul specificatii.
Pentru aceasta metoda nu mai inlaturati codul de mai sus, in schimb, modificati portiunea de cod:
Code: Select all
<?php if ($attribute_groups) { ?>
<div class="tab-pane" id="tab-specification">
<table class="table table-bordered">
<?php foreach ($attribute_groups as $attribute_group) { ?>
<thead>
<tr>
<td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
<td><?php echo $attribute['name']; ?></td>
<td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
</tbody>
<?php } ?>
</table>
</div>
<?php } ?>
Code: Select all
<?php if ($attribute_groups) { ?>
<div class="tab-pane" id="tab-specification">
<table class="table table-bordered">
<?php foreach ($attribute_groups as $attribute_group) { ?>
<?php if ($attribute_group['attribute_group_id'] != 9999) { ?>
<thead>
<tr>
<td colspan="2"><strong><?php echo $attribute_group['name']; ?></strong></td>
</tr>
</thead>
<tbody>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
<td><?php echo $attribute['name']; ?></td>
<td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
</tbody>
<?php } ?>
<?php } ?>
</table>
</div>
<?php } ?>
Apoi dupa linia:
Code: Select all
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
Code: Select all
<?php if ($attribute_groups) { ?>
<?php foreach ($attribute_groups as $attribute_group) { ?>
<?php if ($attribute_group['attribute_group_id'] == 9999) { ?>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<li><?php echo $attribute['name']; ?>: <?php echo $attribute['text']; ?></li>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
Acest 9999 il veti inlocuii cu idul grupului creat de dumneavoastra pentru aceste informatii. Exemplu creati un grup "More product basic info" in admin la grupuri de atribute, iar atributele pe care le doriti sa apara langa model si brand le adaugati in acest grup. Id-ul grupului il puteti afla tot in admin, dupa ce ati creat grupul, il editati, iar in url-ul paginii de editare veti vedea un parametru &attribute_group_id=9999. Unde acel numar in loc de 9999 este idul grupului.
Am folosit 9999 in loc de x pentru ca am observat ca oameni sunt confuzati de acel x.