sumitt2004 Posted February 26, 2013 Share Posted February 26, 2013 (edited) Hi, I am trying to add 3 values (hot, sale and offer) in product condition with New, Used and Refurbished. I altered ps_product table with ENUM (new,used,refurbished,hot,sale,offer) and edited information.tpl file to show these values in BO. Now as I save product with any of new value then an error comes with: Property Product->condition has bad value (allowed values are: new, used, refurbished) at line 837 in file classes/ObjectModel.php . Here is the screenshot. Edited April 9, 2013 by sumitt2004 (see edit history) Link to comment Share on other sites More sharing options...
sumitt2004 Posted March 2, 2013 Author Share Posted March 2, 2013 Is there anyone who can help me on this? Link to comment Share on other sites More sharing options...
Phantom48 Posted April 8, 2013 Share Posted April 8, 2013 i have same problem ;( Link to comment Share on other sites More sharing options...
Phantom48 Posted April 8, 2013 Share Posted April 8, 2013 in classes/Products.php 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('',...'',...',''), 'default' => 'Unknown'), type your values and error don't come Link to comment Share on other sites More sharing options...
sumitt2004 Posted April 9, 2013 Author Share Posted April 9, 2013 Thanks a lot Phantom48. You made my day Link to comment Share on other sites More sharing options...
Phantom48 Posted April 9, 2013 Share Posted April 9, 2013 Thanks a lot Phantom48. You made my day but now i have other problem. Condition write on Database. but not work when i change product and when i put in Product.tpl "{if isset($product->condition)}<h2>Condition: {l s={$product->condition[spam-filter]</h2></br>{/if}" and as result - "Condition:" Link to comment Share on other sites More sharing options...
atwitz3nd Posted April 16, 2013 Share Posted April 16, 2013 (edited) Hello, Did you find a solution to this? I have same problem: I out put the condition value on the product-listing.tpl (which works well with native conditions) Added the new condition to the ps_product.conditions table (upcycled) Added the new field value to the drop down options in: information.tpl (adminfolder/themes/themename/template/controllers/products/information.tpl)<br /> <option value="upcycled" {if $product->condition == 'upcycled'}selected="selected"{/if} >{l s='upcycled'}</option> Added the new values to the array settings in: line 285 classes/product.php 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new, 'used', 'refurbished', 'upcycled'), 'default' => 'new'), All works fine with no errors, shows correct in database, lets you select the option in BO... BUT with this new condition in place, it displays wrong in the front office. Always shows the condition as *new* (which is the default) I must be missing another step somewhere, is there another file which use this information? I'm so close to solving this, Please help if you can. Just to point me to the mystery file Thank you in advance Edited April 16, 2013 by atwitz3nd (see edit history) Link to comment Share on other sites More sharing options...
sumitt2004 Posted April 17, 2013 Author Share Posted April 17, 2013 Hello, Did you find a solution to this? I have same problem: I out put the condition value on the product-listing.tpl (which works well with native conditions) Added the new condition to the ps_product.conditions table (upcycled) Added the new field value to the drop down options in: information.tpl (adminfolder/themes/themename/template/controllers/products/information.tpl)<br /> <option value="upcycled" {if $product->condition == 'upcycled'}selected="selected"{/if} >{l s='upcycled'}</option> Added the new values to the array settings in: line 285 classes/product.php 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new, 'used', 'refurbished', 'upcycled'), 'default' => 'new'), All works fine with no errors, shows correct in database, lets you select the option in BO... BUT with this new condition in place, it displays wrong in the front office. Always shows the condition as *new* (which is the default) I must be missing another step somewhere, is there another file which use this information? I'm so close to solving this, Please help if you can. Just to point me to the mystery file Thank you in advance You missed 1 step. Go into DB and Alter your table ps_products. Change column condition with enum("Value1","Value2") Link to comment Share on other sites More sharing options...
atwitz3nd Posted April 17, 2013 Share Posted April 17, 2013 Thanks for responding, but I definitely did add the new column condition with enum ('upcycled') in the ps_products table. That was the 2nd step in my list above, right after outputting the value to the front office product-list.tpl. So I honestly can't worked out why it's not working, everything is there. Any more suggestions? Thanks so much for your time xx Link to comment Share on other sites More sharing options...
atwitz3nd Posted May 16, 2013 Share Posted May 16, 2013 SOLVED - Just wanted to let you, in case anyone else is following this. The missing step to the this is that you have to change not only the product table in the DB (inserting the new condition enum value), but also the product_shop table in the same manner. All other steps are outlined in my previous post above ^^ Hope this helps Sarah Link to comment Share on other sites More sharing options...
Recommended Posts