Jump to content

how to use a feature value/name in the productpage


Recommended Posts

Hi guys,

I have a large quantity of products in my table.
for cables it is necessary they see immediatly the length and packed quantity (are both features).

so I changed the product detail page (first screenshot in yellow marked and blue 1)

but how can I do the same on the module productcategory.tpl.
look at screenshot blue 2, I now just set [length] so I want to add this there if excist.
the value is a fixed value = 7

I tried this in modules/productcategory/productcategory.tpl

{$categoryProduct.name|truncate:100:'...'|escape:'htmlall':'UTF-8'}
{foreach from=$features item=feature}
{if ($feature.id_feature=='7')}
[{$feature.value}]{/if} 
{/foreach}   



but this does not work??

any idea

25603_ybGcX81fNAbebGbHMXld_t

Link to comment
Share on other sites

hi mohsart,

I looked at your post, but it seems my category.php is different than yours :-)

I paste this in the product.tpl
{foreach from=$features item=feature}
{if ($feature.name=='Verpakt per:') || ($feature.name=='Lengte:')}

{$feature.name|escape:'htmlall':'UTF-8'}{$feature.value|escape:'htmlall':'UTF-8'}

{/if}
{/foreach}

and this is working fine on the product page.
but how to I get it in product-list, productcategory, features products?

any clue of push :-)
Link to comment
Share on other sites

It works in product.tpl because the variables have been passed from a php file.
This is not done by default to eg product-list.tpl so you must change the code in the corresponding php files.
It is all described by Rocky better than I can hope to do, in the thread I linked to, especially:
"You’ll need to modify the getProducts() function in classes/Category.php, classes/Manufacturer.php and classes/Supplier.php and add modify the SQL queries so that they get product features."
and
"You’ll need to modify the queries in the find function of classes/Search.php and the getNewProducts() and getRandomSpecial() functions in classes/Product.php."
was very helpful for me.

/Mats

Link to comment
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
×
×
  • Create New...