Jump to content
drroot

How to change the order of the entries of Features?

Recommended Posts

1. Currently the features displayed in the "Data Sheet" are alphabetically listed.

Could we change their order manually?

 

2. I wish to have one feature in bode fonts.

 

3. It would be clearer if we could have two columns in the "Data sheet". The first column is the name of the feature, and the second column is its value. Currently the values of different features are not aligned in one column.

 

Let's compare the "Data sheet" tab in the prestashop demo here:

http://demo-store.prestashop.com/en/electronics/31-android-phone.html

 

vs the "Detais" tab on NewEgg:

http://www.newegg.com/Product/Product.aspx?SID=0ObyHngxEeGA3s66uOKJ7Q0&AID=10440897&PID=1225267&nm_mc=AFC-C8Junction&cm_mmc=AFC-C8Junction-_-cables-_-na-_-na&Item=N82E16875101038

In addition, could we split the current feature list into "General Features" and "Technical Features" in the Data Sheet?

 

 

Sorry for so many questions, and Thanks for all of your efforts.

Share this post


Link to post
Share on other sites

1. Currently the features displayed in the "Data Sheet" are alphabetically listed.

Could we change their order manually?

 

> you'd have to change some stuff ... the

create your own function Product::getFrontFeaturesStatic()

change the call in the ProductController

Share this post


Link to post
Share on other sites

> Change position of the products in the home category

 

Sorry daYmo, could you clarify it in more details?

 

I want to change the order of the feature list of ONE product, such as

1. Hight

2. Width

3. Weight

...

Share this post


Link to post
Share on other sites

I ended up doing something similar, but modified the php files instead. I think its a cleaner hack.

 

my features are now in this format in the admin panel

01**Width

02**Height

03**Depth

 

How to Install

1. look for {prestashop installation}/override/controllers

2. take the attached ProductController.php and copy it into that location

 

NOTE: we assume that you are using the standard installation of prestashop and have not made any other modifications to the ProductController.php

 

Changes

1. Modified the class signature to be:

class ProductController extends ProductControllerCore

2. removed all the other functions other than:

public function process()

3. added the following code:

/* Features / Values */
$features = $this->product->getFrontFeatures((int)self::$cookie->id_lang);

//check to see if features are empty
if($features!=null || !empty($features))
{
 //sort the features
 sort($features);

 //create a new array to store the new data into
 $sFeatures = array();

 //go through all the features
 foreach($features as $f)
 {
  //grab the name
  $str = $f['name'];
  //split the name on **
  $arr = preg_split("/\\*\\*/", $str);

  //if it meets these conditions then lets store it
  if(count($arr) == 2){
   $f['name'] = $arr[1];
  }

  //store into new features
  $sFeatures[] = $f;
 }

 //replace the new features back into old features
 $features = $sFeatures;
}

 

Edit: I was referring to this post

http://www.prestashop.com/forums/topic/9709-edit-features-order-list/

ProductController.php

Edited by macgngsta (see edit history)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More