Jump to content

Recommended Posts

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

post-563678-0-01650900-1368367918_thumb.jpg

post-563678-0-94617200-1368367919_thumb.jpg

post-563678-0-79559800-1368367921_thumb.jpg

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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

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

post-563678-0-46529900-1368817848_thumb.jpg

Link to comment
Share on other sites

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

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

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

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..

post-563678-0-43624000-1369260158_thumb.jpg

post-563678-0-55448000-1369260160_thumb.jpg

Link to comment
Share on other sites

  • 1 month later...
  • 9 months later...

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

×
×
  • Create New...