Skip to main content

Availability: On Stock / Out of Stock

More
13 years 11 months ago #78733 by river
Hikashop 2.0 Business

Is it possible to have feature in each product

Availability: On Stock / Out of Stock

I do not want to show the number of what I have in stock of each product. But I just want to display if I have the product "in stock" or "Out of Stock"

Does Hikashop 2.0 have this function ?

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

More
13 years 11 months ago - 11 years 9 months ago #78759 by Jerome
Hi,

HikaShop does not have this option but it is already possible to do it.
You can override the view "product | quantity" via the menu Display>Views in order to display a text when the product is available instead of displaying the quantity.

Two modifications are required:
Code:
<div class="hikashop_product_stock"> <?php // Just add this line echo JText::_('IN_STOCK'); if(!empty($this->row->has_options)){
And
Code:
<div class="hikashop_product_stock"> <?php // Just add this line echo JText::_('IN_STOCK'); if($this->row->product_quantity==1){ if(JText::_('X_ITEM_IN_STOCK')=='X_ITEM_IN_STOCK'){ $text = JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity); }else{ $text = JText::sprintf('X_ITEM_IN_STOCK',$this->row->product_quantity); } }else{ $text = JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity); } // And comment the next one //echo '<span class="hikashop_product_stock_count">'.$text.'<br/></span>'; if($config->get('button_style','normal')=='css'){

After that, you should create a new translation entry for "IN_STOCK" in your override file.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 11 years 9 months ago by nicolas.
The following user(s) said Thank You: river

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

More
13 years 11 months ago - 13 years 11 months ago #78783 by river
Thank you for reply this works great.

One thing I am missing:
I need a prefix to the word "in stock"

By this I mean it is displaying like this:

Availability: In stock

How can fix this ?

Tnx
Last edit: 13 years 11 months ago by river.

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

More
13 years 11 months ago #78804 by Eliot
Hi there,

It's just a translation.
You have to edit your language file in Systeme>Configuration>Language and change the translation for IN_STOCK.
However, this translation may be used somewhere else in your website. So you can also change the IN_STOCK in the code given by Jerome with IN_STOCK_FRONTEND and make a new translation for this one.

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

More
13 years 11 months ago #78813 by river
Thank you this works great

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

More
13 years 10 months ago #80965 by kimneak
what is the directory to these files?

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

More
13 years 10 months ago #81091 by Jerome
Hi,

There is no directory for theses files, they are accessible thought the HikaShop backend.
Views are accessible thanks to the menu "Display > Views" and Language thanks to "System > Configuration > Language".

Regards,

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

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

More
11 years 10 months ago #184287 by river
How do I implement this function in Hikashop 2.3.4 ?

I have looked into the the file " product | quantity, but it looks like the file has gone trought some changes sine the last time I did this.

Any advice....

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

More
11 years 10 months ago #184297 by nicolas
The following user(s) said Thank You: river

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

More
11 years 10 months ago #184343 by river
Tnx Nicolas. The updated code works great.

You should make this function a part of Hikashop core. Not every online store wants to display the number of products that they have in stock, only that they have it in stock like me. =)

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

More
11 years 9 months ago #187543 by Temperament
Sorry guys, for I am quite new in this so I need to ask :(

Where do I change the code / what file ?

And if it is "out of stock" can i Change it to "on demand" or something ...


(HIKA SHOP 2.3.5)

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

More
11 years 9 months ago #187544 by Jerome

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: Temperament

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

More
11 years 9 months ago #187674 by Temperament
why is this code than?

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

More
11 years 9 months ago #187681 by Jerome
NO_STOCK ?

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

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

More
11 years 8 months ago #188764 by Lepi
Buenas tardes noy nuevo en esto y lo estoy probando hace unos días para ver como funciona. Pero me encuentro con este problema. Cual es el archivo que tengo que modificar? que nombre tiene? Me aparecen mas de mil en la parte de vista.

Saludos,
Fernando

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

More
11 years 8 months ago #188768 by Jerome
Hi,

We are not speaking Spanish ; this forum is an English forum.
Please create a new thread in English and explain your issue.

Regards,

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

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

More
11 years 8 months ago #188919 by Lepi
Good afternoon I'm new at this and I'm testing a few days ago to see how it works. But I encounter this problem. What is the file you have to modify? what name? I appear in more than one thousand of view.

Regards,
Fernando

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

More
11 years 8 months ago #188958 by korzo
In Hikashop menu display->Views search for file "quantity" in your template.
Alternatively it's file components\com_hikashop\views\product\tmpl\quantity.php

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

More
9 years 8 months ago #260610 by river
Joomla 3.6.5
Hikashop 3.0

I want the same function on my site using hikashop 3.0

But when I look at the file product | Quantiy its different than before.

Could you please advice my on what code I should use and where to implement it ?

tnx

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

More
9 years 8 months ago #260613 by nicolas
Hi,

It's now that code which handles that:
Code:
if($this->row->product_quantity > 0) echo (($this->row->product_quantity == 1 && JText::_('X_ITEM_IN_STOCK') != 'X_ITEM_IN_STOCK') ? JText::sprintf('X_ITEM_IN_STOCK', $this->row->product_quantity) : JText::sprintf('X_ITEMS_IN_STOCK', $this->row->product_quantity)); elseif(!$in_stock) echo JText::_('NO_STOCK');
That you could change to:
Code:
if($this->row->product_quantity > 0) echo 'in stock'; elseif(!$in_stock) echo JText::_('NO_STOCK');

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

Time to create page: 0.574 seconds
Powered by Kunena Forum