Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing the background color based on Category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #11  
Old 07-16-2010, 08:19 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: Changing the background color based on Category

Quote:
Originally Posted by minfinger
Alright I will this weekend. If I can't nail this, I think I'll get paid

If you cant do something then you get paid?
Sorry bud, but I'm firing you and taking your job
__________________
- Shane Munroe
Reply With Quote
  #12  
Old 07-16-2010, 08:24 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Changing the background color based on Category

Lol!!!!!!!!!!!!!!!!!!!!!!:d/
__________________
xcart 5.1.2
Reply With Quote
  #13  
Old 07-16-2010, 08:43 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing the background color based on Category

If the code does not work for you - this probably why:

The css you provided is from a bestsellers list. The link you provided appears to be products on a category page.
I believe the $cat variable is the main category for a product on the product page. It appears you might need a category being passed inside an array of products - a category for each product.

To see if category variables exist for the products in a list (bestsellers, featured products, etc.) - Open webmaster mode and look for the array that holds all the products. You should be able to recognize it. I think the bestsellers array is called $bestsellers. On a category page, the products array is called $products.

Inside those arrays, if you see a variable that you recognize as the main category for that product - then you use that variable in the array - something like $bestsellers.category. If it is not there - then you have to add a query to the php file to get the category and pass it to the template so it is available to you.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #14  
Old 07-17-2010, 06:45 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Changing the background color based on Category

Tal LOL Typo...

Gb2world, yeah I think that's the problem as well I'm trying to do this mod to the Bestsellers list first.

Tal, you suggestion did not work. The TPL treated it like now class had been assigned in the <ul> I removed the class="bestsellers-products-item" from the original tpl and got the same results.

$bestsellers.cat didn't work either.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #15  
Old 07-17-2010, 09:17 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Changing the background color based on Category

I think the biggest problem is that Cat is not either established yet or I don't no with the call is for it.

Well I figured out that if I put in if $cat eq "Males" that it would change to blue, if the puppy is not a male, it doesn't go pink.

I have no idea, grr x-cart!
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #16  
Old 07-17-2010, 09:20 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Changing the background color based on Category

I think it needs to be setup in the <li> and not the <ul>

The <ul> is outside of the {foreach} so it's static.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #17  
Old 07-17-2010, 10:38 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Changing the background color based on Category

Quote:
I think the biggest problem is that Cat is not either established yet or I don't no with the call is for it.

Webmaster mode answers those questions. If you do not see it, you need to add a query to the php to retrieve it for the template. If you do see it - you know what it is called.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:16 AM.

   

 
X-Cart forums © 2001-2020