PrestaShop Forums: change background in category - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


change background in category


change background in category

#1 jakubek

    PrestaShop Apprentice

  • 24 Nov 2009
  • Members
  • PipPip
  • 237 posts

Posted 09 February 2010 - 01:21 PM

hello
I want change background of center_column when i change category.
I made 4 diffrent id of column to change background.
            
{if $smarty.get.id_category == 3 OR $smarty.get.id_category == 17 OR $smarty.get.id_category == 18}

{/if}



its work but only static and only when i'm in category when i open porduct ( in this category) its not working, somebody know how can i do it?
Posted Image

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 10 February 2010 - 12:56 PM

it's not posible ??

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 February 2010 - 04:05 AM

Try the following instead:





This will allow you to set a different background in the center column for categories 3, 17 and 18. Use #center_column3 for category 3, $center_column17 for category 17, #center_column18 for category 18 and #center_column for all the other categories.

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 February 2010 - 09:00 AM

this what i wrote is mainly category and 2 subcategory.
yes in know but i need change in category and subcategory and in produckt of this cat and sub.
if i open product of this category i want have still this same background what i have in maindly category.

#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 February 2010 - 09:10 AM

I've made it so that the background stays the same for both the category and product, assuming the product's default category is that category, by using the following code:


{if $smarty.get.id_category == 3 OR $product->id_category_default == 3}


#6

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 February 2010 - 10:57 AM

its not working in my maindly category, it is id.category = 2 and where im in this category its ok but when i go to subcategory its not working...

{if $smarty.get.id_category == 2 OR $product->id_category_default == 2}

{/if}


i try it with subcategory 11 its ok but in produkt not ;s

      {if $smarty.get.id_category == 11 OR $product->id_category_default == 11} 

{/if}


aa $product->id_category_default - dont show anythink ;|

#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 11 February 2010 - 10:14 PM

some idea to solve it?

#8

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 12 February 2010 - 05:35 AM

How do you have your categories and products set up? Are your products in multiple categories or just one? If they are in just one category, you will need to set the "Default category" of the product to the category it is in instead of Home for $product->id_category_default to work. If your products are in multiple categories, the method I described won't work. You can try using $cookie->last_visited_category instead:

{if $smarty.get.id_category == 2 OR $cookie->last_visited_category == 2}


#9

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 12 February 2010 - 09:30 AM

i have maindly category and in this category is many sub category and i want this same bg in sub category its posible to do it?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users