product layouts break after Hikashop v. 6.1

  • Posts: 110
  • Thank you received: 7
  • Hikashop Business
2 weeks 10 hours ago #372267

-- url of the page with the problem -- : antiqueswan.com
-- HikaShop version -- : 6.5
-- Joomla version -- : 5.4.6
-- PHP version -- : 8.3

Hello,

A long time ago, when I upgraded Hikashop from v. 6.1 to 6.2, the layout broke for the product list and the product details. At the time, I reverted by restoring to a backup. It's finally time for me to fix this.

I've installed the site on a staging domain so I can troubleshoot and demonstrate.

The correct layout, which is running v. 6.1, can be seen here:
List of products: antiqueswan.com/product
Product detail example: antiqueswan.com/product/regency-era-larg...ngland-dia-26-1-2-in

The broken layout, which is running v. 6.5, can be seen here:
List of products: mavendesignstudio-demo.com/swan/product
Product detail example: mavendesignstudio-demo.com/swan/product/...ngland-dia-26-1-2-in

Could you advise about where to start to correct the layout please?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 85796
  • Thank you received: 14089
  • MODERATOR
2 weeks 7 hours ago #372268

Hi,

Good news: this is not a HikaShop bug, and the fix is a small one on the template side, not in the product views.

What happened is a CSS change between versions. Up to 6.1 the product grid was built with floats, so the row wrapper did not need any particular display mode. From 6.2 onward the grid uses CSS Grid: the row wrapper (.hk-row-fluid) has to be display:grid for the product columns (.hkc-md-4 on the listing, .hkc-md-8 / .hkc-md-4 on the product page) to sit side by side. HikaShop also forces those columns to float:none on purpose under the new grid, so there is no float fallback once the wrapper stops being a grid.

Your template (rt_xenon) contains this custom rule:

.hk-row-fluid { display: block; }

loaded from templates/rt_xenon/custom/css-compiled/custom_11.css

That forces the row wrapper back to a plain block, so every product in the listing, and the image/info columns on the product page, stack full width one under the other. This rule was harmless on 6.1 (float grid) but it now overrides HikaShop's display:grid and collapses the layout.

The fix is to remove that .hk-row-fluid { display: block; } rule from your template's custom CSS and recompile/save. Since custom_11.css is a compiled file, edit the custom CSS source that generates it rather than the compiled file directly.

I checked this on your 6.5 staging site: putting .hk-row-fluid back to display:grid restores both the 3-column product list and the normal product page layout, identical to your live 6.1 site.

If you cannot get to the template source right away, you can override it as a stop-gap by adding this to your HikaShop custom CSS file (media/com_hikashop/css/frontend_custom.css):
.hk-row-fluid { display: grid !important; }

but removing the original display:block line is the clean fix.

Please Log in or Create an account to join the conversation.

  • Posts: 110
  • Thank you received: 7
  • Hikashop Business
2 weeks 3 hours ago #372270

Brilliant, thank you, Nicolas. I should have asked earlier.

I've removed the .hk-row-fluid { display: block; } and the list of products are displaying as expected in a three column grid.

The individual product page is almost there. There is a section in the second half of the product information that shows "details" and "shipping and returns," and those are still stacking. The information in the "details" section is meant to be two columns as well. I can see that the div is still using float: left, but when I try changing it to display grid and remove the float, it doesn't make a difference. Please see the attached screenshot.

Example product detail page: mavendesignstudio-demo.com/swan/product/...ngland-dia-26-1-2-in

Could you offer some guidance on how to modify the CSS to correct the layout please?

Attachments:
Last edit: 2 weeks 3 hours ago by karendunne.

Please Log in or Create an account to join the conversation.

  • Posts: 85796
  • Thank you received: 14089
  • MODERATOR
1 week 6 days ago #372271

Hi,

Glad the product list is sorted. The Details section is the same kind of issue, one level deeper.

The field rows in that section already carry HikaShop's grid class hkc-md-6, which means "half width" (6 of 12 columns), so they are meant to sit two per row. The reason they do not is that their container, the div with the class hikashop_product_custom_info_main_table, is a plain block. HikaShop's half-width columns only line up when their container is a CSS grid, so as long as the container stays a block the rows just stack and float next to each other at their natural width.

This is also why your own attempt did not change anything: setting display: grid on its own gives a grid with a single column, so everything still ends up stacked. The piece that was missing is grid-template-columns, which tells the grid it has 12 columns for the hkc-md-6 rows to span 6 each. And float has no effect on a grid item, so adding or removing it makes no difference here.

The fix is to make that container a 12 column grid. Add this to the same custom CSS where you removed the .hk-row-fluid display:block rule:

.hikashop_product_custom_info_main_table {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
}

I tested this on your 6.5 staging product page and the Details fields then lay out in two columns.

If you want some space between the two columns, add a gap:
.hikashop_product_custom_info_main_table {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	column-gap: 20px;
}

The "Details" and "Shipping & Returns" blocks staying one above the other is correct, they are two separate panels, only the fields inside Details were meant to be two columns.

The following user(s) said Thank You: karendunne

Please Log in or Create an account to join the conversation.

  • Posts: 110
  • Thank you received: 7
  • Hikashop Business
1 week 3 days ago #372321

I'm following you. And I have the CSS in place for

.hikashop_product_custom_info_main_table {
display: grid;
grid-template-columns: repeat(12, 1fr);
}

The final piece that's not in place yet is the shipping and returns information. I tried to follow the same idea with grid for the two sections but it's still showing below the details section (.hikashop_product_custom_info_main_table). But, it supposed to reside to the right of that.

See screenshots.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 85796
  • Thank you received: 14089
  • MODERATOR
1 week 3 days ago #372322

Hi,

Same idea as before:

The details block and the shipping & returns block are already set up as grid columns: details carries hkc-md-8 (8 of 12) and shipping & returns carries hkc-md-4 (4 of 12), so together they fill one row. They stack because their shared container, the div with the class hikashop_product_bottom_part, is a plain block, not a grid. That is also why putting the grid on hikashop_product_custom_info_main_table did not help: that is the details table itself, not the container that holds the two columns.

The catch is that this container also holds other full-width blocks (the description, the related items, the comments). So you make it a 12-column grid and tell those blocks to span the whole width, which leaves the details and shipping columns sharing one row:

.hikashop_product_bottom_part {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	align-items: start;
}
.hikashop_product_bottom_part > .hikashop_product_description_main,
.hikashop_product_bottom_part > span.hikashop_product_url_main,
.hikashop_product_bottom_part > .hikashop_submodules,
.hikashop_product_bottom_part > .hikashop_external_comments {
	grid-column: 1 / -1;
}

I tested this on your staging page: the shipping & returns block moves to the right of the details, and the description, related items and comments stay full width above and below. On narrow screens the two columns collapse back to stacked, which is the intended responsive behaviour.

The following user(s) said Thank You: karendunne

Please Log in or Create an account to join the conversation.

  • Posts: 110
  • Thank you received: 7
  • Hikashop Business
1 week 3 days ago #372327

Thank you, Nicolas. Your support has been excellent. I really appreciate it.

I've updated the live site to version 6.5 and everything is back to normal now. :woohoo:

Cheers,

Karen

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum