Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Restocked but remains out of stock

Restocked but remains out of stock

Locked
This thread is locked. New replies are disabled.
6 Jan 2008, 11:35 AM
#1
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

Post #1 by cochlear

I have an item that has inventory quantity of 1. Now, a test customer buys it, and completes checkout. Because this is a test order, I deleted the order straight away, and clicked "restock" in the same process. Then I browse the store, but that item is still out of stock. So I have to go back to admin and change the stock status back to "in stock".

I'm just curious if this is the way it's supposed to work or it's just me?

6 Jan 2008, 12:26 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Post #2 by kuroi

This is how it works, but if you wished restocked products to always be immediately available again, you could tweak the restock function as follows:

find the following line in the zen_restock_order function in admin/includes/functions/general.phpphp set products_quantity = products_quantity + " . $order->fields['products_quantity'] . ", products_ordered = products_ordered - " . $order->fields['products_quantity'] . " where products_id = '" . (int)$order->fields['products_id'] . "'"); and change it to```php
set products_status = 1, products_quantity = products_quantity + " . $order->fields['products_quantity'] . ", products_ordered = products_ordered - " . $order->fields['products_quantity'] . " where products_id = '" . (int)$order->fields['products_id'] . "'");

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

6 Jan 2008, 1:04 PM
#3
cochlear avatar

cochlear

Zen Follower

Join Date:
Apr 2007
Location:
Sydney
Posts:
110
Plugin Contributions:
0

Post #3 by cochlear

kuroi thank you! I'll certainly use that code, because that's less confusing for me :smile: