Jump to content

Toon Best Verkocht Lijst In Search.tpl Wanneer Zoekresutaat Leeg Is


pedes

Recommended Posts

Ik wil dus in de search.tpl de best verkochte producten tonen (best-sales) wanneer het zoek resultaat leeg is.

 

Ander krijg je een lege pagina te zien en dit is niet commercieel.

Ik heb in de search.tpl al de best-sales.tpl geintegreerd, maar door een if-else functie op producten krijg ik de lijst beste producten niet te zien.

 

Iemand die hiervoor een oplossing heeft?

 

Mvg,

Pete

Edited by pedes (see edit history)
Link to comment
Share on other sites

mdekker, dank voor uw reply

 

Ik krijg de best-sales wel in de search.tpl, maar niet daar waar het zou moeten...

Nl. daar waar de zoek resultaten leeg zijn.

Zie hieronder de search.tpl, aan gevuld met de include  voor de best sales.

Als ik de include "{include file="$tpl_dir./best-sales.tpl" products=$products}" onder aanzet dan krijg ik de best-sales te zien, maar enkel dus als er ook zoekresultaten zijn.

 

Mijn vraag is dus hoe toon ik de best-sales als er geen zoekresultaten zijn?

 

Alvast dank voor het meedenken

Mvg,

Pete

--------------------------------------------

{include file="$tpl_dir./errors.tpl"}
{if !$nbProducts}
<p class="alert alert-warning">
{if isset($search_query) && $search_query}
{l s='No results were found for your search'} "{if isset($search_query)}{$search_query|escape:'html':'UTF-8'}{/if}"
{include file="$tpl_dir./best-sales.tpl" products=$products}
{elseif isset($search_tag) && $search_tag}
{l s='No results were found for your search'} "{$search_tag|escape:'html':'UTF-8'}"
{include file="$tpl_dir./best-sales.tpl" products=$products}
{else}
{l s='Please enter a search keyword'}
{include file="$tpl_dir./best-sales.tpl" products=$products}
{/if}
</p>
{else} 
{if isset($instant_search) && $instant_search}
        <p class="alert alert-info">
            {if $nbProducts == 1}{l s='%d result has been found.' sprintf=$nbProducts|intval}{else}{l s='%d results have been found.' sprintf=$nbProducts|intval}{/if}
        </p>
    {/if}
    
    <div class="content_sortPagiBar">
        <div class="sortPagiBar clearfix {if isset($instant_search) && $instant_search} instant_search{/if}">
            {include file="$tpl_dir./product-sort.tpl"}
            {if !isset($instant_search) || (isset($instant_search) && !$instant_search)}
                {include file="./nbr-product-page.tpl"}
            {/if}
        </div>
     <div class="top-pagination-content clearfix">
            {include file="./product-compare.tpl"}
            {if !isset($instant_search) || (isset($instant_search) && !$instant_search)}
                {include file="$tpl_dir./pagination.tpl" no_follow=1}
            {/if}
        </div>
</div>
{include file="$tpl_dir./product-list.tpl" products=$search_products}
    <div class="content_sortPagiBar">
     <div class="bottom-pagination-content clearfix">
         {include file="./product-compare.tpl"}
         {if !isset($instant_search) || (isset($instant_search) && !$instant_search)}
                {include file="$tpl_dir./pagination.tpl" paginationId='bottom' no_follow=1}
            {/if}
        </div>
    </div>
    
{/if}

 

Link to comment
Share on other sites

ik gebruik PrestaShop 1.6.0.14

 

... het gebruik van dezelfde var bij beide verklaar inderdaad waarom ik ze wel en niet zie zoals de zoekresultaten

maar hoe los ik dit op??

Ik zie vb. {if !$nbProducts} dan melding 'zoekresultaten zijn leeg {else} toon de zoek resultaten {/if}

Maar ik zie niet direrct een verband met de $products

Of komen deze van de product-list.tpl dit zit geincluded in de search.tpl, alhoewel deze dan weer de $search_products var gebruikt....

 

Ik zie het wellicht verkeerd?

 

Alvast dank voor uw hulp

Edited by pedes (see edit history)
Link to comment
Share on other sites

het is inderdaad geen zo'n gemakkelijk vraagje dunkt me...

die $nbProducts zorgt ervoor dat ik ook de best-sales niet tevoorschijn krijg, maar waarom??

 

de oplossing met Left en Right Column had ik ook al, maar ik wil effectief geen lege pagina in de zoek.

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...