Jump to content

Unknown column 'countries' in 'field list'

Recommended Posts

Actually my requirement is to add one countries field for each product and i have sent you the code for which i have used for extra field, I am using Prestashop version.


Do you know how to code for adding one extra field in product adding/editing page and adding that field content to database when product is submitted.


I have tried myself but i am getting the below error.




Unknown column 'countries' in 'field list'INSERT INTO `ps_product_lang` (`id_product`, `meta_description`, `meta_keywords`, `meta_title`, `countries`, `link_rewrite`, `name`, `description`, `description_short`, `available_now`, `available_later`, `id_lang`, `id_shop`) VALUES ('10', '', '', '', 'In', 'ipod-nano123', 'iPod Nano123', 'dadadasda', 'asdasda', '', '', '1', '1')

at line 605 in file classes/db/Db.php


I have the "countries" field in ps_product_lang but still it is saying that unknown column.


I have added one extra field at admin products adding/editing page and i am trying to update that in Product.php in classes.



/** @var enum Product countries */

public $countries;


'countries' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isString'),


Here countries is a dropdown selections for selecting list of countries..




<td class="col-left"><label>Countries</label></td>


<select name="countries" id="countries" size="2" multiple="multiple">

<option value="All">All</option>

<option value="In">India</option>

<option value="US">United States</option>

<option value="UK">United Kingdom</option>




In seo.tpl page.


Is the way i am coded correct please let me know


Please see the below link.




Please help me.

Thanks Inadvance..

Link to comment
Share on other sites

  • Create New...