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

$cat_products and $f_products displaying differently

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-29-2010, 05:54 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default $cat_products and $f_products displaying differently

Hi, I've come across what appears to be a bug (but may just be me doing things I shouldn't!).
I have made a bottom border for the first product box in Featured Products, then a left and bottom border for the next product (which has the class of .highlight).

This works fine in Featured Products, but in subcategory products, it displays the first product with the class of .highlight, instead of the second, and it ruins the look.

You can view this on the site I am working on:

www.mrdtrading.co.uk/home.php?shopkey=martin

The home page displays featured products correctly, but on this page you'll see the problem:

http://www.mrdtrading.co.uk/Karts-By-Colour-c-31/

/customer/main/featured.tpl
uses this code:
{include file="customer/main/products.tpl" products=$f_products featured="Y"}

whereas

/customer/main/subcategories.tpl
uses this code:
{include file="customer/main/products.tpl" products=$cat_products}

(Sorry that everything is now in bold, the forum software won't allow me to change it.)

So there appears to be a bug in the way that $cat_products decides whether the first or second product should be the highlighted one - it should be the second, fourth, sixth, etc. but $cat_products is making it the first, third and fifth.

I believe that
/customer/main/products_list.tpl
pulls through the styles using the code at line 23:
<div{interline name=products additional_class=item}>

as
/customer/main/products_list.tpl
is used by both the Featured Products page, and the category featured products, and subcategory 'all products in that subcategory' pages.

__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #2  
Old 08-29-2010, 06:43 AM
  robb3369's Avatar 
robb3369 robb3369 is offline
 

Advanced Member
  
Join Date: Jul 2010
Posts: 83
 

Default Re: $cat_products and $f_products displaying differently

You need to look at the customer/main/products.tpl a bit closer... the include line simply "throws" a list of products (either $f_products for the list of featured products or $cat_products for the list of products within a specific category) into the next template being called. And if the featured="Y" is set, then the products_t.tpl is called, otherwise the products_list.tpl is called.

You need to look at the diferences between products_t.tpl and products_list.tpl for the cause of your issue...
__________________
Thanks, Rob

X-Cart 4.4.5 and 4.5.4 on Linux
Reply With Quote

The following user thanks robb3369 for this useful post:
Sisom (08-30-2010)
  #3  
Old 08-30-2010, 04:52 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: $cat_products and $f_products displaying differently

Thanks for your reply Rob, but that doesn't seem to fix the problem.
I looked in products.tpl, line 28
Code:
{if $config.Appearance.products_per_row && ($featured eq "Y" || $config.Appearance.featured_only_multicolumn eq "N")} {include file="customer/main/products_t.tpl"} {else} {include file="customer/main/products_list.tpl"} {/if}

and commented out
{include file="customer/main/products_t.tpl"}

and none of the pages I have mentioned were affected. (I had looked in Webmaster Mode and seen that only products_list.tpl was being called on all the pages involved.)
__________________
X-Cart Gold Version 4.3.2
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 11:02 PM.

   

 
X-Cart forums © 2001-2020