Jump to content

[SOLVED] Add line breaks within Features


FordMT

Recommended Posts

I have products where the Features have several options depending on the Attributes selected. Currently the format I can get is everything in a single line, but that is hard for the user to decipher. 

 

Example:

 

Length:                      5 inches (127mm) 8 inches (203mm) 10 inches (224mm)

Material:                     Nylon (NY) Polypropylene (PP)

Resistance:                 NY: 46lbf (21kgf) PP: 40lbf (18kbf)

Package Dimensions: 5IN: 275mm x 225mm x 155mm 8IN: 350mm x 225mm x 185mm 10IN: 385mm x 210mm x 215mm

Weight:                       5IN: 4.85lbs (2.20kg) 8IN: 5.90lbs (2.68kg) 10IN: 5.90lbs (2.68kg)

 

I wanted to add line breaks within each Feature to make it easy to identify the different options of each Feature.

 

Features descriptions should look as follows:

 

Length:                      5 inches (127mm)

                                  8 inches (203mm)

                                  10 inches (224mm)

Material:                     Nylon (NY)

                                   Polypropylene (PP)

Resistance:                 NY: 46lbf (21kgf)

                                   PP: 40lbf (18kbf)

Package Dimensions: 5IN: 275mm x 225mm x 155mm

                                   8IN: 350mm x 225mm x 185mm

                                   10IN: 385mm x 210mm x 215mm

Weight:                       5IN: 4.85lbs (2.20kg)

                                   8IN: 5.90lbs (2.68kg)

                                   10IN: 5.90lbs (2.68kg)

 

Is there anyway I can do this?

 

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

Hi,

You can use an override to enable multiple features to products(this way you can set from backoffice multiple values for every feature), and then modify the product.tpl , to put breaks after each filter value if more than one feature is present for each feature group.

Regards, Leo

Link to comment
Share on other sites

I have tried entering html command <br> within the values of the Feature module.  But the module does not accept entering the < or > symbols.  And I do not know how to get into a html editor for the features module.

Link to comment
Share on other sites

Here's a simple hack for multi-line feature values. Change line 477 (in PrestaShop v1.6.1.5) of themes/default-bootstrap/product.tpl from:

						<td>{$feature.value|escape:'html':'UTF-8'}</td>

to:

						<td>{$feature.value|escape:'html':'UTF-8'|replace:'|':'<br />'}</td>

You can then enter a feature value like 100|200 and it will display 100 and 200 on separate lines.

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