Jump to content

And63

Members
  • Posts

    267
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by And63

  1. W twojej templatce w pliku product.tpl jest kod odpowiedzialny za pobieranie zdjęć produktu:

    			<!-- product img-->
    			<div id="image-block" class="clearfix">
    				{if $product->new}
    					<span class="new-box">
    						<span class="new-label">{l s='New'}</span>
    					</span>
    				{/if}
    				{if $product->on_sale}
    					<span class="sale-box no-print">
    						<span class="sale-label">{l s='Sale!'}</span>
    					</span>
    				{elseif $product->specificPrice && $product->specificPrice.reduction && $productPriceWithoutReduction > $productPrice}
    					<span class="discount">{l s='Reduced price!'}</span>
    				{/if}
    				{if $have_image}
    					<span id="view_full_size">
    						{if $jqZoomEnabled && $have_image && !$content_only}
    							<a class="jqzoom" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" rel="gal1" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')|escape:'html':'UTF-8'}">
    								<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"/>
    							</a>
    						{else}
    							<img id="bigpic" itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" width="{$largeSize.width}" height="{$largeSize.height}"/>
    							{if !$content_only}
    								<span class="span_link no-print">{l s='View larger'}</span>
    							{/if}
    						{/if}
    					</span>
    				{else}
    					<span id="view_full_size">
    						<img itemprop="image" src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'html':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}"/>
    						{if !$content_only}
    							<span class="span_link">
    								{l s='View larger'}
    							</span>
    						{/if}
    					</span>
    				{/if}
    			</div> <!-- end image-block -->
    

    Trzeba zmodyfikować linki do zdjęcia :

    src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}"
    
  2. Hi - I have in my shop function grouped features. I create base features. If product don't have short descripition displayed are feeature from base group. This work ok.
    My code in product tpl. or productlist.tpl look this:

    {if $product.description_short|count_characters:true > 3}
    						{$product.description_short}
    					{else}
    						{if count($product.features_base)}
    						<ul class="features_baase">			
                                {foreach from=$product.features_base item=feature}
                                    
                                        {if isset($feature.value)}			    
                                            <span class="label">{$feature.name|escape:'html':'UTF-8'}:</span>
                                            <span class="value">{$feature.value|escape:'html':'UTF-8'}</span>
                                        {/if}
                                    </br>
                                {/foreach}
                            </ul>
    
    						{/if}
    
    					{/if} 

    How I can put this code to products catalog, or how add sql query to display only selected features. 

     

    In product controller i have added this function:

    $product_features_by_group = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
    				SELECT name, GROUP_CONCAT(value SEPARATOR \', \') AS value, pf.id_feature
    				FROM '._DB_PREFIX_.'feature_product pf
    				INNER JOIN '._DB_PREFIX_.'featurestogroups fg ON (fg.id_feature = pf.id_feature AND (fg.id_group = 30 OR fg.id_group = 31 OR fg.id_group = 32 OR fg.id_group = 33 OR fg.id_group = 43))
    				LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = 1)
    				LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = 1)
    				LEFT JOIN '._DB_PREFIX_.'feature f ON (f.id_feature = pf.id_feature AND fl.id_lang = 1)
    				LEFT JOIN ps_features_groups_categ fgc ON (fg.id_group = fgc.id_group)
                    LEFT JOIN ps_product p ON (pf.id_product = p.id_product)
    				WHERE pf.id_product = '.(int)$id_product.' AND (p.id_category_default = fgc.id_categ) 
            GROUP BY pf.id_feature
    				ORDER BY fg.position ASC')
    

    Can You help me?

  3. Działa, dzięki :)

    Co prawda nie tak jak sobie to wyobrażałem, tzn. zdjęcia nie wyświetlają się przy liście z okna szukaj, tylko na dole, tam gdzie standardowo są wyświetlane produkty. Plus taki że nie trzeba nawet entera wciskać, ale trzeba niestety wpisać całe słowo... szkoda że nie szuka już po fragmencie słowa.

     

    możesz podać adres strony?

    szukanie frazy wewnątrz słowa to już inna bajka :)

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More