kiran4prestashop Posted March 26, 2013 Share Posted March 26, 2013 Actually my requirement is to add one countries dropdown field for each product Is there anybody 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. [PrestaShopDatabaseException] 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.. <table> <td class="col-left"><label>Countries</label></td> <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> </select> </td> </table> In seo.tpl page. Is the way i am coded correct please let me know Please see the below link. http://www.prestasho...%E2%84%A2-1531/ Please help me. Thanks Inadvance.. Link to comment Share on other sites More sharing options...
Terragg Posted March 27, 2013 Share Posted March 27, 2013 Have you looked at using Product Attributes? You can create a 'Country' attribute and then add it to your products and PrestaShop handles the rest. No coding required. Hope this helps, 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