product stock count only on product page

  • Posts: 222
  • Thank you received: 1
9 years 11 months ago #217248

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4

Hi,

I don't want to display product stock count on products listing page en want to display it only on product page. Now it is displaying everywhere. What have I to change?

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 11 months ago #217257

Hi,

In that case, you need to change the code:

if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK')
			$text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity);
		else
			$text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity);
to:
if(!empty($this->element->product_id)){
		if($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK')
			$text = JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity);
		else
			$text = JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity);
}
in the file "quantity" of the view "product" via the menu Display>Views.

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

  • Posts: 222
  • Thank you received: 1
9 years 11 months ago #217369

Thanks, but now it displays no the text, but it still displays product stock count ( the area with css: background with a border) .

Last edit: 9 years 11 months ago by Vero.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 11 months ago #217382

Hi,

This seems to be coming from another view override, the code given by Nicolas remove the text and the value at once, and not only the text or only the value. So there is another code generating this display, and this is not a default HikaShop code.

Please give a link to a page with the issue.

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

  • Posts: 222
  • Thank you received: 1
9 years 11 months ago #217488

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #217490

Hi,

So it is a css issue due to the property:

.hikashop_product_stock_count {
    float: right !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 7px 10px;
    border: 2px solid #008000;
    color: #008000;
    line-height: 125%;
}
in the frontend_custom css file under Configuration > Display > CSS.

I think that you have to replace this property by:
.hikashop_product_page .hikashop_product_stock_count {
    float: right !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 7px 10px;
    border: 2px solid #008000;
    color: #008000;
    line-height: 125%;
}

The following user(s) said Thank You: Vero

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

  • Posts: 222
  • Thank you received: 1
9 years 10 months ago #217578

thanks!

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

Time to create page: 0.076 seconds
Powered by Kunena Forum