Jump to content

Expert help for newbie on Prestashop 1.6 "Condition: NEW"


Recommended Posts

Hi all prestashop experts I am new to this 1.6 Prestashop system and start to config my shop with the new released prestashop. 

 

I would like to change the " Condition New " options in my shop. I would like to add serval more options to this menu and also change the text of the existing options. But sadly I dont have the expertis that is required. I mean options "new, used, refurbished" 

 

Where do I manage to find this coding?, is it even possible?

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

in this case you have to modify admin template file, there is no other way to achieve it.

/admin_dir/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>
					</select>

add there new <option> field with own conditions.

remember to modify product.tpl file to handle this new condition

  • Like 1
Link to comment
Share on other sites

in this case you have to modify admin template file, there is no other way to achieve it.

/admin_dir/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>
					</select>

add there new <option> field with own conditions.

remember to modify product.tpl file to handle this new condition

 

 

Thank you very much vekia, it seems that I am close by now. But still there is something not working correct when saving product details I get msg: Property Product->condition has bad value (allowed values are: new, used, refurbished)

 

I have configerd both 

\adminxxx\themes\default\template\controllers\products - informations.tpl

\themes\default-bootstrap - product.tpl

 

both files has the same value for the newly added conditions. 

Link to comment
Share on other sites

  • 3 weeks later...

Anyone know where I would find the correct text to change ? 

 

Property Product->condition has bad value (allowed values are: new, used, refurbished)

 

Condition does not exist

A - This on the newly added conditions?

it's necessary to modify product class

 

in fields definition there is a entry:

'condition' => 					array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished'), 'default' => 'new'),

you have to add your new conditions to array:

array('new', 'used', 'refurbished')

 

for example:

array('new', 'used', 'refurbished', 'mynewcondition', 'anothercondition')

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

yes. My condition is regauto. I use ps.1.6.0.6 and i have added for example:

 

in classes/product.php

'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', 'regauto'), 'default' => 'new'),

in product.tpl

{elseif $product->condition == 'regauto'}{l s='regauto'}

in informations.tpl

<option value="regauto" {if $product->condition == 'regauto'}selected="selected"{/if}>{l s='regauto'}</option>

Thanks

Edited by kadapawn (see edit history)
  • Like 2
Link to comment
Share on other sites

Thank you very much Vekia for helping me with this.

 

After the edit of the ps_product table nothing was changed, but, after i did the same changes in product_shop table all is working fine. So both ps_product and product_shop tables need to have same values..

 

Thank you again very much,

Best Regards Vekia :)

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...