wdrożenia PrestaShop Powiększenie zdjęć moduł

Ograniczenie ilości wyświetlanych akcesorii.

  • 2 Odpowiedzi
  • 3301 Wyświetleń

0 użytkowników i 1 Gość przegląda ten wątek.

*

Offline 1q2w3e4r

  • Tubylec
  • ****
  • 104
  • 0
Ograniczenie ilości wyświetlanych akcesorii.
« dnia: Sierpień 10, 2012, 01:45:49 pm »
witam,

Chce zmienić ilośc wyświetlanych zdjęć w produktach powiązanych czyli akcesoria.
W pliku product.tpl mam taki kod:
    <!-- accessories -->
{if isset($accessories) AND $accessories}
      <div class="accessories_block clearfix">
      <h6><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {l s='Accessories'} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></h6>
   <ul>
    {foreach from=$accessories item=accessory name=accessories_list}
  {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
   <li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
           {if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
            <p id="product_list_stuffs">
             <span class="new_product">
              <strong>{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</strong>
             </span>
            </p>
           {/if}
<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" /></a>
<h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:12:'...':true|escape:'htmlall':'UTF-8'}</a></h5>
   </li>
  {/foreach}
   </ul>
  </div>
{/if}

Co tutaj zmienić aby było ograniczenie do wyświetlania produktów na 14 oraz żeby je losowało?
Z góry dziękuję za pomoc.

*

Offline 1q2w3e4r

  • Tubylec
  • ****
  • 104
  • 0
Odp: Ograniczenie ilości wyświetlanych akcesorii.
« Odpowiedź #1 dnia: Sierpień 13, 2012, 03:09:02 pm »
Nikt nie wie jak to zrobić?

*

Offline dave666

  • Nowy
  • *
  • 3
  • 0
Odp: Ograniczenie ilości wyświetlanych akcesorii.
« Odpowiedź #2 dnia: Wrzesień 04, 2012, 11:21:22 pm »
 <!-- accessories -->
   {if isset($accessories) AND $accessories}
      <div class="accessories_block clearfix">
      <h6><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {l s='Accessories'} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></h6>
      <ul>
       {foreach from=$accessories item=accessory name=accessories_list}
        {assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}
         <li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">
           {if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
            <p id="product_list_stuffs">
             <span class="new_product">
              <strong>{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</strong>
             </span>
            </p>
           {/if}
         <a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" />[/url]
         <h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:12:'...':true|escape:'htmlall':'UTF-8'}[/url]</h5>
         </li>
            {if $smarty.foreach.accessories_list.index == 13}
        {break}
       {/if}
        {/foreach}
      </ul>
     </div>
   {/if}