No Stock notice breaking layout

  • Posts: 37
  • Thank you received: 0
13 years 10 months ago #5645

I have just tried a product with 0 stock to show the 'No Stock' message instead of an add to cart button.

The product showed correctly however it has broken my layout, with the sidebar now showing below the main content of the page (see screenshot - Login/Your Cart should be in right hand side bar).

I had a similar problem when I installed the JCE component and had the "Force Container Element" set to "div" so any content without a container was automatically given a div.

Just can't figure out what element is doing this - couldn't come across anyone with a similar problem in the forum.

Thanks
Simon

Attachments:
Last edit: 13 years 10 months ago by recedo.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #5654

Hi,

We just checked on our end and the HTML code when there is no stock is ok for us.

Could you provide a link to that page ?

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

  • Posts: 37
  • Thank you received: 0
13 years 10 months ago #5659

Hey - sorry running on my localhost so can't give a link.

Have provided the html for the page as an attachment to this post if thats any good - otherwise I'll keep digging and playing!

Simon

File Attachment:

File Name: page.txt
File Size:32 KB

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #5665

The opening span is missing in your HTML.

Normally, in the file quantity of the view product (accessible via the menu Display->Views), you should have the span below defined just before the NO_STOCK string:
<span class="hikashop_product_no_stock">

Did you change that view maybe ?

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

  • Posts: 37
  • Thank you received: 0
13 years 10 months ago #5667

As far as I can tell that span is still there;

<div style="width: 49%;" class="hikashop_product">
				<div class="hikashop_container">
					<div class="hikashop_subcontainer">
					<div class="hikashop_product_image" style="height: 128px; text-align: center; clear: both;">
			<a href="/tmg2/index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=13&amp;name=mine-t-shirt&amp;Itemid=115&amp;category_pathway=0">
	<img height="128" width="121" alt="Mine T-Shirt" src="/tmg2/media/com_hikashop/upload/thumbnail/t-shirt_11240.png">		</a>
	</div>
	<span class="hikashop_product_price_full">
	<span class="hikashop_product_price">£ 10.00</span>  per unit</span><span class="hikashop_product_name">
			<a href="/tmg2/index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=13&amp;name=mine-t-shirt&amp;Itemid=115&amp;category_pathway=0">
	Mine T-Shirt		</a>
	</span>
	<form name="hikashop_product_form_13_hikashop_category_information_menu_115" method="post" action="/tmg2/index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;Itemid=115">					<span class="hikashop_product_no_stock">
					No stock</span>
					</form></div>
								<br>		<input type="hidden" value="13" name="product_id">
		<input type="hidden" value="1" name="add">
		<input type="hidden" value="product" name="ctrl">
		<input type="hidden" value="updatecart" name="task">
						</div>
				</div>

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #5669

Ah ok, you're right, the span is there, it's getting late!

However, I can see a closing div tag after the closing div in your attachment:
No stock</span></div><br/>

In our code, in that same file, I don't see it:
echo JText::_('NO_STOCK');
}?>
</span>
<?php
}
}
?>
<br/>

Could you check this one out ?

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

  • Posts: 37
  • Thank you received: 0
13 years 10 months ago #5671

removing that div places the entire main content area into 1 column... I have made some modifications to wrap the buttons in both a div and a span to facilitate my styling.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #5672

Are you sure that you properly added an opening div for it ? Could you attach the content of that view ?

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

  • Posts: 37
  • Thank you received: 0
13 years 10 months ago #5674

Managed to sort it - it was the div you mentioned. I had opened it correctly but closed the wrong side of an elseif statement and therefore it wasn't closing when the 'no stock' message was shown instead of a button - must have just stuck it down there at some point to try to make it all work together!

Thanks again for your fantastic support.

Regards
Simon

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

Time to create page: 0.073 seconds
Powered by Kunena Forum