dennisv1 Posted August 31, 2014 Share Posted August 31, 2014 Hello, I want to display column with the attribute reference on the quantities tab at the product page in the backend. I added a picture to show what I mean. Can someone help me to make it. Link to comment Share on other sites More sharing options...
vekia Posted August 31, 2014 Share Posted August 31, 2014 open file: adminXXXX/themes/default/controllers/products/quantities.tpl there is a code: <table class="table"> <thead> <tr> <th><span class="title_box">{l s='Quantity'}</span></th> <th><span class="title_box">{l s='Designation'}</span></th> </tr> </thead> {foreach from=$attributes item=attribute} <tr> <td class="available_quantity" id="qty_{$attribute['id_product_attribute']}"> <span>{$available_quantity[$attribute['id_product_attribute']]}</span> <input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/> </td> <td>{$product_designation[$attribute['id_product_attribute']]}</td> </tr> {/foreach} </table> modify it to: <table class="table"> <thead> <tr> <th><span class="title_box">{l s='Quantity'}</span></th> <th><span class="title_box">{l s='Reference'}</span></th> <th><span class="title_box">{l s='Designation'}</span></th> </tr> </thead> {foreach from=$attributes item=attribute} <tr> <td class="available_quantity" id="qty_{$attribute['id_product_attribute']}"> <span>{$available_quantity[$attribute['id_product_attribute']]}</span> <input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/> </td> <td>{$attribute['reference']}</td> <td>{$product_designation[$attribute['id_product_attribute']]}</td> </tr> {/foreach} </table> 1 Link to comment Share on other sites More sharing options...
dennisv1 Posted August 31, 2014 Author Share Posted August 31, 2014 Thanks alot! It worked. Link to comment Share on other sites More sharing options...
vekia Posted August 31, 2014 Share Posted August 31, 2014 you're welcome glad to hear that i could help a little i marked topic title as solved with regards, Milos Link to comment Share on other sites More sharing options...
editorstefan Posted October 6, 2016 Share Posted October 6, 2016 (edited) open file: adminXXXX/themes/default/controllers/products/quantities.tpl there is a code: <table class="table"> <thead> <tr> <th><span class="title_box">{l s='Quantity'}</span></th> <th><span class="title_box">{l s='Designation'}</span></th> </tr> </thead> {foreach from=$attributes item=attribute} <tr> <td class="available_quantity" id="qty_{$attribute['id_product_attribute']}"> <span>{$available_quantity[$attribute['id_product_attribute']]}</span> <input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/> </td> <td>{$product_designation[$attribute['id_product_attribute']]}</td> </tr> {/foreach} </table> modify it to: <table class="table"> <thead> <tr> <th><span class="title_box">{l s='Quantity'}</span></th> <th><span class="title_box">{l s='Reference'}</span></th> <th><span class="title_box">{l s='Designation'}</span></th> </tr> </thead> {foreach from=$attributes item=attribute} <tr> <td class="available_quantity" id="qty_{$attribute['id_product_attribute']}"> <span>{$available_quantity[$attribute['id_product_attribute']]}</span> <input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/> </td> <td>{$attribute['reference']}</td> <td>{$product_designation[$attribute['id_product_attribute']]}</td> </tr> {/foreach} </table> This only works when product has attribute. Products without attribute is this code: {$product->reference|htmlentitiesUTF8}. But i cant get the code to work: if {$attribute['reference']} is empty { {$product->reference|htmlentitiesUTF8} } else { {$attribute['reference']} } Edited October 6, 2016 by editorstefan (see edit history) Link to comment Share on other sites More sharing options...
hannes01 Posted April 9, 2021 Share Posted April 9, 2021 Hello, how to achieve the same in Presta 1.7? Thank you! 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