Error when using tempinv.php file (v. 2.9 - 2.92)
When using the temporary inventory file (tempinv.php), the item cannot be ordered. This will be corrected in 2.93. For now:
-
Open the order.php file in the /go/ folder.
-
Change the code:
// GET DYNAMIC RETURN if (substr_count($return, $catpg) == 0) $errreturn = $Catalog_Page ."?item=" .$productid; else $errreturn = SB_SSL_SITE .$return;
to:
// STATIC RETURN $basestaticurl = str_replace(array('http://', 'https://'), '', trim($urldir, '/')); $staticcatpg = $basestaticurl . '/' . $Cat_Dir; // GET DYNAMIC RETURN if (!empty($productid)) $errreturn = doItemLink('getlinkname', $productid, 'auto'); else $errreturn = SB_SSL_SITE .$return; $errseparator = strpos($errreturn, '?' === false) ? '?' : '&'; -
Change the code:
$chkquery = "SELECT Inventory AS InvQty FROM " .SB_DB_PREFIX ."_items WHERE ID='$productid' AND Inventory > 0";
to:
$chkquery = "SELECT Inventory AS InvQty, ID FROM " .SB_DB_PREFIX ."_items WHERE ID='$productid' AND Inventory > 0";
-
Change every instance of:
$errmsg = "$errreturn&err=y
to:
$errmsg = $errreturn . $errseparator . "err=y
Open the tempinv.php in the /go/ folder.
-
Change all instances of:
$chkrow['Quantity']
to:
$chkrow['InvQty']