Sometimes there is a situation where we need to be in place that description on the item card immediately displayed characteristics, that is, to put it simply is necessary to swap tabs description and characteristics of the store opencart, it is pretty easy making a few changes to your template code, namely:
Open the file that lies with us in the following ways catalog/view/theme/Your-template/template/product/product.tpl
and in it we find the following code:
1 2 3 4 |
<a href="#tab-description"><?php echo $tab_description; ?></a> <?php if ($attribute_groups) { ?> <a href="#tab-attribute"><?php echo $tab_attribute; ?></a> <?php } ?> |
Which we change to the code shown below:
1 2 3 4 |
<?php if ($attribute_groups) { ?> <a href="#tab-attribute"><?php echo $tab_attribute; ?></a> <?php } ?> <a href="#tab-description"><?php echo $tab_description; ?></a> |
Next, look for the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<div id="tab-description" class="tab-content"><?php echo $description; ?></div> <?php if ($attribute_groups) { ?> <div id="tab-attribute" class="tab-content"> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></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 } ?> |
And replace it with the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?php if ($attribute_groups) { ?> <div id="tab-attribute" class="tab-content"> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></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 } ?> <div id="tab-description" class="tab-content"><?php echo $description; ?></div> |
That's all such a simple method, we changed the tab description and characteristics of the goods in some places.
PS: Some templates code may be slightly different.
No Comment
You can post first response comment.