Categories

Featured templates

OpenCart 2.x. How to change order of Featured, Latest, Bestsellers tabs on home page

Martin Clarke October 21, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

OpenCart 2.x. How to change order of Featured, Latest, Bestsellers tabs on home page

This tutorial will show you how to change order of Featured, Latest, Bestsellers tabs on home page in OpenCart 2.x.

OpenCart 2.x. How to change Featured, Latest, Bestsellers tabs order on home page-1

  1. Use FTP or cPanel and navigate to catalog\view\theme\themeXXX\template\module\tm_single_category_product.tpl file. On lines 25-48 you will find the following code:

     
    		<?php if ($latest_products) { ?>
                            <li>
                                <a href="#tab-latest-<?php echo $module; ?>" role="tab"
                                   data-toggle="tab"><?php echo $heading_latest; ?></a>
                            </li>
                    <?php } ?>
                    <?php if ($featured_products) { ?>
                            <li>
                                <a href="#tab-featured-<?php echo $module; ?>" role="tab"
                                   data-toggle="tab"><?php echo $heading_featured; ?></a>
                            </li>
                    <?php } ?>
                    <?php if ($special_products) { ?>
                            <li>
                                <a href="#tab-specials-<?php echo $module; ?>" role="tab"
                                   data-toggle="tab"><?php echo $heading_specials; ?></a>
                            </li>
                    <?php } ?>
                    <?php if ($bestseller_products) { ?>
                            <li>
                                <a href="#tab-bestsellers-<?php echo $module; ?>" role="tab"
                                   data-toggle="tab"><?php echo $heading_bestsellers; ?></a>
                            </li>
                    <?php } ?>
    
  2. Now you need to cut and paste the block of code which is responsible for a tab you want to move before or after other tabs. Let’s make the Featured products the last tab. For this we need to move the following block of code:

      
    		<?php if ($featured_products) { ?>
    			<li>
    			<a href="#tab-featured-<?php echo $module; ?>" role="tab"
    				data-toggle="tab"><?php echo $heading_featured; ?></a>
    			</li>
    		<?php } ?>
    

    After the code which is displaying bestsellers:

     
    		<?php if ($bestseller_products) { ?>
    			<li>
    			<a href="#tab-bestsellers-<?php echo $module; ?>" role="tab"
    				data-toggle="tab"><?php echo $heading_bestsellers; ?></a>
    			</li>
    		<?php } ?>
    
  3. The code after the changes should look like this:

     
    		<?php if ($latest_products) { ?>
                        <li>
                            <a href="#tab-latest-<?php echo $module; ?>" role="tab"
                                data-toggle="tab"><?php echo $heading_latest; ?></a>
                        </li>
                    <?php } ?>
                    <?php if ($special_products) { ?>
                        <li>
                            <a href="#tab-specials-<?php echo $module; ?>" role="tab"
                                data-toggle="tab"><?php echo $heading_specials; ?></a>
                        </li>
                    <?php } ?>
                    <?php if ($bestseller_products) { ?>
                        <li>
                            <a href="#tab-bestsellers-<?php echo $module; ?>" role="tab"
                                data-toggle="tab"><?php echo $heading_bestsellers; ?></a>
                        </li>
                    <?php } ?>
    		<?php if ($featured_products) { ?>
                        <li>
                            <a href="#tab-featured-<?php echo $module; ?>" role="tab"
                                data-toggle="tab"><?php echo $heading_featured; ?></a>
                        </li>
                    <?php } ?>
    
  4. Save the file, reupload it and reload your page. Now your Featured tab is the last tab:

    OpenCart 2.x. How to change Featured, Latest, Bestsellers tabs order on home page-2

Thank you for checking our tutorial. Now you know how to change order of Featured, Latest, Bestsellers tabs on home page in OpenCart 2.x.

Feel free to check the detailed video tutorial below:

OpenCart 2.x. How to change order of Featured, Latest, Bestsellers tabs on home page

Best OpenCart Themes
This entry was posted in OpenCart Tutorials and tagged bestsellers, featured, latest, opencart, order, tab. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket