Jump to content

[Solved] Error While Adding Values In Product Condition


Recommended Posts

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.

post-459577-0-21793800-1361877732_thumb.png

Edited by sumitt2004 (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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

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 by atwitz3nd (see edit history)
Link to comment
Share on other sites

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

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

  • 5 weeks later...

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

×
×
  • Create New...