nspinheiro Posted November 20, 2013 Share Posted November 20, 2013 Hi I want to had some of the product fields in the front end, the EAN, the Supplier Reference, Maybe the Brand and the Manufacturers webpage on the product page. Please check the image. I've searched and all topics that i've found are about adding custom fields in the backoffice. Maybe i am not using the correct words to search. I believe that has to be done "by hand", editing some files, but witch ones? I am feeling a bit stupid, i believe this should be a subject easy to find. Thanks in advance Link to comment Share on other sites More sharing options...
vekia Posted November 20, 2013 Share Posted November 20, 2013 to add ean code just use {$product->ean13} variable anywhere you want in product.tpl page (in your theme directory) Link to comment Share on other sites More sharing options...
vekia Posted November 20, 2013 Share Posted November 20, 2013 to display supplier reference just use {$product->supplier_reference} varible Link to comment Share on other sites More sharing options...
nspinheiro Posted November 20, 2013 Author Share Posted November 20, 2013 (edited) to display supplier reference just use {$product->supplier_reference} varible in product.tpl right? and do i have to put it in any specific line of the code? I have done that but with {$product->ean13} And nothing happened EDIT: Sorry i did not saw your first post. Nevertheless, i've done that and nothing happened... am i missing something? Edited November 20, 2013 by nspinheiro (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 20, 2013 Share Posted November 20, 2013 after changing .tpl files, sometimes it's necessary to turn on force compile and turn off cache under adv. parameters > performance tab where to insert these variables? anywhere you want in product.tpl file 1 Link to comment Share on other sites More sharing options...
nspinheiro Posted November 21, 2013 Author Share Posted November 21, 2013 Hi Again. So i've done it again. In product.tpl under themes/mytheme i've added: var EAN13 = {$product->ean13} var supplier_reference = {$product->supplier_reference} Forced Compilation Disabled Cache Reload the pages, nothing appears Tried on diferent Explorer, nothing appears Tried on diferent computner, nothing appears Tried to change the place of the code in product.tpl (twice), nothing appears.... Link to comment Share on other sites More sharing options...
vekia Posted November 21, 2013 Share Posted November 21, 2013 code that you use define variables in javascript, these variables are invisible. to display these variables just use {$product->ean13}{$product->supplier_reference} without any "var" definitions Link to comment Share on other sites More sharing options...
nspinheiro Posted November 25, 2013 Author Share Posted November 25, 2013 Just to close the topic, i was able to do this finally, the problem was that (maybe a question of my theme) could not go "anywhere". There we're some parts of the code that if i put it there, nothing happened (i dont know HTML, so that was hard for me) but after many attempts i found the correct place to insert the code. Link to comment Share on other sites More sharing options...
vekia Posted November 25, 2013 Share Posted November 25, 2013 thank you for confirmation that it works, so you just paste variables that i suggested to use? i marked thread as [solved] with regards, milos Link to comment Share on other sites More sharing options...
nspinheiro Posted November 25, 2013 Author Share Posted November 25, 2013 yes, your variables. Was just a matter of the placement. Thanks Link to comment Share on other sites More sharing options...
nspinheiro Posted November 25, 2013 Author Share Posted November 25, 2013 if you could help on this http://www.prestashop.com/forums/topic/291471-change-the-on-sale-text-by-client-group-help-coding/ i would be appreciated. Thanks Link to comment Share on other sites More sharing options...
dinoroadster Posted January 10, 2014 Share Posted January 10, 2014 Sorry guys, but i tried so many lines on the product.tpl and it still doesn't show on my product page. What is the correct line to insert ? (i want it to appear under Reference) This is what i want to add : Brand = ?? Brand reference = {$product->supplier_reference}EAN13 = {$product->ean13} Thanks Link to comment Share on other sites More sharing options...
dinoroadster Posted January 15, 2014 Share Posted January 15, 2014 Any help ??? Link to comment Share on other sites More sharing options...
dinoroadster Posted January 15, 2014 Share Posted January 15, 2014 Do we need only to modify the product.tpl ? Under this code : <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}> <label>{l s='Reference :'} </label> <span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span> </p> I add this (in order to add supplier_reference) : <p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}> <label>{l s='Brand reference :'} </label> <span class="editable">{$product->supplier_reference|escape:'htmlall':'UTF-8'}</span> </p> But nothing is show on the webpage 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