stefanvidic Posted April 30, 2019 Share Posted April 30, 2019 Hteo sam da pitam, da li je možda neko pokušavao da linkuje "Product Feature" sa kategorijom? Pošto radim sa pićem bilo bi mi jako korisno da mogu na primer u opisu vina imam u feature npr. "Italija - Veneto" i da ovo i jedno i drugo bude linkovano sa kategorijom "Italija" i podkategorijom u okviru ove "Veneto". Pozdrav i hvala svima na pomoći. Link to comment Share on other sites More sharing options...
razaro Posted April 30, 2019 Share Posted April 30, 2019 Probaj sa sledećim kodom, malo na brzinu sam testirao. Bolje je rešenje da se doda kod u override/ProductController ali to može da se proba kasnije. U tvojoj temi u fajlu product.tpl nađi <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> i zameni ga sa <table class="table-data-sheet"> {foreach from=$features item=feature} <tr class="{cycle values="odd,even"}"> {if isset($feature.value)} {assign var="fname" value=Category::searchByName((int)Context::getContext()->language->id, $feature.name, true)} {if isset($fname) && $fname} <td><a class="feature-link" href="{$link->getCategoryLink($fname.id_category, $fname.link_rewrite)|escape:'html':'UTF-8'}">{$fname.name|escape:'html':'UTF-8'}</td> {assign var="fsub" value=Category::searchByName((int)Context::getContext()->language->id, $feature.value, true)} {if isset($fsub) && $fsub} <td><a class="feature-link" href="{$link->getCategoryLink($fsub.id_category, $fsub.link_rewrite)|escape:'html':'UTF-8'}">{$fsub.name|escape:'html':'UTF-8'}</td> {else} <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} {else} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} {/if} </tr> {/foreach} </table> Dakle potrebno je ta se potpuno poklapa ime kategorije i ime grupe funkcije proizvode npr. Italija. Vrednost funkcije može da bude bilo koji tekst ali takođe može biti i pod-kategorija ako se ime potpuno poklapa. Posle izmene obriši PrestaShop keš. Link to comment Share on other sites More sharing options...
stefanvidic Posted May 3, 2019 Author Share Posted May 3, 2019 Pozdrav. To je to, radi savršeno. Svaka čast i još jednom veliko hvala na pomoći! Link to comment Share on other sites More sharing options...
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