When item goes to 0 stock status changes

Open to all! Ask other shopowners for help.
Post Reply
lambro28
Member
Posts: 62
Joined: Sun Jan 03, 2021 2:47 pm
Phoenix Version: v1.1.0.6
Has thanked: 11 times
Been thanked: 8 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 13 times
Been thanked: 11 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.
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 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
Member
Posts: 62
Joined: Sun Jan 03, 2021 2:47 pm
Phoenix Version: v1.1.0.6
Has thanked: 11 times
Been thanked: 8 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
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply