Post by 824458211 » Tue Jan 21, 2014 3:19 pm

i have a new opencart website ,the product details page have 4 labels,description,specification,reviews and related product

so how can i add labels?because i want to a label display more photos of product,like this website

http://www.superbrightleds.com/moreinfo ... -kit/1537/

hope get the answer,thanks..... :)

Newbie

Posts

Joined
Tue Jan 21, 2014 3:06 pm

Post by andrei.bogdan » Tue Jan 21, 2014 4:51 pm

Hi,

You can do the following (this is not best practice, you should use language files and respect the MVC system):

If you are using the default theme, open the file

Code: Select all

catalog\view\theme\default\template\product\product.tpl
Go to line 254 and after the code

Code: Select all

    <?php if ($products) { ?>
    <a href="#tab-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</a>
    <?php } ?>
You can add the following:

Code: Select all

<?php if ($images) { ?>
<a href="#tab-images">More images</a>
<?php } ?>
Then create a new div, after the div with id 'tabs':

Code: Select all

 <?php if ($images) { ?>
<div id="tab-images" class="tab-content">
    
        <?php foreach ($images as $image) { ?>
        <a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="colorbox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a>
        <?php } ?>
</div>
<?php } ?>
That's the basic idea, you can alter this to match your theme.

Andrei

Andrei
andrei.opencart[at]yahoo.com
Themes and Extensions


Active Member

Posts

Joined
Mon Mar 25, 2013 4:52 am
Who is online

Users browsing this forum: Google [Bot], Semrush [Bot] and 19 guests