VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: dennisg on July 26, 2022, 09:41:22 AM

Title: Strange CSS problem forcing products to lose alignment in category view
Post by: dennisg on July 26, 2022, 09:41:22 AM

Hi,

I'm facing a very strange issue which is, most probably, css related but I can't find out why and how to fix it.

If you visit this link:

https://stospiti.gr/προϊόντα/είδη-μπάνιου/mpataries-mpaniou/μπαταρίες-νιπτήρα/results,1-200

you'll see, near the bottom of the page, that some products lose their justification and appear one after the other.

Tested it with vmbeez3 and this does not occur..

Is there anyone more experienced in css who can help me find out how to fix this?

Thanks!!!
Title: Re: Strange CSS problem forcing products to lose alignment in category view
Post by: GJC Web Design on July 26, 2022, 10:00:50 AM
I think it is more likely to be an extra <div> or </div> or perhaps illegal character  breaking the layout as the subsequent elements after WNW168B73PAB are all enclosed in the last row--
and there are no more horizontal-separator

look at the source and you will see what I mean

Title: Re: Strange CSS problem forcing products to lose alignment in category view
Post by: GJC Web Design on July 26, 2022, 10:17:57 AM
BTW -- the w3.org validator stopped at line 13881 with too many errors having displayed 973 to that point...  :o

the problem starts at around line 14130
Title: Re: Strange CSS problem forcing products to lose alignment in category view
Post by: dennisg on July 26, 2022, 11:02:26 AM
Thanks!

The problematic code was in the override file. I've removed the s-description code (not successfully obviously) and when a product did have a short description it all went sideways :-)

You saved the day, thanks again!
Title: Re: Strange CSS problem forcing products to lose alignment in category view
Post by: GJC Web Design on July 26, 2022, 12:03:57 PM
"I've removed the s-description code"

fairly common ... if you have something like

<div>Here is my short description</div>

and u shorten it by the std. code  shopFunctionsF::limitStringByWord($product->product_s_desc, 60, ' ...') you easily end up with

<div>Here is my short....

now u have one div extra which breaks the whole layout

I use   
$sdesc = strip_tags($product->product_s_desc);

echo shopFunctionsF::limitStringByWord (strip_tags($sdesc, 60, ' ...'))