Jump to content

Adding options to product condition list


cybermatrix

Recommended Posts

I tried to update this option to my prestashop 1.6.0.5 but I guess I'm missing something. I know very little about php but know enough to edit by followed instructions given on this forum. I found a thread for a previous 1.4 PS version and I am trying to adapt it for version 1.6.

 

First I went to admin/themes/default/template/controllers/products and opened the information.tpl and added:

<option value="custom build" {if $product->condition == 'custom build'}selected="selected"{/if} >{l s='Custom Build'}</option>

after this line:

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

Then

I went to themes/products.tpl and added:

{elseif $product->condition == 'custom build'}{l s='Custom Build'}

after this line:

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

Then

I ran this:

ALTER TABLE `ps_product` CHANGE `condition` `condition` ENUM( 'new', 'used', 'refurbished', 'custom build' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'new'

in ps_products in my db using PHPadmin

I check the db under ps_products/conditions and the query was accepted.

and this is the error that I get in my admin section when I select the custom build from the information page under my product:

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

 

Any help on what step I'm missing, skipped or messed up on would be appreciated

Link to comment
Share on other sites

Though more research and trial and error I found two more things that I need to do.

 

I also went to classes/Product.php and added "custom build" to the options:

/** @var enum Product condition (new, used, refurbished, custom build) */
    public $condition;

And I had to add the same query

ALTER TABLE `ps_product` CHANGE `condition` `condition` ENUM( 'new', 'used', 'refurbished', 'custom build' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'new'

to ps_product_shop in the db using PHPMyadmin

 

Unfortunately I still get the same error.

Still looking for any feedback on how to resolve this.

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

I just went back and changed every instance of  "custom build" to "custom_build" thinking that the db wouldn't accept the spacing but even that didn't work.

 

Im proactive in trying to find a solution but I hope someone more knowledgeable can give me a little direction.

Link to comment
Share on other sites

I'm going on day three and I still havent gotten a response on this problem. Am I posting this question in the wrong section? Any response would be appreciated at this point just to let me know someone is alive on the other end of this forum. I tried to be as detailed as possible with my issue and working resolution.

 

Please give me some direction on what I need to do next.

Link to comment
Share on other sites

It's now been 7 days since Ive posted my original issue and still no response. Once again, if I'm posting this in the wrong section can you please let me know. I am continuing to develop other sections of my website until this issue is resolved. But I will not stop asking for help or even a simple response until I get one. If I end up posting this in another section I will simple reference this thread. I have been using this forum for over a year now and I have never gone this long without getting some kind of acknowledgement. Please find the time to review this issue and give me some level of direction of where my issue may lie.

 

Thanks in advance.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...