Jump to content

Add custom field in admin>>catalog>>Add


Recommended Posts

Hi,

Other way to do that (add new extra fields in ps_table and class Product). In Product.php, you have to add something like that:

public $new_field;
protected $fieldsSize = array('reference' => 32, 'supplier_reference' => 32, 'location' => 64, 'ean13' => 13, 'new_field' => 10000); // for example
protected $fieldsValidate = array('new_field' => 'is_float'); // for example

In function getFields, you have to add 1 more line:
$fields['new_field'] = floatval($this->field);

And the last and most important thing, you have to add one new field name "new_field" into table ps_product.

Regards,
Viet

Link to comment
Share on other sites

  • 1 year later...

in AdminProducts.php insert

 

 

<tr>

<td class="col-left">'.$this->l('new_field:').'</td>

<td class="translatable">';

 

echo ' <div class="lang_3" style="float: left;">

<input size="55" type="text" id="new_field" name="new_field"

value="'.$this->getFieldValue($obj, 'new_field').'" />

 

</div>';

echo '

</td>

</tr>

 

 

And in classes/products.php define

 

can in line 150

 

 

/** @var string new_field */

public $new_field;

 

Do not change PostProcess() in AdminProducts.php

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

get data from db ?

 

create in db table ps_product "new_field"

 

--

<?php echo $this->getFieldValue($obj, 'new_field'); ?>

--

 

--

classes/products.php define

Line 150

/** @var string new_field */

public $new_field;

--

Link to comment
Share on other sites

  • 7 months later...

Hello!

But how to pick up that data from the database and write it on the product page somewhere?

 

Many thanks!

 

 

I've begun searching for a solution to change the REFERENCE number to be called "SKU"

I'm having trouble finding a method to do this. so i'm wondering if you would inform me on wether I should use your solution here... Please advise thanks

Link to comment
Share on other sites

×
×
  • Create New...