Автор Тема: как убрать количество товаров из заголовка категории  (Прочитано 3917 раз)

23 Июнь 2012, 19:19:26
  • Новичок
  • *
  • Сообщений: 4
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Здравствуйте
Подскажите, пожалуйста, как убрать количество товаров из заголовка категории.
Пробовали менять category.tpl вот так:
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}</h1>
<span class="category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</span>
{/strip}
и вот так:
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
</h1>{/if}{/strip}
<span class="category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</span>
Но, к сожалению, ничего не изменилось, может мы не там меняли или вообще что-то не то делали  :o
Заранее спасибо
23 Июнь 2012, 21:35:38
Ответ #1
  • Партнер
  • Ветеран
  • ****
  • Сообщений: 22816
  • Репутация: +17143/-1
  • Разработка веб-сайтов и веб-программирование
    • Просмотр профиля
Удалить
<span class="category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</span>
из шаблона.
Интернет-магазин под ключ.
Какой выбрать движок для интернет магазина ?
Какой движок лучше ?
Magento или Prestashop ?
Решение всех Ваших вопросов в создании Интернет-магазина.
23 Июнь 2012, 21:49:58
Ответ #2
  • Новичок
  • *
  • Сообщений: 4
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Да, конечно, я понимаю, но мы хотим оставить этот спан, только не в составе заголовка, потому как ему там не место.
24 Июнь 2012, 12:11:06
Ответ #3
  • Администратор
  • Ветеран
  • *****
  • Сообщений: 102503
  • Репутация: +34219/-0
    • Просмотр профиля
За вывод количества товаров отвечает шаблон
category-count.tplЕсли вы хотите убрать вывод количества товаров в категории:
- или сделать этот шаблон пустым
- или удалить
{include file="$tpl_dir./category-count.tpl"}
24 Июнь 2012, 14:42:59
Ответ #4
  • Новичок
  • *
  • Сообщений: 4
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Простите, наверное, я не правильно выразилась.
Но я всего лишь пытаюсь извлечь span, который выводит шаблон, отвечающий за количество товара из заголовка H1, в котором он (span) находится и упрямо не выходит, несмотря ни на какие изменения
24 Июнь 2012, 22:01:53
Ответ #5
  • Администратор
  • Ветеран
  • *****
  • Сообщений: 102503
  • Репутация: +34219/-0
    • Просмотр профиля
Удалите тег span в шаблоне категорий вашей темы. Очистите кеш.
24 Июнь 2012, 22:04:56
Ответ #6
  • Администратор
  • Ветеран
  • *****
  • Сообщений: 102503
  • Репутация: +34219/-0
    • Просмотр профиля
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
</h1>

<div class="resumecat category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</div>
24 Июнь 2012, 23:06:04
Ответ #7
  • Новичок
  • *
  • Сообщений: 4
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Виктор Демидов, спасибо! Получилось
20 Октябрь 2015, 21:07:54
Ответ #8
  • Новичок
  • *
  • Сообщений: 3
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
</h1>

<div class="resumecat category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</div>

честно не понял вообще что именно нужно удалить из category.tpl
вот код данного моего файла:
{*
* 2007-2015 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 license@prestashop.com 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 <contact@prestashop.com>
*  @copyright  2007-2015 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 || $category->description || $category->id_image}
<div class="content_scene_cat">
            {if $scenes}
                  <div class="content_scene">
                        <!-- Scenes -->
                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
                        {if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                    </div>
{else}
                    <!-- Category image -->
                    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>
{/if}
<h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}"><span class="cat-name">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)}&nbsp;{$categoryNameComplement|escape:'html':'UTF-8'}{/if}</span>{include file="$tpl_dir./category-count.tpl"}</h1>
{if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
<!-- Subcategories -->
<div id="subcategories">
<p class="subcategory-heading">{l s='Subcategories'}</p>
<ul class="clearfix">
{foreach from=$subcategories item=subcategory}
<li>
                <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="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" 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'}</a></h5>
{if $subcategory.description}
<div class="cat_desc">{$subcategory.description}</div>
{/if}
</li>
{/foreach}
</ul>
</div>
        {/if}
{/if}
{if $products}
<div class="content_sortPagiBar clearfix">
            <div class="sortPagiBar clearfix">
            {include file="./product-sort.tpl"}
                {include file="./nbr-product-page.tpl"}
</div>
                <div class="top-pagination-content clearfix">
                {include file="./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}
                </div>
</div>
{include file="./product-list.tpl" products=$products}
<div class="content_sortPagiBar">
<div class="bottom-pagination-content clearfix">
{include file="./product-compare.tpl" paginationId='bottom'}
                    {include file="./pagination.tpl" paginationId='bottom'}
</div>
</div>
{/if}
{elseif $category->id}
<p class="alert alert-warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}
20 Октябрь 2015, 21:27:07
Ответ #9
  • Новичок
  • *
  • Сообщений: 3
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
<h1>
{strip}
{$category->name|escape:'htmlall':'UTF-8'}
{if isset($categoryNameComplement)}
{$categoryNameComplement|escape:'htmlall':'UTF-8'}
{/if}
{/strip}
</h1>

<div class="resumecat category-product-count">
{include file="$tpl_dir./category-count.tpl"}
</div>

честно не понял вообще что именно нужно удалить из category.tpl
вот код данного моего файла:
{*
* 2007-2015 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 license@prestashop.com 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 <contact@prestashop.com>
*  @copyright  2007-2015 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 || $category->description || $category->id_image}
<div class="content_scene_cat">
            {if $scenes}
                  <div class="content_scene">
                        <!-- Scenes -->
                        {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
                        {if $category->description}
                            <div class="cat_desc rte">
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short">{$description_short}</div>
                                <div id="category_description_full" class="unvisible">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div>{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                    </div>
{else}
                    <!-- Category image -->
                    <div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>
                        {if $category->description}
                            <div class="cat_desc">
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
                            {else}
                                <div class="rte">{$category->description}</div>
                            {/if}
                            </div>
                        {/if}
                     </div>
                  {/if}
            </div>
{/if}
<h1 class="page-heading{if (isset($subcategories) && !$products) || (isset($subcategories) && $products) || !isset($subcategories) && $products} product-listing{/if}"><span class="cat-name">{$category->name|escape:'html':'UTF-8'}{if isset($categoryNameComplement)}&nbsp;{$categoryNameComplement|escape:'html':'UTF-8'}{/if}</span>{include file="$tpl_dir./category-count.tpl"}</h1>
{if isset($subcategories)}
        {if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }
<!-- Subcategories -->
<div id="subcategories">
<p class="subcategory-heading">{l s='Subcategories'}</p>
<ul class="clearfix">
{foreach from=$subcategories item=subcategory}
<li>
                <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="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" 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'}</a></h5>
{if $subcategory.description}
<div class="cat_desc">{$subcategory.description}</div>
{/if}
</li>
{/foreach}
</ul>
</div>
        {/if}
{/if}
{if $products}
<div class="content_sortPagiBar clearfix">
            <div class="sortPagiBar clearfix">
            {include file="./product-sort.tpl"}
                {include file="./nbr-product-page.tpl"}
</div>
                <div class="top-pagination-content clearfix">
                {include file="./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}
                </div>
</div>
{include file="./product-list.tpl" products=$products}
<div class="content_sortPagiBar">
<div class="bottom-pagination-content clearfix">
{include file="./product-compare.tpl" paginationId='bottom'}
                    {include file="./pagination.tpl" paginationId='bottom'}
</div>
</div>
{/if}
{elseif $category->id}
<p class="alert alert-warning">{l s='This category is currently unavailable.'}</p>
{/if}
{/if}

все сам разобрался))
надо из product.tpl убрать :
<!-- quantity wanted -->
<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity == 0) || $virtual} style="display:none;"{/if}>
<label>{l s='Quantity :'}</label>
<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />
</p>