- This topic has 9 replies, 4 voices, and was last updated 5 years, 4 months ago by
Elvin.
-
AuthorPosts
-
November 24, 2020 at 2:29 am #1543791
Alin
Hello,
I would like to align the price of the products on the same line and i can seem to find a way.
Thank you very much
November 24, 2020 at 4:46 am #1543982David
StaffCustomer SupportHi there,
can you share a link to a page where i can see the price alignment?
November 24, 2020 at 4:49 am #1543988Alin
Hy David,
Is this page: https://somelierultau.ro/
November 24, 2020 at 5:29 am #1544056David
StaffCustomer SupportTry adding this CSS:
#wc-column-container .product, .woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: flex !important; flex-direction: column; flex: 1; } .woocommerce ul.products li.product a.woocommerce-LoopProduct-link .price { margin-top: auto !important; margin-bottom: 20px; }November 24, 2020 at 5:34 am #1544065Alin
David, you are a life saver and a genius.
Thankyou very much. Long live GeneratePress
November 24, 2020 at 6:03 am #1544119David
StaffCustomer SupportYou’re welcome – glad to be of help!
December 7, 2020 at 12:21 pm #1570771fecso
Hi David,
It works! Great! May I ask similar code for the product title too?
Thanks,
FerencDecember 7, 2020 at 12:33 pm #1570785David
StaffCustomer SupportThe product titles are vertically aligned to the top – there isn’t really a simple way to align them any other way then that
December 7, 2020 at 1:14 pm #1570831fecso
Hi David,
Thanks for your fast response. I am working on a site where product pictures are different sizes (books) but I need a much more tidy look in product loops (i.e. https://konyv.de/termekkategoria/konyv/ajandekkonyv/). Do you have any idea what to do?
Thanks,
FerencDecember 7, 2020 at 4:34 pm #1570961Elvin
StaffCustomer SupportHi,
This is pretty tricky to do because your images don’t have the same aspect ratio.
While we can force the image to have the same height, but there’s a chance that the landscape oriented images will be cropped on its left and right.
There also a chance of problems in legibility for portrait oriented images because they will shrink to fit the height we set based on landscape image’s aspect ratio.
That said, the best way is to actually set 1:1 aspect ratio images for products so we don’t have to worry about this.
But I understand that its going to be tedious to fix all of them. So its really a choice between landscape product images being cropped or portrait product images being too small to be read properly.
More things to ponder on: We can add a min-height to the
.wc-product-imageand remove themargin-top: auto;onspan.priceso the price’s position can be uniform but that will cause weird negative space on items with landscape oriented images. -
AuthorPosts
- You must be logged in to reply to this topic.