Jump to content
stefanvidic

Postavljanje linka ka kategoriji u "Product Feature" 1.6.1.23

Recommended Posts

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.

Untitled-1.jpg.773277dd39ca1cd5d121a4e5624a14a4.jpg

kat link.png

Ненасловљено.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Pozdrav. To je to, radi savršeno. Svaka čast i još jednom veliko hvala na pomoći!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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