Jump to content

[SOLVED] Changing the width of featured products section (In Home Page)


Recommended Posts

Hello Friends,

I am new to prestashop, and I am facing some difficulties in changing the width of the whole page.
In global.css file, I have managed to do the following:

(1)Change the overall width -- #page{width:980px;} Done
(2)Left and Right Column width --- #left_column, #right_column{width:190px;} Done
(3)Center column width --- #center_column{width:614px;} Done

I have somehow managed to change the overall width, left column width, right column width, and center column width.
But the problem is -- I am not able to change the width of "featured-products_block_center" (The whole featured products section which is enclosed within the center column.) I actually want the featured products section to cover/take entire width of the center column.

I tried defining the following property (in global.css) to make this work : #featured-products_block_center{width:100%;}
But still it doesn't work. I don't know, which property do I need to modify in global.css to make this work. Also I want to know, how to control the number of columns to be displayed in featured products.

I mean What do I need to do to display 2 or 3 or 5 columns in featured products section which is displayed in home page (instead of default 4).

Somebody please help me or at least point me to the right direction by providing some links, where I can get my answers. Thank You..

Link to comment
Share on other sites

To change the width of the featured products block, you'll need to modify the width value of 536px in the #center_column div.block section of css/global.css in your theme's directory.

To change the number of columns in the featured products module, modify modules/homefeatured/homefeatured.tpl and change the value of 'nbItemsPerLine' from 4 to the number of columns you want. You'll need to modify the width value of 132px in the #center_column .products_block ul li section of global.css to adjust the width of the columns.

  • Like 1
Link to comment
Share on other sites

To change the width of the featured products block, you'll need to modify the width value of 536px in the #center_column div.block section of css/global.css in your theme's directory.

To change the number of columns in the featured products module, modify modules/homefeatured/homefeatured.tpl and change the value of 'nbItemsPerLine' from 4 to the number of columns you want. You'll need to modify the width value of 132px in the #center_column .products_block ul li section of global.css to adjust the width of the columns.




Thank you Rocky, I appreciate your help. This is exactly what I was looking for. My problem is resolved now. Thank you very much. I have one more question. I hope you can provide me a solution.

Is there any way in Prestashop to display a product in multiple categories? For example- Suppose there is a Category in which a product is listed. I want one more category to be created (Named "Browse by Price"). Under this category, I have created the sub categories like - (1) Between 10K - 20K, (2) Between 20K-30K, (3) Between 30K to 40K, (4) 40K and Above.

Now the problem is - I am not getting a way to add the existing product (Which is under the main category) into this category. Suppose If a product is in the range of 20,000 to 30,00, I want that product to appear in the sub category "Between 20K to 30K". So, Does this have to be manually done for each product, or is there any way to list the same product in multiple categories.

I dont know how much sense does it make, but I actually want a "Browse By Price category" on the left hand side of the screen, where I can browse different products based upon the price range specified. An example of this kind can be seen in "www.swamilaptops.in". You can see that this website has been made in oscommerce. I was wondering, if this kind of feature or any module is available in prestashop, where the users can filter their results based upon the price range.

Is there any module available which can solve this problem of mine?? Thank You..
Link to comment
Share on other sites

See my post here for two filter modules that you may be interested in.

Alternatively, you can just create extra categories like you have, then on the "1. Info." tab, tick the product's category and also tick the appropriate price category in the "Catalog:" section.

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

Edit themes//modules/homefeatured/homefeatured.tpl (or copy modules/homefeatured/homefeatured.tpl to this location to override it), then change line 41 (in PrestaShop v1.4.2) from:

{$product.description_short|strip_tags|truncate:130:'...'}



to:

{*{$product.description_short|strip_tags|truncate:130:'...'}*}

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