Jump to content
  • 0

Wyśiwetlanie Cen Netto I Brutto Prestashop 1.6.1.1


ArturRother

Question

Witam serdecznie. Mam problem. 
Znalazłem na forum rozwiązanie do poprzednich wersji prestashop, ale po wprowadzeniu modyfikacji kodów nic sie u mnie nie zmienia.

Chciałbym aby na stronie głównej pojawiła sie cena netto i butto oraz w karcie produktu i w koszyku.

Mam zakupiony szablon i kody o których wyczytałem na forum sa inne niz te w moich plikach product.tpl oraz product-list.tpl

dodaję dwa załączniki tych plików. Będę wdzięczny za pomoc.

Znalazłem ten temat gdzie użytkownik Vekia pisał jak to rozwiązać na wersji 1.5 xxx starałem sie wykonać to samo na moich plikach, ale niestety moje kompetencje sie wyczerpały.

Pozdrawiam

PRODUCT.TPL

{if $tonytheme.product_page_right_column}
    {capture assign=HOOK_RIGHT_COLUMN_PRODUCT}{hook h="displayRightColumnProduct"}{/capture}
{/if}
{include file="$tpl_dir./errors.tpl"}
{if $errors|@count == 0}
    {hook h='displayProductNavigation'}
    <!-- Product -->
    {if !isset($priceDisplayPrecision)}
        {assign var='priceDisplayPrecision' value=2}
    {/if}
    {if !$priceDisplay || $priceDisplay == 2}
        {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
        {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
    {elseif $priceDisplay == 1}
        {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
        {assign var='productPriceWithoutReduction' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
    {/if}
    <section class="container">
        <!-- Product view -->
        <div class="product-view row" itemscope itemtype="http://schema.org/Product">
            <div class="{if (!(isset($content_only) && $content_only)) && $tonytheme.product_page_right_column && $HOOK_RIGHT_COLUMN_PRODUCT}col-sm-6 col-md-5 col-lg-5{else}col-sm-6 col-md-6 col-lg-6{/if}">
                {if $have_image}
                    <div class="large-image">
                        <a id="image-zoom" style="width: 455px;" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'tonytheme_zoom_product')|escape:'html':'UTF-8'}" class="cloud-zoom" rel="adjustX:10, adjustY:-4">
                            <img alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'tonytheme_large_product')|escape:'html':'UTF-8'}">
                        </a>
                    </div>
                    {if isset($images)}
                        <div class="flexslider flexslider-thumb">
                            <ul class="previews-list slides">
                                {foreach from=$images item=image name=thumbnails}
                                    {assign var=imageIds value="`$product->id`-`$image.id_image`"}
                                    {if !empty($image.legend)}
                                        {assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
                                    {else}
                                        {assign var=imageTitle value=$product->name|escape:'html':'UTF-8'}
                                    {/if}
                                    <li{if $smarty.foreach.thumbnails.last} class="last"{/if}>
                                        <a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'tonytheme_zoom_product')|escape:'html':'UTF-8'}" class="cloud-zoom-gallery" rel="useZoom: 'image-zoom', smallImage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'tonytheme_large_product')|escape:'html':'UTF-8'}'">
                                            <img alt="{$imageTitle}" title="{$imageTitle}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'tonytheme_large_product')|escape:'html':'UTF-8'}">
                                        </a>
                                    </li>
                                {/foreach}
                                {hook h="displayProductGallerySlides"}
                            </ul>
                        </div>
                    {/if}
                {/if}
                {if !$content_only}
                    <!-- usefull links-->
                    <ul id="usefull_link_block" class="clearfix no-print">
                        {if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
                    </ul>
                {/if}
            </div>
            <div class="{if (!(isset($content_only) && $content_only)) && $tonytheme.product_page_right_column && $HOOK_RIGHT_COLUMN_PRODUCT}col-sm-6 col-md-4 col-lg-4{else}col-sm-6 col-md-6 col-lg-6{/if}">
                {if isset($confirmation) && $confirmation}
                    <p class="confirmation">
                        {$confirmation}
                    </p>
                {/if}
                {include file="./product-price.tpl" product=$product restricted_country_mode=$restricted_country_mode priceDisplay=$priceDisplay productPrice=$productPrice productPriceWithoutReduction=$productPriceWithoutReduction unit_price=$unit_price currency=$currency group_reduction=$group_reduction tax_enabled=$tax_enabled display_tax_label=$display_tax_label ecotax_tax_exc=$ecotax_tax_exc ecotax_tax_inc=$ecotax_tax_inc packItems=$packItems}
                <!-- Description -->
                <div class="product-description">
                    {if ($product->reference && !isset($groups)) || $product->online_only || $product->condition}
                        <p>
                            {if $product->reference && !isset($groups)}
                                <span class="reference label label-default"
                                      itemprop="sku">{$product->reference|escape:'html':'UTF-8'}</span>
                            {/if}
                            {if $product->online_only}
                                <span class="online_only label label-mega">{l s='Online only'}</span>
                            {/if}
                            {if $product->condition}
                                {if $product->condition == 'new'}
                                    <link itemprop="itemCondition" href="http://schema.org/NewCondition"/>
                                    <span class="label label-mega">{l s='New'}</span>
                                {elseif $product->condition == 'used'}
                                    <link itemprop="itemCondition" href="http://schema.org/UsedCondition"/>
                                    <span class="label label-mega">{l s='Used'}</span>
                                {elseif $product->condition == 'refurbished'}
                                    <link itemprop="itemCondition" href="http://schema.org/RefurbishedCondition"/>
                                    <span class="label label-mega">{l s='Refurbished'}</span>
                                {/if}
                            {/if}
                        </p>
                    {/if}
                    <!-- Out of stock hook -->
                    <div id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>
                        {$HOOK_PRODUCT_OOS}
                    </div>
                    {if ($product->show_price && !isset($restricted_country_mode)) || isset($groups) || $product->reference || (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
                        <!-- Add to cart form-->
                        <form id="buy_block"{if $PS_CATALOG_MODE && !isset($groups) && $product->quantity > 0} class="hidden"{/if}
                              action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}" method="post" target="_parent">
                            <input type="hidden" name="token" value="{$static_token}"/>
                            <input type="hidden" name="id_product" value="{$product->id|intval}"
                                   id="product_page_product_id"/>
                            <input type="hidden" name="add" value="1"/>
                            <input type="hidden" name="id_product_attribute" id="idCombination" value=""/>

                            <!-- Minimal quantity wanted -->
                            <p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
                                {l s='This product is not sold individually. You must select at least'} <b
                                        id="minimal_quantity_label">{$product->minimal_quantity}</b> {l s='quantity for this product.'}
                            </p>
                            <!-- /Minimal quantity wanted -->

                            <div class="box-info-product">
                                {if isset($groups)}
                                    <!-- Attributes -->
                                    <div id="attributes" class="row product_attributes clearfix">
                                        {foreach from=$groups key=id_attribute_group item=group}
                                            {if $group.attributes|@count}
                                                <div class="col-lg-6">
                                                    <strong>{$group.name|escape:'html':'UTF-8'}</strong>
                                                    {assign var="groupName" value="group_$id_attribute_group"}
                                                    <div class="product-options">
                                                        {if ($group.group_type == 'select')}
                                                            <select name="{$groupName}"
                                                                    id="group_{$id_attribute_group|intval}"
                                                                    class="form-control attribute_select no-print">
                                                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                                                    <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if}
                                                                            title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
                                                                {/foreach}
                                                            </select>
                                                        {elseif ($group.group_type == 'color')}
                                                            {assign var="default_colorpicker" value=""}
                                                            <ul id="color_to_pick_list">
                                                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                                                    <li>
                                                                        {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
                                                                        <a id="color_{$id_attribute|intval}"
                                                                           name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"
                                                                           href="{$link->getProductLink($product)|escape:'html':'UTF-8'}"
                                                                           class="color_pick icon icon-color{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if}
                                                                           title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"
                                                                           data-href="{$img_col_dir}{$id_attribute|intval}.jpg"></a>
                                                                        {if ($group.default == $id_attribute)}
                                                                            {$default_colorpicker = $id_attribute}
                                                                        {/if}
                                                                    </li>
                                                                {/foreach}
                                                            </ul>
                                                            <input type="hidden" class="color_pick_hidden"
                                                                   name="{$groupName|escape:'html':'UTF-8'}"
                                                                   value="{$default_colorpicker|intval}"/>
                                                        {elseif ($group.group_type == 'radio')}
                                                            <div class="radio_input_list">
                                                                {foreach from=$group.attributes key=id_attribute item=group_attribute}
                                                                    <a id="radio_input_{$id_attribute|intval}" href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" class="icon icon-size{if ($group.default == $id_attribute)} selected{/if}">
                                                                        {$group_attribute|escape:'html':'UTF-8'}
                                                                    </a>
                                                                    {if ($group.default == $id_attribute)}
                                                                        {$default_radio_input = $id_attribute}
                                                                    {/if}
                                                                {/foreach}
                                                            </div>
                                                            <input type="hidden" class="radio_input_hidden"
                                                                   name="{$groupName|escape:'html':'UTF-8'}"
                                                                   value="{$default_radio_input}"/>
                                                        {/if}
                                                    </div>
                                                </div>
                                            {/if}
                                        {/foreach}
                                    </div>
                                    <br>
                                {/if}
                                <div class="row">
                                    {if (!(!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE)}
                                        <div class="col-sm-12 col-md-12 col-lg-12 product-quantity-control">
                                            <div class="option"><b>Ilość:</b>
                                                <div class="input-group quantity-control"><span
                                                            data-field-qty="qty" class="input-group-addon product_quantity_down">−</span>
                                                    <input name="qty" id="quantity_wanted" type="text"
                                                           class="form-control"
                                                           value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}">
                                                    <span data-field-qty="qty" class="input-group-addon product_quantity_up">+</span>
                                                </div>
                                            </div>
                                            <div class="clearfix visible-xs"></div>
                                            <button class="btn btn-mega btn-lg" name="Submit"
                                                    type="submit">{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</button>
                                        </div>
                                    {/if}
                                    <div class="col-sm-12 col-md-12 col-lg-12 product-action">
                                        {if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
                                    </div>
                                </div>
                            </div>
                        </form>
                    {/if}
                    {if $tonytheme.product_page_tabs_layout == 'accordion'}
                        <div class="panel-group accordion-simple" id="product-accordion">
                            {if $product->description}
                                <div class="panel">
                                    <div class="panel-heading">
                                        <a data-toggle="collapse" data-parent="#product-accordion"
                                           href="#product-description" class="collapsed">
                                            <span class="arrow-down icon-arrow-down-4"></span>
                                            <span class="arrow-up icon-arrow-up-4"></span> {l s='Description'}
                                        </a>
                                    </div>
                                    <div id="product-description" class="panel-collapse collapse">
                                        <div class="panel-body">
                                            {$product->description}
                                        </div>
                                    </div>
                                </div>
                            {/if}
                            {if isset($features) && $features}
                                <!-- Data sheet -->
                                <div class="panel">
                                    <div class="panel-heading">
                                        <a data-toggle="collapse" data-parent="#product-accordion"
                                           href="#product-data-sheet" class="collapsed">
                                            <span class="arrow-down icon-arrow-down-4"></span>
                                            <span class="arrow-up icon-arrow-up-4"></span> {l s='Data sheet'}
                                        </a>
                                    </div>
                                    <div id="product-data-sheet" class="panel-collapse collapse">
                                        <div class="panel-body">
                                            <ul>
                                                {foreach from=$features item=feature}
                                                    <li class="{cycle values="odd,even"}">
                                                        <span>{$feature.name|escape:'html':'UTF-8'}: </span>
                                                        {if isset($feature.value)}
                                                            <span>{$feature.value|escape:'html':'UTF-8'}</span>
                                                        {/if}
                                                    </li>
                                                {/foreach}
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                                <!-- /Data sheet -->
                            {/if}
                            {if isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB}
                                <!-- HOOK_PRODUCT_TAB -->
                                <div class="panel">
                                    <div class="panel-heading">
                                        {$HOOK_PRODUCT_TAB}
                                    </div>
                                    {if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
                                </div>
                                <!-- /HOOK_PRODUCT_TAB -->
                            {/if}
                        </div>
                    {/if}
                </div>
                <!-- /Description -->
            </div>
            {if (!(isset($content_only) && $content_only)) && $tonytheme.product_page_right_column && $HOOK_RIGHT_COLUMN_PRODUCT}
                <section class="content-product-right col-sm-12 col-md-3 col-lg-3 module">
                    {$HOOK_RIGHT_COLUMN_PRODUCT}
                </section>
            {/if}
        </div>
        <!-- /Product view -->
            {if $tonytheme.product_page_tabs_layout == 'tabs' && ($product->description || (isset($features) && $features) || (isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB))}
            <!-- Product Tabs -->
            <section class="producttab">
                <div class="tabsslider visible-xs">
                    <ul class="nav nav-tabs">
                        {if $product->description}
                            <li class="active">
                                <a data-toggle="tab" href="#tab1">{l s='Description'}</a>
                            </li>
                        {/if}
                        {if isset($features) && $features}
                            <li><a data-toggle="tab" href="#tab2">{l s='Data sheet'}</a></li>
                        {/if}
                        {if isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB}
                            <!-- HOOK_PRODUCT_TAB -->
                            {$HOOK_PRODUCT_TAB}
                            <!-- /HOOK_PRODUCT_TAB -->
                        {/if}
                    </ul>
                    <a href="#" class="carousel-prev"></a><a href="#" class="carousel-next"></a>
                </div>
                <div class="tabs-left">
                    <ul class="nav nav-tabs hidden-xs">
                        {if $product->description}
                            <li class="active"><a data-toggle="tab" href="#tab1">{l s='Description'}</a></li>
                        {/if}
                        {if isset($features) && $features}
                            <li><a data-toggle="tab" href="#tab2">{l s='Data sheet'}</a></li>
                        {/if}
                        {if isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB}
                            <!-- HOOK_PRODUCT_TAB -->
                            {$HOOK_PRODUCT_TAB}
                            <!-- /HOOK_PRODUCT_TAB -->
                        {/if}
                    </ul>
                    <div class="tab-content-outer">
                        <div class="tab-content">
                            {if $product->description}
                                <div id="tab1" class="tab-pane fade active in">
                                    {$product->description}
                                </div>
                            {/if}
                            {if isset($features) && $features}
                                <div id="tab2" class="tab-pane fade">
                                    <ul>
                                        {foreach from=$features item=feature}
                                            <li class="{cycle values="odd,even"}">
                                                <span>{$feature.name|escape:'html':'UTF-8'}: </span>
                                                {if isset($feature.value)}
                                                    <span>{$feature.value|escape:'html':'UTF-8'}</span>
                                                {/if}
                                            </li>
                                        {/foreach}
                                    </ul>
                                </div>
                            {/if}
                            {if isset($HOOK_PRODUCT_TAB) && $HOOK_PRODUCT_TAB}
                                <!-- HOOK_PRODUCT_TAB -->
                                {if isset($HOOK_PRODUCT_TAB_CONTENT) && $HOOK_PRODUCT_TAB_CONTENT}{$HOOK_PRODUCT_TAB_CONTENT}{/if}
                                <!-- /HOOK_PRODUCT_TAB -->
                            {/if}
                        </div>
                    </div>
                </div>
            </section>
            <!-- /Product Tabs -->
        {/if}
        {if !isset($content_only) || !$content_only}
            {if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if}
        {/if}
    </section>
    {strip}
        {if isset($smarty.get.ad) && $smarty.get.ad}
            {addJsDefL name=ad}{$base_dir|cat:$smarty.get.ad|escape:'html':'UTF-8'}{/addJsDefL}
        {/if}
        {if isset($smarty.get.adtoken) && $smarty.get.adtoken}
            {addJsDefL name=adtoken}{$smarty.get.adtoken|escape:'html':'UTF-8'}{/addJsDefL}
        {/if}
        {addJsDef allowBuyWhenOutOfStock=$allow_oosp|boolval}
        {addJsDef availableNowValue=$product->available_now|escape:'quotes':'UTF-8'}
        {addJsDef availableLaterValue=$product->available_later|escape:'quotes':'UTF-8'}
        {addJsDef attribute_anchor_separator=$attribute_anchor_separator|escape:'quotes':'UTF-8'}
        {addJsDef attributesCombinations=$attributesCombinations}
        {addJsDef currencySign=$currencySign|html_entity_decode:2:"UTF-8"}
        {addJsDef currencyRate=$currencyRate|floatval}
        {addJsDef currencyFormat=$currencyFormat|intval}
        {addJsDef currencyBlank=$currencyBlank|intval}
        {addJsDef currentDate=$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}
        {if isset($combinations) && $combinations}
            {addJsDef combinations=$combinations}
            {addJsDef combinationsFromController=$combinations}
            {addJsDef displayDiscountPrice=$display_discount_price}
            {addJsDefL name='upToTxt'}{l s='Up to' js=1}{/addJsDefL}
        {/if}
        {if isset($combinationImages) && $combinationImages}
            {addJsDef combinationImages=$combinationImages}
        {/if}
        {addJsDef customizationFields=$customizationFields}
        {addJsDef default_eco_tax=$product->ecotax|floatval}
        {addJsDef displayPrice=$priceDisplay|intval}
        {addJsDef ecotaxTax_rate=$ecotaxTax_rate|floatval}
        {addJsDef group_reduction=$group_reduction}
        {if isset($cover.id_image_only)}
            {addJsDef idDefaultImage=$cover.id_image_only|intval}
        {else}
            {addJsDef idDefaultImage=0}
        {/if}
        {addJsDef img_ps_dir=$img_ps_dir}
        {addJsDef img_prod_dir=$img_prod_dir}
        {addJsDef id_product=$product->id|intval}
        {addJsDef jqZoomEnabled=$jqZoomEnabled|boolval}
        {addJsDef maxQuantityToAllowDisplayOfLastQuantityMessage=$last_qties|intval}
        {addJsDef minimalQuantity=$product->minimal_quantity|intval}
        {addJsDef noTaxForThisProduct=$no_tax|boolval}
        {addJsDef customerGroupWithoutTax=$customer_group_without_tax|boolval}
        {addJsDef oosHookJsCodeFunctions=Array()}
        {addJsDef productHasAttributes=isset($groups)|boolval}
        {addJsDef productPriceTaxExcluded=($product->getPriceWithoutReduct(true)|default:'null' - $product->ecotax)|floatval}
        {addJsDef productBasePriceTaxExcluded=($product->base_price - $product->ecotax)|floatval}
        {addJsDef productBasePriceTaxExcl=($product->base_price|floatval)}
        {addJsDef productReference=$product->reference|escape:'html':'UTF-8'}
        {addJsDef productAvailableForOrder=$product->available_for_order|boolval}
        {addJsDef productPriceWithoutReduction=$productPriceWithoutReduction|floatval}
        {addJsDef productPrice=$productPrice|floatval}
        {addJsDef productUnitPriceRatio=$product->unit_price_ratio|floatval}
        {addJsDef productShowPrice=(!$PS_CATALOG_MODE && $product->show_price)|boolval}
        {addJsDef PS_CATALOG_MODE=$PS_CATALOG_MODE}
        {if $product->specificPrice && $product->specificPrice|@count}
            {addJsDef product_specific_price=$product->specificPrice}
        {else}
            {addJsDef product_specific_price=array()}
        {/if}
        {if $display_qties == 1 && $product->quantity}
            {addJsDef quantityAvailable=$product->quantity}
        {else}
            {addJsDef quantityAvailable=0}
        {/if}
        {addJsDef quantitiesDisplayAllowed=$display_qties|boolval}
        {if $product->specificPrice && $product->specificPrice.reduction && $product->specificPrice.reduction_type == 'percentage'}
            {addJsDef reduction_percent=$product->specificPrice.reduction*100|floatval}
        {else}
            {addJsDef reduction_percent=0}
        {/if}
        {if $product->specificPrice && $product->specificPrice.reduction && $product->specificPrice.reduction_type == 'amount'}
            {addJsDef reduction_price=$product->specificPrice.reduction|floatval}
        {else}
            {addJsDef reduction_price=0}
        {/if}
        {if $product->specificPrice && $product->specificPrice.price}
            {addJsDef specific_price=$product->specificPrice.price|floatval}
        {else}
            {addJsDef specific_price=0}
        {/if}
        {addJsDef specific_currency=($product->specificPrice && $product->specificPrice.id_currency)|boolval}
        {addJsDef stock_management=$stock_management|intval}
        {addJsDef taxRate=$tax_rate|floatval}
        {addJsDefL name=doesntExist}{l s='This combination does not exist for this product. Please select another combination.' js=1}{/addJsDefL}
        {addJsDefL name=doesntExistNoMore}{l s='This product is no longer in stock' js=1}{/addJsDefL}
        {addJsDefL name=doesntExistNoMoreBut}{l s='with those attributes but is available with others.' js=1}{/addJsDefL}
        {addJsDefL name=fieldRequired}{l s='Please fill in all the required fields before saving your customization.' js=1}{/addJsDefL}
        {addJsDefL name=uploading_in_progress}{l s='Uploading in progress, please be patient.' js=1}{/addJsDefL}
        {addJsDefL name='product_fileDefaultHtml'}{l s='No file selected' js=1}{/addJsDefL}
        {addJsDefL name='product_fileButtonHtml'}{l s='Choose File' js=1}{/addJsDefL}
    {/strip}
{/if}

oraz plik PRODUCT-LIST.TPL

 

{if isset($products) && $products}
    {*define numbers of product per line in other page for desktop*}
    {if $page_name !='index' && $page_name !='product'}
        {assign var='nbItemsPerLine' value=3}
        {assign var='nbItemsPerLineTablet' value=2}
        {assign var='nbItemsPerLineMobile' value=3}
    {else}
        {assign var='nbItemsPerLine' value=4}
        {assign var='nbItemsPerLineTablet' value=3}
        {assign var='nbItemsPerLineMobile' value=2}
    {/if}
    {*define numbers of product per line in other page for tablet*}
    {assign var='nbLi' value=$products|@count}
    {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
    {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet}
    <!-- Listing products -->
    <div{if isset($id) && $id} id="{$id}"{/if} class="products-list products-list-small grid row{if isset($class) && $class} {$class}{/if}">
        {foreach from=$products item=product name=products}
            {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo}
            {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet}
            {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile}
            {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if}
            {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if}
            {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if}
            <div class="product-preview{if $smarty.foreach.products.last} last{/if}">
                <div class="preview animate scale{if $tonytheme.product_hover_effect=='slide' && $product.images|@count > 1} hover-slide{/if}">
                    {*<div id="fancybox-loading">
                        <div></div>
                    </div>*}
                    <a href="{$product.link|escape:'html':'UTF-8'}" class="preview-image">
                        <img class="img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'tonytheme_default_product_listing')|escape:'html':'UTF-8'}" width="270" height="328" alt="">
                        {if $tonytheme.product_hover_effect=='slide' && $product.images|@count > 1}
                            <img class="img-responsive"
                                 src="{$link->getImageLink($product.link_rewrite, $product.id_image_hover, 'tonytheme_default_product_listing')|escape:html}"
                                 alt="{$product.name|escape:html:'UTF-8'}">
                        {/if}
                    </a>
                    {if $product.new}
                        <ul class="product-controls-list">
                            <li><span class="label label-new">{l s='New'}</span></li>
                        </ul>
                    {/if}
                    {if $product.on_sale && $product.orderprice > 0 && ($product.orderprice|round:2)!=$product.price_tax_exc}
                        <ul class="product-controls-list right">
                            <li><span class="label label-sale">{l s='Sale'}</span></li>
                        </ul>
                    {/if}
                    <ul class="product-controls-list right hide-right">
                        <li class="top-out-small"></li>
                        <li class="visible-desktop visible-xs"><a id="wishlist-btn" href="#" onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', false, 1); return false;" class="addToWishlist circle" title="{l s='Add to wishlist'}"><span class="icon-heart"></span></a></li>
                        {if isset($comparator_max_item) && $comparator_max_item}
                            <li><a href="{$product.link|escape:'html':'UTF-8'}" class="add_to_compare circle" data-id-product="{$product.id_product}" title="{l s='Add to Compare'}"><span class="icon-justice"></span></a></li>
                        {/if}
                        {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
                            {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
                                <li>
                                    {if isset($static_token)}
                                        <a href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" class="cart ajax_add_to_cart_button" data-id-product="{$product.id_product|intval}" title="{l s='Add to cart'}"><span class="icon-basket"></span></a>
                                    {else}
                                        <a href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$product.id_product|intval}', false)|escape:'html':'UTF-8'}" class="cart ajax_add_to_cart_button" data-id-product="{$product.id_product|intval}" title="{l s='Add to cart'}"><span class="icon-basket"></span></a>
                                    {/if}
                                </li>
                            {/if}
                        {/if}
                    </ul>
                    <a href="#" rel="{$product.link|escape:'html':'UTF-8'}" class="quick-view visible-desktop">
                        {if isset($product.rating) && $product.rating > 0}
                            <span class="rating">
                                {section name="i" start=0 loop=5 step=1}
                                    {if $product.rating le $smarty.section.i.index}
                                        <i class="icon-star-empty"></i>
                                    {else}
                                        <i class="icon-star-3"></i>
                                    {/if}
                                {/section}
                            </span>
                        {else}
                            <span class="icon-zoom-in-2"></span>
                            {l s='Quick View'}
                        {/if}
                    </a>
                </div>
                <h3 class="title" itemprop="name">
                    <a href="{$product.link|escape:'html':'UTF-8'}" class="preview-image" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '} {/if}{$product.name|truncate:45:'...'|escape:'html':'UTF-8'}</a>
                </h3>
                {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
                    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="list_offer">
                        {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
                            <meta itemprop="priceCurrency" content="{$currency->iso_code}"/>
                            {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
                                {hook h="displayProductPriceBlock" product=$product type="old_price"}
                                <span class="price old">
                                    {displayWtPrice p=$product.price_without_reduction}
                                </span>
                            {/if}
                            <span itemprop="price" class="price{if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0} new{/if}">
                                {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
                            </span>
                            {hook h="displayProductPriceBlock" product=$product type="price"}
                            {hook h="displayProductPriceBlock" product=$product type="unit_price"}
                        {/if}
                    </div>
                {/if}
                {if isset($product.rating) && $product.rating > 0}
                    <!-- Rating-->
                    <div class="list_rating">
                        <span class="rating">
                            {section name="i" start=0 loop=5 step=1}
                                {if $product.rating le $smarty.section.i.index}
                                    <i class="icon-star-empty"></i>
                                {else}
                                    <i class="icon-star-3"></i>
                                {/if}
                            {/section}
                        </span>
                    </div>
                    <!-- /Rating-->
                {/if}
                {*{hook h='displayProductListReviews' product=$product}*}
                {if $product.description_short}
                    <!--description-->
                    <div class="list_description" itemprop="description">
                        {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
                    </div>
                {/if}
                {if $page_name != 'index'}
                    <!--buttons-->
                    <div class="list_buttons">
                        {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
                            {if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
                                {if isset($static_token)}
                                    <a class="btn btn-mega pull-left ajax_add_to_cart_button" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">{l s='Add to cart'}</a>
                                {else}
                                    <a class="btn btn-mega pull-left ajax_add_to_cart_button" href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$product.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">{l s='Add to cart'}</a>
                                {/if}
                            {/if}
                        {/if}
                        <div class="add-to-links">
                            <ul>
                                {hook h='displayProductListFunctionalButtons' product=$product}
                                {if isset($comparator_max_item) && $comparator_max_item}
                                    <li>
                                        <a href="{$product.link|escape:'html':'UTF-8'}" class="add_to_compare" data-id-product="{$product.id_product}"><i class="icon-justice"></i> {l s='Add to Compare'}</a>
                                    </li>
                                {/if}
                            </ul>
                        </div>
                    </div>
                {/if}
                {*{hook h="displayProductDeliveryTime" product=$product}
                {hook h="displayProductPriceBlock" product=$product type="weight"}*}
            </div>
        {/foreach}
    </div>
    <!-- /Listing products -->
{/if}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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