[email protected] Posted May 12, 2013 Share Posted May 12, 2013 Hi, Everyone I am new to prestashop and trying to figure out one thing, I want to show add more product condition when you list the product, Like "Used-Like New","Used-Acceptable" , "Parts and Repair" Ok, I was able to show them on product on my product page, I need to change in php file too, I don't know which php file, i did make changes in following files to make it work,its works with on three default product condition, New, Used and Refurbish, I attached three screen shots, please see attachment, Please help, Alex Link to comment Share on other sites More sharing options...
PascalVG Posted May 12, 2013 Share Posted May 12, 2013 Looks like you need to edit 3 files: /classes/product.php: Changes needed: condition need to be extended with your new conditions in: (search for refurbish to find quickly) public static $definition = array( ... 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', ADD HERE NEW CONDITION NAMES, use single quotes, separate by commas), 'default' => 'new'), ... ) /modules/blocklayered/blocklayered.php : (search for refurbish to find quickly) ... case 'condition': $condition_list = array( 'new' => $this->translateWord('New', (int)$filter['id_lang']), 'used' => $this->translateWord('Used', (int)$filter['id_lang']), 'refurbished' => $this->translateWord('Refurbished', (int)$filter['id_lang']) (ADD HERE NEW CONDITIONS. Copy line above, change refurbished into new condition name) ); foreach ($condition_list as $key => $condition) $attribute_values_by_lang[$filter['id_lang']]['condition'][] = array('name' => $this->translateWord('Condition', (int)$filter['id_lang']), 'id_name' => null, 'value' => $condition, 'id_value' => $key, 'category_name' => $filter['link_rewrite'], 'type' => $filter['type']); break; /themes/<your them folder>/template/controllers/products/informations.tpl : (search for refurbish to find quickly) <td style="padding-bottom:5px;"> <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> (ADD NEW CONDITIONS HERE. Copy line above, change refurbished into new condition name) </select> </td> Hope this helps, pascal 1 Link to comment Share on other sites More sharing options...
[email protected] Posted May 15, 2013 Author Share Posted May 15, 2013 Looks like you need to edit 3 files: /classes/product.php: I did this - Changes needed: condition need to be extended with your new conditions in: (search for refurbish to find quickly) public static $definition = array( ... 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isGenericName', 'values' => array('new', 'used', 'refurbished', ADD HERE NEW CONDITION NAMES, use single quotes, separate by commas), 'default' => 'new'), ... ) and I did this too, and this file has some more "refurbish" and I put my condition according to it- /modules/blocklayered/blocklayered.php : (search for refurbish to find quickly) ... case 'condition': $condition_list = array( 'new' => $this->translateWord('New', (int)$filter['id_lang']), 'used' => $this->translateWord('Used', (int)$filter['id_lang']), 'refurbished' => $this->translateWord('Refurbished', (int)$filter['id_lang']) (ADD HERE NEW CONDITIONS. Copy line above, change refurbished into new condition name) ); foreach ($condition_list as $key => $condition) $attribute_values_by_lang[$filter['id_lang']]['condition'][] = array('name' => $this->translateWord('Condition', (int)$filter['id_lang']), 'id_name' => null, 'value' => $condition, 'id_value' => $key, 'category_name' => $filter['link_rewrite'], 'type' => $filter['type']); break; I did this one before- /themes/<your them folder>/template/controllers/products/informations.tpl : (search for refurbish to find quickly) <td style="padding-bottom:5px;"> <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> (ADD NEW CONDITIONS HERE. Copy line above, change refurbished into new condition name) </select> </td> Hope this helps, pascal Now it doesn't show my condition and doesn't show error, so we did something right, but probably not enough, still not showing my condition " Used-like new" term. it shows error before when I had not edit first two file in this reply, and that's why I started this topic more help needed, Thank you in advance, Link to comment Share on other sites More sharing options...
[email protected] Posted May 17, 2013 Author Share Posted May 17, 2013 I did what i been told, it does not shows product condition, but it shows this error, The following module(s) could not be loaded:: blocklayered (parse error in /modules/blocklayered/blocklayered.php) blocklayered (class missing in /modules/blocklayered/blocklayered.php) Thank you in advance Link to comment Share on other sites More sharing options...
[email protected] Posted May 17, 2013 Author Share Posted May 17, 2013 I did what i been told, it does not shows product condition, but it shows this error, case 'condition': $condition_list = array( 'new' => $this->translateWord('New', (int)$filter['id_lang']), 'used' => $this->translateWord('Used', (int)$filter['id_lang']), 'used_like_new' => $this->translateWord('Used-like new', (int)$filter['id_lang']) 'refurbished' => $this->translateWord('Refurbished', (int)$filter['id_lang']) ); foreach ($condition_list as $key => $condition) $attribute_values_by_lang[$filter['id_lang']]['condition'][] = array('name' => $this->translateWord('Condition', (int)$filter['id_lang']), 'id_name' => null, 'value' => $condition, 'id_value' => $key, 'category_name' => $filter['link_rewrite'], 'type' => $filter['type']); break; The following module(s) could not be loaded:: blocklayered (parse error in /modules/blocklayered/blocklayered.php) blocklayered (class missing in /modules/blocklayered/blocklayered.php) Thank you in advance Link to comment Share on other sites More sharing options...
deanjhon530 Posted May 18, 2013 Share Posted May 18, 2013 (edited) I have been working on a website that displays products in a grid view, with each product containing a title, an image and some in a grid view. To achieve this layout, I used an unordered list with the CSS display property on each item set to inline-block. Let me walk you through the code and point out how this approach works well for a responsive layout........... __________ deanjhon530 Edited May 18, 2013 by deanjhon530 (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted May 20, 2013 Share Posted May 20, 2013 Hi Alex, in your code, a ',' is missing, which is probably the cause of your problem: 'used_like_new' => $this->translateWord('Used-like new', (int)$filter['id_lang']), <-- at the end, add a , Hope this helps, pascal Link to comment Share on other sites More sharing options...
[email protected] Posted May 22, 2013 Author Share Posted May 22, 2013 I have changed file and fix syntax error, see my attachment, now it does not show error, but still doesn't show condition on product view page, (its show no condition) even when i go to product listing page, i select my condition like "Use-like new", and i click save and stay, next thing see that drop down menu goes to "new", it does not stay at "Used-like new", fixing syntax, fix error, but still does not show my condition at product view page, Any idea Thank you very much for your help.. Link to comment Share on other sites More sharing options...
Festival Trade Posted July 12, 2013 Share Posted July 12, 2013 are you guys wonder about this simple solution ? http://www.prestashop.com/forums/topic/169469-displaying-product-condition-solved/ Sounds like ! Link to comment Share on other sites More sharing options...
fwatban Posted April 24, 2014 Share Posted April 24, 2014 (edited) 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...
Recommended Posts