deech123 Posted June 19, 2010 Share Posted June 19, 2010 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 = 7I 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 Link to comment Share on other sites More sharing options...
mohsart Posted June 19, 2010 Share Posted June 19, 2010 I would guess that the feature variables aren't available in that tpl file.Take a look here http://www.prestashop.com/forums/viewthread/57670/development/solved_variable_availability for a solution if that is the case/Mats Link to comment Share on other sites More sharing options...
deech123 Posted June 20, 2010 Author Share Posted June 20, 2010 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 More sharing options...
mohsart Posted June 20, 2010 Share Posted June 20, 2010 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 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