Skip to main content

product stock count only on product page

More
10 years 11 months ago #217248 by Vero
-- 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.

More
10 years 11 months ago #217257 by nicolas
Hi,

In that case, you need to change the code:
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:
Code:
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.

More
10 years 11 months ago - 10 years 11 months ago #217369 by Vero
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: 10 years 11 months ago by Vero.

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

More
10 years 11 months ago #217382 by Xavier
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.

More
10 years 11 months ago #217488 by Vero

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

More
10 years 11 months ago #217490 by Xavier
Hi,

So it is a css issue due to the property:
Code:
.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:
Code:
.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.

More
10 years 11 months ago #217578 by Vero
thanks!

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

Time to create page: 0.256 seconds
Powered by Kunena Forum