Daniel Patilea Posted December 6, 2013 Share Posted December 6, 2013 I am trying to add some custom fields on my prestashop backend and, when filled, to show up in frontend. Here are some examples of what I want to implement: http://i.imgur.com/K9VZgy7.jpg And here's the frontend: http://i.imgur.com/HE2nYoa.jpg Searched everywhere but no results. I just need an idea or an example. Thank you ! Link to comment Share on other sites More sharing options...
NemoPS Posted December 6, 2013 Share Posted December 6, 2013 Try following my tut here:http://nemops.com/extending-prestashop-objects/ 2 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted December 6, 2013 Author Share Posted December 6, 2013 Thank for the support Nemo1! I will try your code. Link to comment Share on other sites More sharing options...
Radu Posted December 6, 2013 Share Posted December 6, 2013 Good tuturial Nemo 1 Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 guide for product controller: product oobject new field 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted December 6, 2013 Author Share Posted December 6, 2013 Nemo1, I followed your code but it seems I omitted something I think: Thanks for your answer vekia! The information will show up on the front page? Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 yes it will appear in front page. take a look how to create textarea: {include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='description' input_value=$product->description } 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted December 6, 2013 Author Share Posted December 6, 2013 Thanks vekia! I am new to Prestashop so i'm a real pain. Where should i place this code? Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 there where you placed code for: instead of: input_name='description'input_value=$product->description use your field name and also your field input value (instead of product->description) 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted December 6, 2013 Author Share Posted December 6, 2013 (edited) I've done this but it doesn't save the data fron the textarea. Can you tell why? Here's the code i use: <tr> <td class="col-left"> {include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"} <label>{l s="What's Included"}</label> </td> <td style="padding-bottom:5px;" class="translatable"> {foreach from=$languages item=language} <div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;"> {include file="controllers/products/textarea_lang.tpl" languages=$languages input_name='extra_description' input_value=$product->extra_description} </div> {/foreach} </td> </tr> Edited December 6, 2013 by corsenium (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted December 10, 2013 Share Posted December 10, 2013 Have you correctly overridden the product class? 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted December 10, 2013 Author Share Posted December 10, 2013 Here is the code that works with textfield: <td style="padding-bottom:5px;" class="translatable"> {foreach from=$languages item=language} <div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;"> <input size="43" type="text" {if !$product->id}disabled="disabled"{/if} id="extra_description_{$language.id_lang}" name="extra_description_{$language.id_lang}" value="{$product->extra_description[$language.id_lang]|htmlentitiesUTF8|default:''}"/><sup> *</sup> </div> {/foreach} </td> Link to comment Share on other sites More sharing options...
Recommended Posts