Sharak Posted January 10, 2014 Share Posted January 10, 2014 (edited) By default you can select New, Used and Refurbished in product edit page. I'd like to also add Exibition. I made some changes in /classes/Product.php: 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', 'exhibitioned'), 'default' => 'new'), ... and /adminXXX/themes/default/template/controllers/products/informations.tpl: <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> <option value="exhibitioned" {if $product->condition == 'exhibitioned'}selected="selected"{/if}>{l s='Item from exhibition'}</option> </select> Now I have another option in the list, there's success note after saving but, value in database ps_product and ps_product_shop tables is always set to New, even if I try to change Used or Refurbished to Exhibitioned. How to make it work? Edited January 10, 2014 by Sharak (see edit history) Link to comment Share on other sites More sharing options...
Sharak Posted January 11, 2014 Author Share Posted January 11, 2014 Any suggestion would be helpful Link to comment Share on other sites More sharing options...
Sharak Posted January 20, 2014 Author Share Posted January 20, 2014 (edited) Still need help with this. Any suggestions? It's presta 1.5.6.0 Edited January 20, 2014 by Sharak (see edit history) Link to comment Share on other sites More sharing options...
BrightSoul Posted February 20, 2014 Share Posted February 20, 2014 (edited) I think what you've done so far is correct, but still not enough. If you look at the schema of the ps_product table that's in your database, you'll notice that the condition field is of ENUM type which will allow just the new, used and refurbished values. If you try to update the field with any other value, MySql will use the default instead, which is new. So, try to ALTER that table to allow the exhibitioned value as well. Try this locally and then, only if it solves your problem, execute it on the live database. ALTER TABLE `ps_product` CHANGE COLUMN `condition` `condition` ENUM('new','used','refurbished','exhibitioned') NOT NULL DEFAULT 'new' AFTER `available_date`; Also, do the same to the ps_product_shop table. ALTER TABLE `ps_product_shop` CHANGE COLUMN `condition` `condition` ENUM('new','used','refurbished','exhibitioned') NOT NULL DEFAULT 'new' AFTER `available_date`; Edited February 20, 2014 by BrightSoul (see edit history) 1 Link to comment Share on other sites More sharing options...
ravell Posted March 26, 2014 Share Posted March 26, 2014 I think what you've done so far is correct, but still not enough. If you look at the schema of the ps_product table that's in your database, you'll notice that the condition field is of ENUM type which will allow just the new, used and refurbished values. If you try to update the field with any other value, MySql will use the default instead, which is new. So, try to ALTER that table to allow the exhibitioned value as well. Try this locally and then, only if it solves your problem, execute it on the live database. ALTER TABLE `ps_product` CHANGE COLUMN `condition` `condition` ENUM('new','used','refurbished','exhibitioned') NOT NULL DEFAULT 'new' AFTER `available_date`; Also, do the same to the ps_product_shop table. ALTER TABLE `ps_product_shop` CHANGE COLUMN `condition` `condition` ENUM('new','used','refurbished','exhibitioned') NOT NULL DEFAULT 'new' AFTER `available_date`; SHARAK did BrightSoul's suggestion work? Link to comment Share on other sites More sharing options...
fwatban Posted April 24, 2014 Share Posted April 24, 2014 SHARAK did BrightSoul's suggestion work? Hi Ravell, I am new to prestashop, could you please explain more how can i access the ps_product table, where do i find that Thanks a lot Link to comment Share on other sites More sharing options...
fwatban Posted April 24, 2014 Share Posted April 24, 2014 Hi Ravell, I am new to prestashop, could you please explain more how can i access the ps_product table, where do i find that Thanks a lot Please help Link to comment Share on other sites More sharing options...
fwatban Posted April 24, 2014 Share Posted April 24, 2014 (edited) SHARAK did BrightSoul's suggestion work? Hi Everybody, I did all what mentioned above and everything seems working fine except one thing In the product page under the product model number where it should show the new condition i added "floor model", it is instead showing empty Any idea what wrong i am doing Thanks a lot Edited April 24, 2014 by fwatban (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 24, 2014 Share Posted April 24, 2014 Hi Ravell, I am new to prestashop, could you please explain more how can i access the ps_product table, where do i find that Thanks a lot you have to use database manager like phpmyadmin you need to open it, then go to table named ps_product you've got an access to phpmyadmin? Link to comment Share on other sites More sharing options...
fwatban Posted April 24, 2014 Share Posted April 24, 2014 you have to use database manager like phpmyadmin you need to open it, then go to table named ps_product you've got an access to phpmyadmin? Yes my friend i did all that and added the condition floor model but still not showing on the customer side Link to comment Share on other sites More sharing options...
Recommended Posts