Jump to content

On startup home tab not showing any tab


cikcak

Recommended Posts

I have 4 modules in my home tab hook:

 

1. New products block

2. Top sellers block

3. Featured products on homepage

4. Featured category products on homepage

 

homeTabContent same modules in same position.

 

If I open my website no one of tab is active. If I click on New product it shows 8 products. If click top seller - show top 8 products.

 

But I want to show the first tab always when customer open a website.

 

Code in my theme/module/ ... / tab.tpl

<li><a data-toggle="tab" href="#blockbestsellers" class="blockbestsellers">{l s='Best Sellers' mod='blockbestsellers'}</a></li>

<li><a data-toggle="tab" href="#blocknewproducts" class="blocknewproducts">{l s='New arrivals' mod='blocknewproducts'}</a></li>

<li><a data-toggle="tab" href="#homefeatured" class="homefeatured">{l s='Popular' mod='homefeatured'}</a></li>

and featuredcategoryps16.tpl

{if isset($products) && $products}
    {include file="$tpl_dir./product-list.tpl" class='homefeatured tab-pane' id='categoryfeatured'}
{else}
<ul id="categoryfeatured" class="categoryfeatured tab-pane">
    <li class="alert alert-info">{l s='No featured products at this time.' mod='categoryfeatured'}</li>
</ul>
{/if}

what should I change to show for example the forst one - new product block opened on startup?

 

 

Link to comment
Share on other sites

hello

strange, because this is how it works by default

i mean prestashop always open first tab when someone open your shop for the first time

Yap, i tried to disable your module categoryfeatured to have only default modules. Still same.

 

theme/default-bootstrap/js/index.js code:

$(document).ready(function(){
    $('#home-page-tabs li:first, #index .tab-content ul:first').addClass('active');
});
Link to comment
Share on other sites

I changed this code:

$(document).ready(function(){
$('#home-page-tabs li:first').addClass('active');
});

TO:

$(document).ready(function(){
    $('#home-page-tabs li:first, #index .tab-content ul:first').addClass('active');
});

And disabled APC in server, it seems I have problems with cache...

 

And it seems it works.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...