Jump to content

Postavljanje linka ka kategoriji u "Product Feature" 1.6.1.23


stefanvidic
 Share

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

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
 Share

×
×
  • Create New...

Important Information

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