mateusz.ragiel Posted January 31, 2017 Share Posted January 31, 2017 Witam. Chciałbym wyświetlić funkcje swojego produktu (waga, wymiary) pod nazwą produktu w widoku listy na stronie. Jak mogę to zrobić ? Link to comment Share on other sites More sharing options...
0 atomek Posted January 31, 2017 Share Posted January 31, 2017 (edited) spróbuj w ten sposób:1 do pliku product-list.tpl dodaj kod, po tagu <p class="product-desc" itemprop="description">: {* dodanie funkcji(cech/features) *} {assign var='productFeatures' value=Product::getFrontFeaturesStatic(Context::getContext()->language->id, $product.id_product)} {if count($productFeatures)} <div class="product-features"> <table> <tr> <th> {l s='Name'} </th> <th> {l s='Value'} </th> </tr> {foreach from=$productFeatures item=feature} <tr> <td> {$feature.name} </td> <td> {$feature.value} </td> </tr> {/foreach} </table> </div> {/if} { *end *} 2. w pliku global.js po: html += '<p class="product-desc">'+ $(element).find('.product-desc').html() + '</p>'; dodaj: html += '<div class="product-features">'+$(element).find('.product-features').html() + '</div>'; po: html += '<p itemprop="description" class="product-desc">'+ $(element).find('.product-desc').html() + '</p>'; dodaj: html += '<div class="product-features">'+ $(element).find('.product-features').html() + '</div>'; 3. w pliku product_list.css dodaj ul.product_list.grid > li .product-container .product-features { display: none; } Edited January 31, 2017 by atomek (see edit history) 1 Link to comment Share on other sites More sharing options...
0 mateusz.ragiel Posted February 1, 2017 Author Share Posted February 1, 2017 dzięki za pomoc, ale mam jeszcze jedno, podobne pytanie... jak wyświetlić funkcje w oknie szybkiego podglądu ? Link to comment Share on other sites More sharing options...
0 atomek Posted February 1, 2017 Share Posted February 1, 2017 w product.tpl, przed zamknięciem diva pb-center-column <div class="pb-center-column col-xs-12 col-sm-4"> ... ... ... ... ... {* wyświetlanie funkcji w oknie szybkiego podglądu *} {if $content_only} {if isset($features) && $features} <!-- Data sheet --> <section class="page-product-box"> <h3 class="page-product-heading">{l s='Data sheet'}</h3> <table class="table-data-sheet"> {foreach from=$features item=feature} <tr class="{cycle values="odd,even"}"> {if isset($feature.value)} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} </tr> {/foreach} </table> </section> <!--end Data sheet --> {/if} {/if} </div> 1 Link to comment Share on other sites More sharing options...
0 mateusz.ragiel Posted February 1, 2017 Author Share Posted February 1, 2017 w product.tpl, przed zamknięciem diva pb-center-column <div class="pb-center-column col-xs-12 col-sm-4"> ... ... ... ... ... {* wyświetlanie funkcji w oknie szybkiego podglądu *} {if $content_only} {if isset($features) && $features} <!-- Data sheet --> <section class="page-product-box"> <h3 class="page-product-heading">{l s='Data sheet'}</h3> <table class="table-data-sheet"> {foreach from=$features item=feature} <tr class="{cycle values="odd,even"}"> {if isset($feature.value)} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} </tr> {/foreach} </table> </section> <!--end Data sheet --> {/if} {/if} </div> niestety, nie działa Link to comment Share on other sites More sharing options...
0 atomek Posted February 1, 2017 Share Posted February 1, 2017 z jakiej wersji presty korzystasz, z jakiego szablonu, włączyłeś kompilacje, są jakieś komunikaty o błędach? Link to comment Share on other sites More sharing options...
0 mateusz.ragiel Posted February 7, 2017 Author Share Posted February 7, 2017 1.6.1.9 szablon domyślny, żadnych błędów nie zauważyłem Link to comment Share on other sites More sharing options...
0 atomek Posted February 8, 2017 Share Posted February 8, 2017 podmień z paczki product.tpl w Twoim szablonie, wymuś kompilacje product.zip Link to comment Share on other sites More sharing options...
Question
mateusz.ragiel
Witam. Chciałbym wyświetlić funkcje swojego produktu (waga, wymiary) pod nazwą produktu w widoku listy na stronie.
Jak mogę to zrobić ?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now