Basement1995 Posted October 26, 2013 Share Posted October 26, 2013 Hello In my website it shows 3 products per row , how do i change this to like 4 or 5 products shown per row? My website is basementdesignerclothing.com Thanks In Advance 1 Link to comment Share on other sites More sharing options...
vekia Posted October 26, 2013 Share Posted October 26, 2013 about what part of website you're talking? featured products? (i don't think so) open product_list.css file and decrease width param in: .grid li { width: 210px; float: left; margin: 20px 30px 0 0; border-top: 0px solid #e5e5e5; padding-top: 20px; } decrease it to 130px; add there also this: .grid li img {width:130px; height:auto;} Link to comment Share on other sites More sharing options...
Basement1995 Posted October 28, 2013 Author Share Posted October 28, 2013 where do i find this ? Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2013 Share Posted October 28, 2013 this is full path to the file: http://basementdesignerclothing.com/themes/tendance/css/product_list.css Link to comment Share on other sites More sharing options...
Basement1995 Posted October 29, 2013 Author Share Posted October 29, 2013 it made no difference Link to comment Share on other sites More sharing options...
Basement1995 Posted October 29, 2013 Author Share Posted October 29, 2013 it shows 1 product per row now Link to comment Share on other sites More sharing options...
vekia Posted October 29, 2013 Share Posted October 29, 2013 you removed styles, you need to put it back there. exactly as i show above. Link to comment Share on other sites More sharing options...
Basement1995 Posted October 29, 2013 Author Share Posted October 29, 2013 sorry im new to this, what style are you talking about? Link to comment Share on other sites More sharing options...
vekia Posted October 29, 2013 Share Posted October 29, 2013 i suggested to use these styles i pasted above. in http://basementdesignerclothing.com/themes/tendance/css/product_list.css in line 42 you've got: .grid li {width:130px;height:auto;} float:left;margin:20px 30px 0 0; border-top:0px solid #e5e5e5; padding-top:20px;} change it to: .grid li { width: 130px; float: left; margin: 20px 30px 0 0; border-top: 0px solid #e5e5e5; padding-top: 20px; } below this, add also new style: .grid li img {width:130px; height:auto;} 1 Link to comment Share on other sites More sharing options...
alexgarzon Posted December 5, 2013 Share Posted December 5, 2013 Hello Vekia, I've trying to do something similar with the default theme.I already changed the number of columns, but I also need to know how can I modify the number of columns in the FEATURED PRODUCTS module, cause making a margin only in a predefined number of columns, even though I increase the width of the div. Link to comment Share on other sites More sharing options...
vekia Posted December 5, 2013 Share Posted December 5, 2013 homefeatured.tpl file there is a code: {assign var='nbItemsPerLine' value=4} change value param this is what you're looking for? i hope so 2 Link to comment Share on other sites More sharing options...
alexgarzon Posted December 5, 2013 Share Posted December 5, 2013 Wow, just perfect, super thanks. Link to comment Share on other sites More sharing options...
alexgarzon Posted December 6, 2013 Share Posted December 6, 2013 http://mypresta.eu/en/art/tips-and-tricks/how-to-move-image-slider-module-from-home-to-top-in-prestashop.html Hey Vekia, I found that, and I have questions: Is good, but the problem comes when you try to update PrestaShop, it will overwrite the file again, you will lose the change, I wonder if there is a way to make that kind of change, but only affecting the theme files. Thanks again! Link to comment Share on other sites More sharing options...
vekia Posted December 6, 2013 Share Posted December 6, 2013 unfortunately, there is no way. The only one solution: you can duplicate module and change it name, this will help. Link to comment Share on other sites More sharing options...
alexgarzon Posted December 19, 2013 Share Posted December 19, 2013 (edited) Hey, it's me again, I've been making a lot of changes all over the css files, of modules and theme, and now I don't understand why if I have the homefeatured.tpl file as you said, with a 4 in the right place, I'm getting this result. As you can see there, the module is printing 5 items per row, driving me crazy, I don't know if there is an other place where I have to set the margin or padding, cause as you obviously know, it prints different classes depending on the parameters in the .tpl file... I really need your help, I've seen that you have the right answer always! jeje Edited December 19, 2013 by alexgarzon (see edit history) Link to comment Share on other sites More sharing options...
alexgarzon Posted December 19, 2013 Share Posted December 19, 2013 What I need is really simple, I just want to have 4 items per row, and the possibility to have as many rows as the client want, without to destroy the design, you know what I mean... What makes me really is that I don't see any change when I increase the number in the tpl file. 1 Link to comment Share on other sites More sharing options...
vekia Posted December 19, 2013 Share Posted December 19, 2013 in module .tpl file you've got code like: {assign var='nbItemsPerLine' value=5} - change it to 4 and decrease spacing between products, because there is not enough space to dispaly 4 products. Link to comment Share on other sites More sharing options...
alexgarzon Posted December 19, 2013 Share Posted December 19, 2013 But that's the problem, I already have a 4 there, I even set it to 3 to see what happens, but nothing change when I edit the .tpl file Link to comment Share on other sites More sharing options...
alexgarzon Posted December 19, 2013 Share Posted December 19, 2013 I wonder if there is cache or something inside the program, or there is an other place where I have to change something to modify the number of items of each line. Link to comment Share on other sites More sharing options...
alexgarzon Posted December 19, 2013 Share Posted December 19, 2013 Hey I found the problem, there are 2 homefeatured files, one in the modules folder, and the other one inside the theme folder, and I was changing the wrong one... thanks anyway! Link to comment Share on other sites More sharing options...
rmiho Posted January 16, 2014 Share Posted January 16, 2014 Hi Vekia, I was trying something similar but not for homefeatured, I am trying for the products displayed in categories. currently it shows 3 products. each block is 31% . I reduced this it 20% and made some space after 3 products. However this doesnt not bring the next products in first row Any clue? thanks in advance. Link to comment Share on other sites More sharing options...
vekia Posted January 16, 2014 Share Posted January 16, 2014 without url i can't help because you use non-default solution. Link to comment Share on other sites More sharing options...
rmiho Posted January 16, 2014 Share Posted January 16, 2014 (edited) without url i can't help because you use non-default solution. Hi you can reach to server if you can add the below entry to your local host file. xyz once you connected, click on bags category from the menu Let me know if any issues. Thank you Regards Edited January 17, 2014 by rmiho (see edit history) Link to comment Share on other sites More sharing options...
rmiho Posted January 17, 2014 Share Posted January 17, 2014 hey I think I figured it out. I had to make 2 changes. 1 change span4 to span2 in product-list.tpl and the other thing changed was from 3 to 4 in the below. </div> {if $product@iteration%4==0||$smarty.foreach.products.last} </div> Thanks any way. Link to comment Share on other sites More sharing options...
vekia Posted January 17, 2014 Share Posted January 17, 2014 oops! Link to comment Share on other sites More sharing options...
taniacr Posted May 28, 2014 Share Posted May 28, 2014 Is it me or in the new default template, in the file modules/homefeatured/homefeatured.tpl, the code {assign var='nbItemsPerLine' value=4} doesn't exist? All i've got is this: {counter name=active_ul assign=active_ul} {if isset($products) && $products} {include file="$tpl_dir./product-list.tpl" class='homefeatured tab-pane' id='homefeatured' active=$active_ul} {else} <ul id="homefeatured" class="homefeatured tab-pane{if isset($active_ul) && $active_ul == 1} active{/if}"> <li class="alert alert-info">{l s='No featured products at this time.' mod='homefeatured'}</li> </ul> {/if} Solution resides in editing the CSS then right? Link to comment Share on other sites More sharing options...
defuzed Posted May 28, 2014 Share Posted May 28, 2014 Hey taniacr, by new default template do you mean the 1.6 default bootstrap template? if you mean that one, it's actually pretty simple since the homefeatured.tpl just loads the product-list.tpl. in product-list.tpl there is line 49 (i cropped out a long list of not really relevant code): <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-6 col-md-4{else} col-xs-12 col-sm-4 col-md-3{/if}[snip irrelevant code]"> if you are familiar with the bootstrap grid ( http://getbootstrap.com/css/#grid ) you probably know what to do. If not just edit the "col-" classes to what you like. For example if on medium and large screens you want 3 columns change "col-md-3" to "col-md-4". Hope this helps! 1 Link to comment Share on other sites More sharing options...
taniacr Posted May 28, 2014 Share Posted May 28, 2014 Hi defuzed by new default template do you mean the 1.6 default bootstrap template? Yes i did! And it worked! Thank you so much! I really need to get used to Bootstrap! Link to comment Share on other sites More sharing options...
defuzed Posted May 28, 2014 Share Posted May 28, 2014 glad i could help just an afterthought since i haven't changed anything in product-list.tpl myself. There might be some additional stylings related to classes that i cropped out of line 49 (like "last-in-line" etc.) that might remove margins or whatever. These classes depend on the nbItemsPerLine smarty variables at the top of product-list.tpl. You might need to change these values too if some margins or anything else looks funny when there are multiple lines in homefeatured block. Yes bootstrap is awesome and i'm really glad prestashop switched to using it for v1.6! Link to comment Share on other sites More sharing options...
taniacr Posted May 28, 2014 Share Posted May 28, 2014 Yeah i'll fix as I go.. Guess the old days of easy html & css are over Thanks Link to comment Share on other sites More sharing options...
warmantus Posted June 26, 2015 Share Posted June 26, 2015 Hi defuzed, I gave this a try on my website and I get 4 columns but the last one is not being used? http://23.235.212.207/25-pumps Any idea what is going on? Regards, Link to comment Share on other sites More sharing options...
Anaa Posted October 3, 2015 Share Posted October 3, 2015 Dear Vekia & All, First of all thank you so much for posting very helpful topic's. I am newbie on PS.I have been changed the number of products shown per row on my PS for howefeatured and categories.Everything works fine but there is ONE problem comes ... Vekia I need your help. Do you know solution for this problem ..... Problem is lost BUTTON of 2 side of products of Same category and Customers who bought this product also bought: This 2 module shows all products whatever they have...(example shows 100 products ..) Before there were 2 button side of suggested products .....(something like a scroll button for 2 side of products ..if i click on button next products shows....)but now lost....shows many products....Please see the image ..Please help me .. here is the link.... http://www.luxurydiamondjewelry.com/home/13-18k-gold-blue-stone-square-rhinestone-earrings-necklace-jewelry-set.html Regards Anaa Link to comment Share on other sites More sharing options...
Anaa Posted October 3, 2015 Share Posted October 3, 2015 I can not attach or insert the image on this forum......:-( Link to comment Share on other sites More sharing options...
Anaa Posted October 4, 2015 Share Posted October 4, 2015 Dear All, I have changed the display 4 products per row (categories )and then lost the Previous and Next Scroll button of Same category..... Any idea? Why happens ? I made changes as below: global.css: 854 ...col-md-4 { width: 23.33333%; } changed to 23.3333% 2. product-list.tpl {if isset($products) && $products} {*define number of products per line in other page for desktop*} {if $page_name !='index' && $page_name !='product'} {assign var='nbItemsPerLine' value=4} was 3 {assign var='nbItemsPerLineTablet' value=3} was 2 {assign var='nbItemsPerLineMobile' value=3} was 3 {else} {assign var='nbItemsPerLine' value=5} was 4 {assign var='nbItemsPerLineTablet' value=4} was 3 {assign var='nbItemsPerLineMobile' value=2} was 2 {/if} 3. global.css:851 col-md-3 { width 25% changed to width 20% After those changes lost Scroll button of (2 side button of Previous & Next ) Same category .... Same category display all of product of current category......many products .... Is there any idea ? Looks I over do something......Please help me....How to fix this problems? link is: http://www.luxurydiamondjewelry.com/home/31-blue-opal-rhinestone-crystal-link-braclet-bangle-18k-rose-gold-.html Regards Anaa Link to comment Share on other sites More sharing options...
defuzed Posted October 5, 2015 Share Posted October 5, 2015 The link you provided isn't working, it'S gonna be hard to help you without being able to inspect the actual page... As a side note you should NOT change width settings of "col-md-" classes, i can't really tell what you are trying to do since global.css: 854 ...col-md-4 { width: 23.33333%; } changed to 23.3333% doesn't really make sense, but judding from the next "changed to 20%" if you need bootstrap columns to fit 5 elements you will have to add the following to global.css .col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 { position: relative; min-height: 1px; padding-right: 10px; padding-left: 10px; } .col-xs-15 { width: 20%; float: left; } @media (min-width: 768px) { .col-sm-15 { width: 20%; float: left; } } @media (min-width: 992px) { .col-md-15 { width: 20%; float: left; } } @media (min-width: 1200px) { .col-lg-15 { width: 20%; float: left; } } and then use the col-md-15 class in you templates. Anyway please provide a working link. Link to comment Share on other sites More sharing options...
Anaa Posted October 5, 2015 Share Posted October 5, 2015 Hi Defuzed, Thank you so much for your reply. I would like do to as: 1. Homepage products tabs display 5 products per row.. 2. Categories pages display 4 products per row..... here is the link.....http://s582691779.onlinehome.us/3-women I made changes on PS as below: global.css: 854 ...col-md-4 { width: 33.33333%; } changed to 23.3333% 2. product-list.tpl {if isset($products) && $products} {*define number of products per line in other page for desktop*} {if $page_name !='index' && $page_name !='product'} {assign var='nbItemsPerLine' value=4} was 3 {assign var='nbItemsPerLineTablet' value=3} was 2 {assign var='nbItemsPerLineMobile' value=3} was 3 {else} {assign var='nbItemsPerLine' value=5} was 4 {assign var='nbItemsPerLineTablet' value=4} was 3 {assign var='nbItemsPerLineMobile' value=2} was 2 {/if} 3. global.css:851 col-md-3 { width 25% changed to width 20% Also zoom function does not work on product page (view lalger). If I , force to click on image ....only single image display and DO not have Previous and Next scroll button.... After those changes lost Scroll button of (2 side button of Previous & Next ) Same category .... Same category display all of product of current category......many products .... Looks I did many wrong ..... Regards Anaa Link to comment Share on other sites More sharing options...
defuzed Posted October 5, 2015 Share Posted October 5, 2015 (edited) hm are you using some kind of theme? I don't recall some sort of scrolling option being a prestashop default but i could be mistaken, anyway i can't help you with them not being there and nothing in the source indicating the presence of the scroll buttons... I think the best way would be if you just revert everything to the way it was, then tell me what you want to achieve and i'll have a look at that. In the current state it's just too much guessing... *edit* also, if you are using a theme, please attach the relevant templates (product-list.tpl etc.) as attachments since they will probably be modified Edited October 5, 2015 by defuzed (see edit history) Link to comment Share on other sites More sharing options...
Anaa Posted October 8, 2015 Share Posted October 8, 2015 (edited) Hi defuzed .. Yesterday was my birthday.....no work..... I am using prestashop default theme, (version 1.6.1.1. ) and try to changing some basic thing....Generally I want to change default theme like this way... 1. Homepage products tabs display 5 products per row..See 1st- image=---(attachment name is homepage products tabs-5 products) 2. Categories pages display 4 products per row.....see 2nd image (name as categories page show-4 products per row..) I made changes on global.css and product-list.tpl .....but after the changes ......View larger function does not work out...on the product page .(.see image 3rd attachment) Also you can see on this link..http://s582691779.onlinehome.us/tshirts/1-faded-short-sleeves-tshirt.html .Click on the image you will see image displaying 800X800px ..very big size... I crached my website so doing everything from beginning...here is the link, http://www.luxurydiamondjewelry.com/ Can you help me to modify above changes.....Those attachment images I just live edit and get screenshot...... Edited October 8, 2015 by Anaa (see edit history) Link to comment Share on other sites More sharing options...
defuzed Posted October 8, 2015 Share Posted October 8, 2015 Ok, like i said in previous posts don't just mess with classes in global.css, unless you are sure they only affect one specific element. The changes you desire are fairly straightforward with a little understanding of the bootstrap grid system and how prestashop applies it. I'll walk you through it: 1. The bootstrap grid doesn't provide a 5 item column, so you will have to add that functionality yourself. I already provided this code in an above post but for completeness sakes i'll post it again .col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 { position: relative; min-height: 1px; padding-right: 10px; padding-left: 10px; } .col-xs-15 { width: 20%; float: left; } @media (min-width: 768px) { .col-sm-15 { width: 20%; float: left; } } @media (min-width: 992px) { .col-md-15 { width: 20%; float: left; } } @media (min-width: 1200px) { .col-lg-15 { width: 20%; float: left; } } (original source iirc is : http://www.wearesicc.com/quick-tips-5-column-layout-with-twitter-bootstrap/ ) add this at the end of your global.css. 2. Now you just have to play around a little with product-list.tpl. {if isset($products) && $products} {*define number of products per line in other page for desktop*} {if $page_name !='index' && $page_name !='product'} {* this is category page *} {assign var='nbItemsPerLine' value=4} {* was 3 *} {assign var='nbItemsPerLineTablet' value=2} {assign var='nbItemsPerLineMobile' value=3} {else} {assign var='nbItemsPerLine' value=5} {* was 4 *} {assign var='nbItemsPerLineTablet' value=3} {assign var='nbItemsPerLineMobile' value=2} {/if} {*define numbers of product per line in other page for tablet*} {assign var='nbLi' value=$products|@count} {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet} <!-- Products list --> <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}"> {foreach from=$products item=product name=products} {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo} {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile} {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if} <li class="ajax_block_product{if $page_name == 'index'} col-xs-12 col-sm-4 col-md-15{else if $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-3{/if} {* cut off here since the rest stays the same - This is where you change the bootstrap grid classes so for index change to col-md-15 (5 columns) and category change to col-md-3 (4 columns)*} that should work, good luck Link to comment Share on other sites More sharing options...
Anaa Posted October 9, 2015 Share Posted October 9, 2015 Dear defuzed, Thank you so much for modification. I deleted all database and install Prestashop again..... :-( Now everything works fine...Prev and Next scroll button's appear and working very well.. Under the Product Page : Customers who bought this product also bought: & 14 other products in the same category:This 2 columns also displaying Prev and Next scroll button....See 1 st -attachment Products image displaying on his own frame with Prev and Next button (view larger function on the product image) see 2nd attachment... Thank you so much and I appreciate... :-) Another question ? I would like to re-size some buttons as add to cart ,more,in stock, and content price etc....and also padding ..... Do I need to add new code on each relative files or just need little number changing? let me know please Regards Anaa Link to comment Share on other sites More sharing options...
jjryeste Posted May 13, 2016 Share Posted May 13, 2016 Hello is possible , edit productlist-css only in one category, for example .grid li category->id_category == 94 width: 130px;float: left;margin: 20px 30px 0 0;border-top: 0px solid #e5e5e5;padding-top: 20px;} Thank you Link to comment Share on other sites More sharing options...
karim Posted May 7, 2018 Share Posted May 7, 2018 (edited) hello guys i have in mobile view 1 product per row and i want to change it to 2 or 3 maybe in each category .. any help ? i am using the classic theme prestashop 1.7 Edited May 7, 2018 by karim (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now