Carousel breaking layout

  • Posts: 224
  • Thank you received: 8
6 years 5 months ago #293390

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.8
-- PHP version -- : 5.6.36
-- Browser(s) name and version -- : Chrome 66.0.3359.181

Hello,
I have created a new module position in product /show.php to insert the related products module before the reviews.
I have also set the module to show as a carousel. At first it was working just fine but then it started breaking the layout (basically showing the whole row of products, slides with 3 products each are not working anymore).

I narrowed the issue down to the product /show.php file, it's not a css issue as when I disable my custom css it is not solved, it's definitely something in that file, but the only thing I did was adding this line of code

<div>
<jdoc:include type="modules" name="hika-related-products" style="xhtml"/>
</div>
at line 102, just before the votes form opening tag
<form action="<?php echo hikashop_currentURL() ?>" method="post" name="adminForm_hikashop_comment_form" id="hikashop_comment_form">

If I delete my customization and load the module below the comments using hikashop default setting in the configurations panel, everything is fine. The issue just happens as soon as I activate my custom view.
Also, if I disable the "carousel" feature the related products shows just fine even with my custom file activated.

I also compared the original show.php with my customized one, but the only difference is that line of code.

I attach what I see when inspecting the cose and this module configs.

Thank you!

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 5 months ago #293400

Hi,

As far as I know, you've not possible to use jdoc:include tags anywhere outside templates. So I'm surprised it would even do anything.
In any case, you can't do it like that.
If you want to move the area where the modules you enabled in the "modules under the product page" setting are displayed, you want to move the code:

<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
<?php
	if(!empty ($this->modules) && is_array($this->modules)) {
		jimport('joomla.application.module.helper');
		foreach($this->modules as $module) {
			echo JModuleHelper::renderModule($module);
		}
	}
?>
	</div>
which displays them.

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

  • Posts: 224
  • Thank you received: 8
6 years 5 months ago #293436

As far as I know, you've not possible to use jdoc:include tags anywhere outside templates. So I'm surprised it would even do anything.

Actually it works, it was just the carousel that was giving problems, but this morning is working just fine, I have no idea what the issue was but apparently it auto-resolved :blink:

The reason why I want a new module position there is to be able to publish more modules, Hikashop setting only allow to publish modules related to hikashop as far as I see so even if I move the code as you suggested I wouldn't be able to put there different modules.
Anyway all good now, thanks for the support!

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

Time to create page: 0.058 seconds
Powered by Kunena Forum