X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   $cat_products and $f_products displaying differently (https://forum.x-cart.com/showthread.php?t=55303)

Sisom 08-29-2010 05:54 AM

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


robb3369 08-29-2010 06:43 AM

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

Sisom 08-30-2010 04:52 AM

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


All times are GMT -8. The time now is 12:08 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.