Jump to content
  • 0

Miniaturki podkategorii (Presta 1.6.0.11)


celect

Question

Co trzeba zmienić, aby zmienić wygląd miniaturek podkategorii z takich:

 

2aj8ea8.jpg

 

na takie:

 

166ixjk.jpg

 

W ustawieniach oczywiście załadowałem stosowny obrazek do każdej kategorii, ale szablon to ignoruje i wstawia przyciski z takimi samymi ikonami.

 

Oto kod category.tpl:

{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{include file="$tpl_dir./errors.tpl"}
{if isset($category)}

	{if $category->id AND $category->active}

        {*{if $scenes}
            <!-- Scenes -->
            <div class="content_scene row">
                {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
            </div>
        {/if}*}

        {if $category->description}
            <!-- Category desc. -->
            <div class="category-description normalized">
                {$category->description}
            </div>
        {/if}

        {if isset($subcategories) && isset($WPAC_subcategories) && $WPAC_subcategories}
            <!-- Subcategories -->
            <div id="subcategories">
                <h3 class="title-1">{l s='Subcategories'}</h3>
                <ul class="grid grid-6">
                {foreach from=$subcategories item=subcategory}
                    <li class="item">
                        <div class="title">
                            <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">
                                <span class="wpicon wpicon-tag medium"></span><span class="subcategory-name" >{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</span>
                            </a>
                        </div>
                    </li>
                {/foreach}
                </ul>
            </div>
		{/if}

		{if $products}
			<div class="content_sortPagiBar row">
            	<div class="sortPagiBar column col-12-12">
                	{include file="./product-compare.tpl"}

                    <div class="align-right">
                        {include file="$tpl_dir./category-view-type.tpl"}
                        {include file="./nbr-product-page.tpl"}
            		    {include file="./product-sort.tpl"}
                    </div>
				</div>
			</div>

            <div class="product-list-grid grid grid-{if ($WPAC_categoryViewType == "grid")}{$WPAC_gridColumnSize}{elseif ($WPAC_categoryViewType == "list")}1 list{/if}{if isset($WPAC_categoryShowAvgRating) && !$WPAC_categoryShowAvgRating} hide-rating{/if}{if isset($WPAC_categoryShowColorOptions) && !$WPAC_categoryShowColorOptions} hide-color-options{/if}{if isset($WPAC_categoryShowStockInfo) && !$WPAC_categoryShowStockInfo} hide-stock-info{/if}{if isset($WPAC_quickView) && !$WPAC_quickView} hide-quickview{/if}">
			    {include file="./product-list.tpl" products=$products}
            </div>

			<div class="content_sortPagiBar bottom row">
				<div class="bottom-pagination-content column col-12-12">
                    {include file="./pagination.tpl" paginationId='bottom'}
				</div>
			</div>
        {else}
            <h1>{l s='There are no products in this category!'}</h1>
        {/if}

	{elseif $category->id}
		<p class="alert alert-warning">{l s='This category is currently unavailable.'}</p>
	{/if}
{/if}

{addJsDef WPAC_quickView=$WPAC_quickView}

{*Custom Hook for Quick Image Viewer*}
{addJsDef WPAC_quickImageViewer=$WPAC_quickImageViewer}
{addJsDef WPAC_quickImageViewerAutoNext=$WPAC_quickImageViewerAutoNext}
{hook h='quickImageViewer'}
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Odświeżam, bo udało mi się samemu coś zdziałać, ale potrzebuje jeszcze małej pomocy.

 

Podmieniłem kawałek kodu na ten:

<div id="subcategories">
			<p class="subcategory-heading"></p>
			<ul class="grid grid-6">
                {foreach from=$subcategories item=subcategory}
                    <li class="item">
                	<div class="subcategory-image">
						<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">
						{if $subcategory.id_image}
							<img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{else}
							<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
						{/if}
					</a>
                   	</div>
					<h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>
					{if $subcategory.description}
						<div class="cat_desc">{$subcategory.description}</div>
					{/if}
				</li>
			{/foreach}
			</ul>
		</div>

i w końcu wyświetlają mi się miniaturki podkategorii.

 

nbte74.jpg

 

Problem w tym, że po przejściu do takiej podkategorii miniaturkę widać także na górnym banerze. Jak to usunać?

 

nd3ler.jpg

Link to comment
Share on other sites

  • 0

Monologu ciąg dalszy. :-)

 

W innym wątku doczytałem, że wystarczy usunąć ten fragment:

 {if $category->id_image}
		 <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage"/>
    {/if}

tylko, że u mnie w pliku category.tpl takiego kodu nie ma. Gdzie go można jeszcze znaleźć?

 

E:

znalazłem plik category-header.tpl i chyba on m.in. odpowiada za fotkę w tym banerze.

{if isset($category) AND $category->id AND $category->active}

    {$WPAC_categoryHeaderStyle = "|"|explode:$WPAC_categoryHeaderStyle}
    {$categoryHeaderNamePosition = $WPAC_categoryHeaderStyle[0]}
    {$categoryHeaderBreadcrumbPosition = $WPAC_categoryHeaderStyle[1]}

    <div id="category-header" {if $category->id_image}style="background-image: url('{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'atmn_category')|escape:'html'}')"{/if}>
        <div class="row parent">

            {if ($categoryHeaderBreadcrumbPosition == $categoryHeaderNamePosition)}

                <div class="row">
                    <div class="category-name column col-12-12 t-align-{$categoryHeaderNamePosition}">
                        <h1>{$category->name|escape:'htmlall':'UTF-8'}</h1>
                        <span class="category-product-count">
                            {include file="$tpl_dir./category-count.tpl"}
                        </span>
                    </div>
                </div>

                <div class="row">
                    <div class="breadcrumb-wrapper column col-12-12 t-align-{$categoryHeaderBreadcrumbPosition}">
                        {include file="$tpl_dir./breadcrumb.tpl"}
                    </div>
                </div>

            {else}
            
                {if ($categoryHeaderNamePosition == "right")}
                    {$categoryHeaderNameExtraClass = "t-align-right push-6-12"}
                    {$categoryHeaderBreadcrumbExtraClass = "pull-6-12"}
                {else}
                    {$categoryHeaderNameExtraClass = ""}
                    {$categoryHeaderBreadcrumbExtraClass = "t-align-right"}
                {/if}

                <div class="one-row row valign-middle">
                    <div class="category-name column col-6-12 {$categoryHeaderNameExtraClass}">
                        <h1>{$category->name|escape:'htmlall':'UTF-8'}</h1>
                        <span class="category-product-count">
                            {include file="$tpl_dir./category-count.tpl"}
                        </span>
                    </div>

                    <div class="breadcrumb-wrapper column col-6-12 {$categoryHeaderBreadcrumbExtraClass}">
                        {include file="$tpl_dir./breadcrumb.tpl"}
                    </div>
                </div>

            {/if}

        </div>
    </div>
{/if}

Jak zmienić kod, żeby strona nie pobierała zdjęcia z miniaturki podkategorii, tylko za każdym razem wyświetlała tą sama grafikę (np. ten różowo-czerwony pasek, który znajduje się w plikach szablonu - defaultCatBg.jpg)?

Edited by celect (see edit history)
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...