Turinio valdymo sistema

Prisijungimas partneriams
Jūsų slaptažodis

Dirbame su:










catalog

Mano valiuta: 
<a href="/index.php?cid={$system.cid}&amp;category_id={$smarty.get.category_id}&amp;set_currency=LTL">LTL</a>
<a href="/index.php?cid={$system.cid}&amp;category_id={$smarty.get.category_id}&amp;set_currency=USD">USD</a>
<a href="/index.php?cid={$system.cid}&amp;category_id={$smarty.get.category_id}&amp;set_currency=EUR">EUR</a>
{* Gaunamas kategoriju kelias ir irashomas i kintamaji $shop_path ir _shop->fullpath *}
{_shop->getCategoryPathFull category_id=$smarty.get.category_id assign="shop_path"}

{* nustatoma valiuta pagal nutylejima *}
{if $smarty.get.set_currency}
    {_shop->setCurrency currency=$smarty.get.set_currency}
{/if}

{* Gauname kelia iki dabartines kategorijos *}
{foreach from=$shop->fullpath item="el"}
   {$el}
<hr>
{/foreach}
<h1>Categories</h1>
{* Gauname pasirinktos kategorijos subkategorijas *}
{_shop->getSubCategories assign="categories"}

{foreach from=$categories item="el"}
   {if $shop_path[0].id == $el.id}
{* Jeigu kategorija yra pasirinkta pastoriname ja *}
      <b>{$el.name}</b><br>
   {else}
     
<a href="{$_http_path}/index.php?cid={$system.cid}&amp;category_id={$el.id}">{$el.name}</a><br>
   {/if}
{/foreach}
{if $shop_path[0].id} {* Jeigu esame antro lygio prekiu kategorijoje *}
<h1>Subcategories</h1>
{_shop->getSubCategories parent_id=$shop_path[0].id assign="categories"}
{foreach from=$categories item="el"}
   {if $shop_path[1].id == $el.id}

      <b>{$el.name}</b><br>
   {else}
      <a href="{$_http_path}/index.php?cid={$system.cid}&amp;category_id={$el.id}">{$el.name}</a><br>
   {/if}
{/foreach}
{if !$categories} {* Jeigu kategoriju nera isvedame kad nera *}
   <div>No subcategories</div>
{/if}
<h1>Prekės kategorijoje {$shop_path[0].name} {if $shop_path[1]}{$shop_path[1].name}{/if}</h1>
{* gauname nurodytos kategorijos prekių sąrašą, surūšiuota pagal kainą mažėjančia tvarka, su visais duomenim ir priskyria jį į kintamąjį $goods *}
{_shop->getProducts order="price" order_dir="desc" category_id=$smarty.get.category_id full_info=1 assign="goods" page_nr=$smarty.get.page_nr page_size="20"}
<table>
   <tr>
      <td>ID</td>
      <td>SKU</td>
      <td>Name</td>
      <td>Price</td>
      <td>discount_percent</td>
      <td>discount_absolute</td>
      <td>discount_target</td>
      <td></td>
   </tr>
   {foreach from=$goods key="product_id" item="el"}
   <tr>
      <td>{$product_id}</td>
      <td></td>
      <td>
      {if $template[0].name=="Televizoriai"} {išvedame parametrus priklausomai nuo kategorijos šablono}
         <b>{$el.Diagonal}</b>
      {elseif $template[0].name=="Dviraciai"}
         <b>{$el.name_lt}</b>¦
         <b>{$el.surname_lt}</b>
      {/if}
      </td>
      <td>{$el.price}</td>
      <td>{$el.currency}</td>
      <td>{$el.discount_percent}</td>
      <td>{$el.discount_absolute}</td>
      <td>{$el.discount_target}</td>
      <td>
         <a href="{$_http_path}/index.php?cid={$system.cid}&amp;action=shop.addProduct&amp;product_id={$product_id}&amp;scheme_id={$category.scheme_id}&amp;category_id={$smarty.get.category_id}">Add to cart</a>
      </td>
    </tr>
    {/foreach}
    <tr>
        <td>
        {* Gaunamas puslapiavimas *}
        {_shop->getPaging assign="_paging"}
        {foreach from=$_paging item=el}
            {if $el.selected==1}
                {if $el.from != $el.to}
                    <b>{$el.from}-{$el.to}</b>
                {else}
                    <b>{$el.from}</b>
                {/if}
           {else}
               {if $el.from!=$el.to}
                   <a href="/index.php?cid={$system.cid}&amp;scheme_id={$category.scheme_id}&amp;category_id={$smarty.get.category_id}&amp;page_nr={$el.page_nr}">{$el.from}-{$el.to}</a>
               {else}
                   <a href="/index.php?cid={$system.cid}&amp;scheme_id={$category.scheme_id}&amp;category_id={$smarty.get.category_id}&amp;page_nr={$el.page_nr}">{$el.from}</a>
               {/if}
           {/if}
        {/foreach}
    </td>
</tr>
</table>

   {if !$goods}
      <div>No products in this category</div>
   {/if}
{/if}
<hr>
Komentavimas:
<!-- Komentaru sarasas -->

{_shop->getComments product_id=100 comments_page_nr=$comments_page_nr assign="comments"}
{foreach from=$comments item="comment"}
<div>{format_date timestamp=$comment.time}</div>
<div>{$comment.content¦escape:'html'¦nl2br}</div>
<div>{$comment.name¦escape:'html'} {$comment.email}</div>
<br>
{/foreach}
<hr>
<!-- Komentaru puslapiavimas -->

{_shop->getCommentsPaging assign="_comments_paging"}
{foreach from=$_comments_paging item=el}
{if $el.comments_selected == 1}
{if $el.comments_from != $el.comments_to}
    <b>{$el.comments_from}-{$el.comments_to}</b>
  {else}
    <b>{$el.comments_from}</b>
  {/if}
{else}

  {if $el.comments_from!=$el.comments_to}
    <a href='{$_http_path}?cid={$system.cid}&new_id={$new.id}&comments_page_nr={$el.comments_page_nr}&page_nr={$page_nr}'>{$el.comments_from}-{$el.comments_to}</a>
  {else}
    <a href='{$_http_path}?cid={$system.cid}&new_id={$new.id}&comments_page_nr={$el.comments_page_nr}&page_nr={$page_nr}'>{$el.comments_from}</a>
  {/if}
{/if}
&nbsp;
{/foreach}

<hr>
<!-- Add comment form -->
{if $error[1]}
     <div style="color:red;">Įveskite komentarą!</div>
  {elseif $error[2]}
     <div style="color:red;">Įveskite savo vardą!</div>
  {elseif $error[3]}
     <div style="color:red;">Įveskite savo el. pašto adresą!</div>
  {elseif $error[4]}
     <div style="color:red;">Komentuoti gali tik prisijungęs vartotojas!</div>
{/if}
<hr>
<form action="{$_http_path}/index.php?cid={$_item_id}" method="POST">
<input type='hidden' name='action' value='shop.add_comment'>
<input type='hidden' name='product_id' value='100'>
<input type='hidden' name='page_nr' value='{$page_nr}'>
Vardas <input type='text' name='name' value=''><br>
El.pastas <input type='text' name='email' value=''><br>
<textarea name="content"></textarea><br>
<input class="formButton" type="Submit" value="Komentuoti">
</form>
 
<!-- Setting ratings to product -->
{* zemiau turima omeny kad yra pasirinktas kazkoks produktas $product_id *}
<form action="index.php?cid={$data.page.item_id}" method="post">
<input type="hidden" name="action" value="shop.setRating">
<input type="hidden" name="product_id" value="{$product_id}">
<div class="error">
{if $error[1]}<div>Nenustatytas balas</div>{/if}
{if $error[2]}
<div>Autorius nenurodytas</div>{/if}
{if $error[3]}
<div>Nenurodytas el. pasto adresas</div>{/if}
{if $error[4]}
<div>El. pasto adresas neteisingas</div>{/if}
{if $error[5]}
<div>Neirasytas butinas komentaras</div>{/if}
{if $error[6]}
<div>Reitinguoti prekes negalima</div>{/if}
{if $error[7]}<div>Nenurodytas produktas reitingavimui</div>{/if}
</div>
{_shop->getRatingsStats assign="ratingsStats" product_id=$product_id}
<div>Vidurkis: {$ratingsStats.avgAll}</div>
<div>Vidurkis aniniminiu balsu: {$ratingsStats.avgAnonymous}</div>
<div>Viso balsu: {$ratingsStats.countAll}</div>
<div>Is ju anoniminiu: {$ratingsStats.countAnonymous}</div>
<h3>Balsu komentarai:</h3>
{_shop->getRatingsComments assign="ratingsComments" product_id=$product_id}
{foreach from=$ratingsComments item="comment"}
<div>{$comment.content}</div>
<hr>
{/foreach}
{_shop->getRatingsList assign="ratingsList"}
{foreach from=$ratingsList key="rating" item="name"}
<input type="radio" name="rating" value="{$rating}"> {$name[$_lang_id]}
{/foreach}

<textarea name="content"></textarea>
<input type="submit">
</form>