Item Number in Stock & Stock Notifications

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #151566

Hello,

I want to ask for help on two issues I'm facing with my HikaShop.

1. How can I force the system to only decrement items when the order is "PAID"? Because some people make the order and don't pay it for a while but the items are decremented from my stock. Others can't order items this way... What can I do about this? I want items to be subtracted from the stock ONLY IF they're paid for.

2. How can I have a notification for USERS when there's only 5 items left in my stock? I don't want the number to be there all the time because I don't want them to see all items I have in my stock. Only when we're down to 5 or less, I want them to see a text near the item or smth like this. How can I do this?

Site URL : www.222publications.com

Thanks in advance,
Blessings,
Simon

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #151613

Hi,

1. There is an option for that in HikaShop, Configuration > Main > Product > "Update the product stock on confirmed status".

2. You have to make a view override for the view "product / quantity", add an if condition to display the stock level only if it"s less than 6. something like:

if($this->row->product_quantity < 6){
	echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'<br/></span>';
}

The following user(s) said Thank You: PubSite

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

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #151663

Thanks a lot Xavier..

I added the code you suggested. I don't know where to put it exactly in the php file.. It might not be working because of that...

we only have 2 of this book left : www.222publications.com/newcatalog/fa/ho...ncebooks/product/24-
but I can't see any notification even though I've added the code.

Thanks in advance.
God bless,
Simon

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

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #151668

now it's showing 2 lines of available items in stock. I want it to show only one line and ONLY if there's 5 or less.. Shall I add an else to that if statement? Please help me with the code. You'll see what I mean if you click on the link above.

Thanks! :)

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #151676

Hi,

So you just have to remove the other line (the one not in your if condition):

echo '<span class="hikashop_product_stock_count">'.JText::sprintf('X_ITEMS_IN_STOCK',$this->row->product_quantity).'<br/></span>';

The following user(s) said Thank You: PubSite

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

  • Posts: 100
  • Thank you received: 1
10 years 7 months ago #151734

Thank you so much! You've done me a huge favor Xavier. I appreciate it.

Just a quick question. Although I've fixed this issue with my CSS before, it's came back. I don't know why. I even checked the code and it's as it was before. I've floated all addresses to Center. But as you can see in my screenshots, when I'm in the checkout process, the addresses are corrupted and price titles too...! What can I do about this?

www.dropbox.com/s/9mzjdjfrs2aymc6/Screen...04-10%2014.09.18.png
www.dropbox.com/s/7gv8x79vnq72cpz/Screen...04-10%2014.10.04.png

Regards,
Simon

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #151763

Hi,

As you say it' a css issue. www.hikashop.com/support/support/documen...ize-the-display.html

Thanks to create a test account in order to see directly from what that come.
But we don't support css issues. ;)

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

Time to create page: 0.082 seconds
Powered by Kunena Forum