genny_ruos Posted May 25, 2012 Share Posted May 25, 2012 Hello, the products and combination prices set by default are displayed in the product-list.tpl. It's a possible show a description of the combinations set Like Color - Black, Disk space - 16GB. The value $product.id_product_attribute is available. I can get the descriptions? For examples, in the product.tpl, attributes are displayed in a select statement: {if isset($groups)} <!-- attributes --> <div id="attributes"> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <p> <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var="groupName" value="group_$id_attribute_group"} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> </p> {/if} {/foreach} </div> {/if} Thanks a lot. See soon. Link to comment Share on other sites More sharing options...
genny_ruos Posted May 28, 2012 Author Share Posted May 28, 2012 help!!!! Link to comment Share on other sites More sharing options...
genny_ruos Posted May 29, 2012 Author Share Posted May 29, 2012 No one? Link to comment Share on other sites More sharing options...
codegrunt Posted May 29, 2012 Share Posted May 29, 2012 (edited) You can always toss a "{debug}" into any template to trigger Smarty's debug function which will normally show you what variables and objects are available at the current scope. I am pretty sure that the details you want are not present in the product data at the category listing stage as combinations and such are not normally generated until you get to the product detail page. The big issue is that combinations can be resource intensive so historically, Prestashop has tried to avoid them until the customer has drilled down to a single product. It is not impossible to add them at the category stage but you can't do it via the template alone, it would have to be done either via a module that triggers on something like the "productListAssign" hook or by overriding CategoryController::productListAssign() with a custom version (there may be other methods that suit your needs better, that was just the first one I saw). Either way you would then assign the extra details to Smarty for use in your custom template. Cheers Edited May 29, 2012 by codegrunt (see edit history) 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