When item goes to 0 stock status changes

Ask the community for help and support.
Post Reply
lambro28
Posts: 50
Joined: Sun Jan 03, 2021 2:47 pm
Has thanked: 10 times
Been thanked: 6 times

When item goes to 0 stock status changes

Post by lambro28 »

Using v1.0.8.0 and every time we sell the last one of a product, it changes the status to X so customers are no longer able to see it. How do I stop this from happening, so customers can still see the product.
User avatar
mhsuffolk
VIP Member
VIP Member
Posts: 146
Joined: Sat Oct 26, 2019 9:13 am
Has thanked: 8 times
Been thanked: 5 times

Re: When item goes to 0 stock status changes

Post by mhsuffolk »

If you still want to take orders for the item,
In your admin. Configuration >> Stock. Change "Allow Checkout" to true

https://github.com/CE-PhoenixCart/Phoen ... _stock.php
Last edited by ecartz on Thu Apr 28, 2022 11:25 am, edited 1 time in total.
Reason: Check Stock does not affect product_status, just Allow Checkout and Subtract Stock.
Live shop Phoenix 1.0.9.0 on PHP 8.0
heatherbell
VIP Member
VIP Member
Posts: 1996
Joined: Mon Oct 07, 2019 4:39 am
Has thanked: 26 times
Been thanked: 175 times

Re: When item goes to 0 stock status changes

Post by heatherbell »

lambro28 wrote: Wed Apr 27, 2022 5:03 pm Using v1.0.8.0 and every time we sell the last one of a product, it changes the status to X so customers are no longer able to see it.
Just tested this behaviour on a new default install and it does not do that, the product status remains as In Stock and admin>Stock - Check stock level, Subtract stock and Allow checkout are all set to true by default.
I don't know if this default behaviour has changed since 1.0.8.0 but I don't think so.
lambro28
Posts: 50
Joined: Sun Jan 03, 2021 2:47 pm
Has thanked: 10 times
Been thanked: 6 times

Re: When item goes to 0 stock status changes

Post by lambro28 »

heatherbell wrote: Thu Apr 28, 2022 10:03 am
lambro28 wrote: Wed Apr 27, 2022 5:03 pm Using v1.0.8.0 and every time we sell the last one of a product, it changes the status to X so customers are no longer able to see it.
Just tested this behaviour on a new default install and it does not do that, the product status remains as In Stock and admin>Stock - Check stock level, Subtract stock and Allow checkout are all set to true by default.
I don't know if this default behaviour has changed since 1.0.8.0 but I don't think so.
Thanks Heather, it is not a fresh V1.0.8.0, it has been updated with the official updates as they have been done. I think I started with Pheonix around 1.04...... and carried on from there.

Any one have an idea where I would look.
I have been told oscommerce used to do this, so maybe some old code left in from a much earlier phoenix version?
User avatar
Kofod95
VIP Member
VIP Member
Posts: 605
Joined: Sat Feb 06, 2021 7:38 pm
Has thanked: 80 times
Been thanked: 141 times

Re: When item goes to 0 stock status changes

Post by Kofod95 »

https://github.com/CE-PhoenixCart/Phoen ... ck.php#L36

I think here.
You could probably overwrite it.
You could probably also make a hook or a module at checkout_success that makes sure all bought products are given a products_status of '1'.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
Post Reply