Stock not updating on 'created' status.

  • Posts: 6
  • Thank you received: 0
11 years 1 month ago #128821

-- url of the page with the problem -- : www.fantomania.pl
-- HikaShop version -- : 2.1.1
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.4.17
-- Browser(s) name and version -- : Chrome 30.0.1599

Hi!

My problem is with updating stock count on ordering some items from shop. My shop is a place, where almost every product is one piece only, so it's obvious that I can't sell two of them.

However if I'll go to product configuration - there's only option to 'update stock count on confirmed status'. Ok. It's not exactly what I need, but I'm wise, so in the other place of config I've added 'created' status as 'confirmed'. That should do the trick.

I've been thinking, that this configuration will give me:
Customer adds product to cart then goes to checkout.
Next his choosing payment method as eg. bank transfer.
System is making an order and gives it the 'created' status (until I won't mark it as 'confirmed').

So if status is changing to created - the the product should have stock as zero, but it's still available.

What am I doing wrong?

Note: I've done nothing with the statuses, so they are, as implemented originally.

Regs,
Tom

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

  • Posts: 6
  • Thank you received: 0
11 years 1 month ago #128842

IMO it's the matter of editing and changin a settings of order.php file in /administrator/components/com_hikashop/classes/ however - I ain't got no clue what should I change here...

I guess this is the line, where I should change something. The only question is what:

if($order->old->order_status == 'created' && in_array($order->order_status,array('confirmed','shipped')))

Last edit: 11 years 1 month ago by t.fruba.

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

  • Posts: 6
  • Thank you received: 0
11 years 1 month ago #128843

Ha!

I've made it working! Just added new value to line mentioned above and it's working :) Now the looks this way:

if($order->old->order_status == 'created' && in_array($order->order_status,array('confirmed','shipped','created')))

My euphoria wasn't long (unfortunately). It turned out, that changing the order status to 'cancelled' or 'refunded' - is not taking back the stock count...

Last edit: 11 years 1 month ago by t.fruba.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 month ago #128911

Hi,

There are already options for that.

www.hikashop.com/support/documentation/5...ashop-changelog.html

HikaShop 2.1.0
New features
There is now an option to choose to update stocks only when the orders are confirmed and not when they are created


www.hikashop.com/support/documentation/5...ig.html#main_product

Update the product stock on confirmed status: The product stock will be decremented only when the order status is a conformed status, not when the order is created.


Please do not edit HikaShop core files like that, it can generate unwanted side effect.

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.

  • Posts: 6
  • Thank you received: 0
11 years 1 month ago #128921

Hi,

Thank you very much, however I've tried this option and it's not fitting my needs.
The part:

when the orders are confirmed and not when they are created

Is exactly the opposite of my needs...
I need to update stock when the order is created, not confirmed :)

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 month ago #128923

Hi,

So that is what it is done when the option is not activated :)

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.

  • Posts: 2
  • Thank you received: 0
9 years 1 month ago #215157

Dear Jerome,

We have a similar problem here:

What we need:
The product stock will be decremented when the order is created, because we have some products with only one piece.
The risk is too high that another person is ordering this product at the same time.

What happens:
Regardless what I try to configure via webgui, the stock is decrementing not until we change the order status to "confirmed".

i have tried the following combinations:

Update the product stock on confirmed status - YES
Invoice order statuses: created,confirmed
--> this works as discribed above (stock decrementing after changing the status)

Update the product stock on confirmed status - NO
Default order status: created
Invoice order statuses: created,confirmed

Update the product stock on confirmed status - NO
Default order status: ocreated
Invoice order statuses: (leave empty)
--> what I've read in the description, this is exactly what we want, but it does not works

We are using: Hikashop Business version 2.3.3
also using the language file to translate to german

Thank you in advance
Andreas

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

  • Posts: 13201
  • Thank you received: 2322
9 years 1 month ago #215194

Hi,

That should be working on the 2.3.3 but to be sure please update to the latest version of HikaShop.
Decrementing the stock on created orders is the default behavior.

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

  • Posts: 267
  • Thank you received: 5
8 years 3 months ago #247827

Hello!

I have configured various types of state.
Try status "Proceso Iniciado" does not detract from stock .
And the state " Matriculado " reste of stock .
But it does not work!.
The status "Proceso Iniciado" always reste of stock.

I'm doing something wrong !

Thanks!!

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 3 months ago #247844

Hi,

Update the product stock on confirmed status: The product stock will be decremented only when the order status changes from created to one of the statuses selected in the "invoice order statuses" option, and not when the order is created.

I can see that you setting "invoice order statuses" is not fully configured.
In your screenshot it is named "Estado de facturas de los pedidos" and just contain the value "Matriculado".

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.
The following user(s) said Thank You: dvddvd

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

  • Posts: 267
  • Thank you received: 5
6 years 3 days ago #300708

Hello Jerome,
I have two states, one of them is "registered" that decreases the stock, since it is confirmed.
And another that is admitted, that is not created or confirmed, and would like this state to also subtract the stock, how can I configure it to achieve it? Thank you

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 2 days ago #300709

Hello,

The setting propose only two alternatives :
- When the order is created.
- When the order receive a confirmed status.

If you want something which is not "created" and not a "confirmed status", it would require some custom development.

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.

  • Posts: 267
  • Thank you received: 5
6 years 1 day ago #300749

Thanks Jerome, where can I make the changes?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
6 years 1 day ago #300766

Hello,

Unfortunately, it will be very hard to tell.
It might require some modifications in the HikaShop core ; but it might also be possible to do it just with a plugin...

As said previously, it require a custom development.

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.104 seconds
Powered by Kunena Forum