Jump to content

New field for Product in back office PS 1.6


Recommended Posts

I have tried to follow this guide to add custome text field(like New condition) under product edit page but informations.tpl file is totally different. I guessed this tutorial is based upon the PS 1.5. I would like to expect this same tutorial for PS 1.6 too.

 

http://mypresta.eu/en/art/developer/new-field-product-backoffice.html

 

Please any one.

 

Kind request to vekia also. Please take a look at this thread and help me.

 

 

Link to comment
Share on other sites

that tutorial is editing the theme directly, the admin theme in 1.6 is certainly different to 1.5, though how much code has changed I'm not sure.

 

You'll need something like this added to the information.tpl 

 

<div class="form-group">
        <label class="control-label col-lg-3 required" for="custom_label">
            <span class="label-tooltip" data-toggle="tooltip"
                  title="{l s='Custom Label Text.'} {l s='Invalid characters:'} <>;=#{}">
                {l s='Custom Label'}
            </span>
        </label>
        <div class="col-lg-5">
            {include file="controllers/products/input_text_lang.tpl"
            languages=$languages
            input_class="{$class_input_ajax}{if !$product->id || Configuration::get('PS_FORCE_FRIENDLY_PRODUCT')}copy2friendlyUrl{/if} updateCurrentText"
            input_value=$custom_label
            input_name="custom_label"
            required=true
            }
        </div>
    </div>

 

 

though it would be better to call the displayAdminProductsExtra hook and add it as a new tab.  that way any updates prestashop make to their theme won't overwrite your changes.

 

such as this: http://nemops.com/prestashop-products-new-tabs-fields/#.U9pZXGN418E

Link to comment
Share on other sites

if PrestaShop was compliant with their own developers guide, the product folder would use helpers, then you could easily add fields to any of the product tab's using a simple module folder.  As it is now you will need to 'hack' core.

Link to comment
Share on other sites

Hello vekia

 

Thanks for the quick reply

 

MY actual requirement is i would like to change Condition drop down menu as a hands free text field in the PS 1.6 back office

 

 

condition%20field.png

 

 

Please provide some advice for how can i modify this code in following .tpl file

 

ADMIN_DIR/themes/default/template/controllers/products/informations.tpl

 

line 262

 

<div class="form-group">                
                <label class="control-label col-lg-3" for="condition">
                    {include file="controllers/products/multishop/checkbox.tpl" field="condition" type="default"}
                    {l s='Condition'}
                </label>
                
                                
                <div class="col-lg-3">
                    <select name="condition" id="condition">
                        <option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
                        <option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
                        <option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
                    </select>
                    
                    
                    
                </div>
            </div>

Link to comment
Share on other sites

×
×
  • Create New...