Jump to content

How to find from which css


Recommended Posts

Hello

My home page shows 5 items per row, in the category page it is possible to view max 4 items because of the

col-md class that is devided only for 12, 

i would like to view in my category page 5 items as well but i couldnt find how to modify the category page  to take the css

from the same css that my home page is taking,

any body knows ?

Link to comment
Share on other sites

Check if you have this in your product-list.tpl 

 

	{if $page_name !='index' && $page_name !='product'}
		{assign var='nbItemsPerLine' value=3}
		{assign var='nbItemsPerLineTablet' value=2}
		{assign var='nbItemsPerLineMobile' value=3}
	{else}
		{assign var='nbItemsPerLine' value=4}
		{assign var='nbItemsPerLineTablet' value=3}
		{assign var='nbItemsPerLineMobile' value=2}
	{/if}



This, or something alike. It really depends on the template

Link to comment
Share on other sites

yes i do have this in my Product-list.tpl ,the solution for me was:

1.Changing :

{assign var='nbItemsPerLine' value=5}

2.Changing : col-md-{15/$nbItemsPerLine} instead of {12/$nbItemsPerLineTablet}

<li class="ajax_block_product col-xs-12 col-sm-{12/$nbItemsPerLineTablet} 
col-md-{15/$nbItemsPerLine}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}">
                

3. In the global.css : changing  the width to 20%.

.col-md-3 {
    width: 20%; }
Link to comment
Share on other sites

I was asked to change the visible product prise according to the shipping costs, in other words :

if (the shipping cost< certain value)

{

    product price=product price+shipping costs; 

   and it should says that

    shipping is free;

}

else {

      continue;}

Is there a file which iterates through the products array ? or any other way  .....

Link to comment
Share on other sites

Product price is visible in the single product page,as well as the product-list in the category page and home page,

Shipping price is visible  in the cart which is Ajax call (and ofcourse if the user decides to check out and pay he is being transfered to his cart which is a page not an Ajax call),   

the price should change all over.

Link to comment
Share on other sites

So you don't mean the products' extra shipping cost. You can try 2 things:

1- in the product controller, assign Cart::getOrderTotal(true, Cart::ONLY_SHIPPING, which holds the shipping value, to a variable you can then use in the template

2- use that method directly in the template for your condition

Link to comment
Share on other sites

Where should i do it in the : function initContent() ? should i make the call for this function  Cart::getOrderTotal(true, Cart::ONLY_SHIPPING) and assign it to a variable and then add

the shipping cost to the  product_price?

cause the controler does'nt use this function ...

and in which and where in the .tpl i should make the change as well ?

 

i am not yet famlier with Prestashop work flow and structure  ,even i have read there documantation.

is there a good guide for developers who are not familier with prestashop to understand the work flow ?

Link to comment
Share on other sites

Since it spans across multiple pages, I'd use a module that hooks into the header, assign the variable, then use it in the template. (header, not top)
As for docs, the only (not so useful) available ones are at doc.prestashop.com

Link to comment
Share on other sites

thanxs i will work on it later on, i am jumping from one problem to another ,i  am trying to re-design the site, with no luck already 3-4 days,for example if 2 moduls are attached to one hook how they are being ordered ,and where can i change there order,cause in the header.tpl i see only the call for the hook ?also how do i call to hooks that i dont see in the header.tpl for example i tried to attach the topmenu to displayNav in order to place the topmenu a little down from its current location . 

Link to comment
Share on other sites

thanx ,i saw that video its very good as long as i am trying to move  moduls from right to left columns or to hooks that there  space is not so wide   but in my case when i am trying to position moduls and logo within one hook while changing there order in the BO did'nt help, maybe because i am trying to position them horizontaly, it gives me a lot of problems ,i just couldnt make it,  i am stuck.

also suddently i am not getting any var in the product-list.tpl that was assigned to smarty in the CategoryControl.php , i tried to do assign in the  CategoryControlCore it self as well as in the override folder but when looking at the smarty debug consule i dont see the assigned var. i replaced the smary folder from an older backup i had steel nothing is changing also i cleared smarty,prestashop,browser cach .... i will glad to get help since there are so many problems with the system and it is taking days to solve such small issues...

Link to comment
Share on other sites

 

as they might not fit due to their markup

markup means? the modules order per hook in the BO?

is it possible to change a button to check-box in each product? means that in the product-list i have  "add to cart button" and i need it

to be check-box or some other controler, when it is checked/pressed the it will do the add to cart action ?

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