
My customer service department asked me for this change to make it easier to take phone orders. Our install of 5.5.4 was behaving erratically in policing available items while placing orders. Sometimes it would warn of insufficient stock, and sometimes would not, so my customer service people were having to look up stock levels on items manually to be certain it was available.
6.1.1 seems to be policing this more effectively, but I went ahead and did the mod anyway as it will be easier when talking with customers not to have to add the item to the order before getting feedback from the cart on stock levels, or play guess the stock level if there are less available than the customer wants.
Please note that to keep this manageable for what I personally needed, I made one huge assumption here, and that is that all products are being tracked in inventory, and that product variations are not being used. You can probably make changes yourself if those assumptions are not true for you. This mod is for 6.1.1.
1. Open: /admin/includes/classes/class.remote.orders.php
Find the function editOrderItemSearchAction() and find this code around line 1360:
Code: Select all
$results[] = array(
'id' => $product['productid'],
'name' => $product['prodname'],
'link' => prodLink($product['prodname']),
'sku' => $product['prodcode'],
'isConfigurable' => $isConfigurable,
'price' => $price
);
Code: Select all
// MOD Added Inventory Level to results array so customer service can see it immediately. -LA
$results[] = array(
'id' => $product['productid'],
'name' => $product['prodname'],
'link' => prodLink($product['prodname']),
'sku' => $product['prodcode'],
'isConfigurable' => $isConfigurable,
'price' => $price,
'inventory' => $product['prodcurrentinv']
);
and find this code around line 1112
Code: Select all
var sku = '';
if (result.sku) {
sku = result.sku + ' / ';
}
var details = $('<div class="productDetails">' + sku + result.price + '</div>');
Code: Select all
var sku = '';
if (result.sku) {
sku = result.sku + ' / ';
}
var inventory = '(N/A)';
if (result.inventory) {
inventory = ' (' + result.inventory + ' in stock)';
}
var details = $('<div class="productDetails">' + sku + result.price + inventory + '</div>');