Re: Hiding the stock count on the product pages

  • Posts: 7
  • Thank you received: 0
13 years 9 months ago #9692

Is it possible to nicely hide the stock count on the product pages ? My client is concerned that having it visible, especially on limited edition items, might not look good if certain items don't sell quickly. Looked through the manual and the config screens, but could not see a backend option to do this.

Another alternative would be to change the text to read "Still in stock" or "out of stock" as the case maybe, without showing the actual numbers.

It appears to be in the Views -> Products -> Show code, but my PHP isn't good enough to make the changes needed.

A little help would be appreciated.

Last edit: 13 years 9 months ago by guns1inger. Reason: Found the code to change, need help with the new code

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 9 months ago #9713

You can hide it with just some CSS (you can add it in the config on the display tab):
.hikashop_product_quantity_main{display:none;}

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

  • Posts: 7
  • Thank you received: 0
13 years 9 months ago #9723

Easier than expected. Many thanks, Nicolas.

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

  • Posts: 7
  • Thank you received: 0
13 years 9 months ago #9775

Sorry - didn't work as advertised. Yes, it hides the Stock Quantity, but it also hides the Add product button, which kind of makes selling items difficult. Seems the two are ties together somehow.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 9 months ago #9776

Oh indeed.

So you have two solutions:

1. Change the translations in the config under the tab languages. You can change the text or even empty it so that your users don't see the message.

2. Edit the file quantity of the view product via the menu Display->Views and remove the code:
echo JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity);

The following user(s) said Thank You: danidek

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

  • Posts: 7
  • Thank you received: 0
13 years 9 months ago #9777

The translation override did the trick. As an interim I had set the text colour to match the background int he CSS. The values were still visible, but only if you try to select the page content.

Again, thanks for your fast response.

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

  • Posts: 45
  • Thank you received: 0
13 years 2 months ago #27406

2. Edit the file quantity of the view product via the menu Display->Views and remove the code:
echo JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity);

Ive found the "show stock" line, now lives in view "product" "quantity"



Kate

Attachments:
Last edit: 13 years 2 months ago by k8fisher.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 2 months ago #27411

It's the file quantity of the view product.

You can also try the CSS modification I provided at the beginning. That should work too...

The line $this->params->set('show_quantity_field', 0); is not to remove the stock level but to remove the quantity input filed next to the add to cart button.

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

  • Posts: 45
  • Thank you received: 0
13 years 2 months ago #27413

Could I ask which view I would alter to remove mention of stock levels?

product / show.php (in the more recent revisions of hikashop doesnt contain the stock level line does it)

Last edit: 13 years 2 months ago by k8fisher.

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 2 months ago #27426

It's the file quantity of the view product.


The line has slightly changed though. It's now:
echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'</span><br/>';

The following user(s) said Thank You: shopatmimi

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

  • Posts: 24
  • Thank you received: 0
12 years 2 months ago #70849

I want to chime in here. I got rid of the stock levels but how do you close the extra white space? Image attached

Attachments:

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
12 years 2 months ago #71214

Just remove the <br/> at the end of that line of code and that will remove the space

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

  • Posts: 24
  • Thank you received: 0
12 years 2 months ago #71215

I guess my question is where would I find that exact code? I inspected the element with webmaster tools and there does not seem to be any <br> code.

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

  • Posts: 24
  • Thank you received: 0
12 years 2 months ago #71216

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
12 years 2 months ago #71412

It's 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: 70
  • Thank you received: 4
11 years 3 months ago #121948

Just to confirm the quickest easiest way to hide the Remaining Stock Counts on product pages is to add this line to the CSS.

.hikashop_product_stock_count {display: none;}

The stock counts will still be available in the raw html but not viewable in the browser.

The other option be to remove some text in the product > quantity view but that requires altering the view.

Thanks! -- Steven

The following user(s) said Thank You: Mohamed Thelji

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

  • Posts: 17
  • Thank you received: 0
9 years 10 months ago #189751

Instead of eliminating it entirely, Is it possible to have it just say "In Stock" when there is 1> quantity.

Thanks!

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

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
9 years 10 months ago #189758

Hi,

Yes. Change the translation key X_ITEMS_IN_STOCK to "In Stock" with a translation override:
hikashop.com/download/languages.html#modify

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

  • Posts: 21
  • Thank you received: 0
8 years 4 months ago #247960

Hello Nicolas, may I have an update on the location and code for the removal of Items in Stock on product pages please?
Joomla 3.6.2
Hikashop 2.6.3

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

  • Posts: 26165
  • Thank you received: 4029
  • MODERATOR
8 years 4 months ago #247971

Hi,

The solutions did not changed.
I am afraid that I don't understand your question.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.136 seconds
Powered by Kunena Forum