You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First I would like to give many thanks for your great effort to making unicenta web frontend in PHP. I am using your code. Everything seems to work for me except few changes on db connection script.
I am facing problem while validating product stock using instock function. in uniCenta oPos 3.70 there is no table found named VARIATIONSET and VARIATION. Do you have any idea in this ? Thanks !!
function instock($dbc, $productId, $variationFlag = false)
{
/* Checks if a product is in stock by looking
* for at-leat ONE item instock for the $productId in
* the VARIATIONSET table.
*
* If the $variationFlag is set, $productId is presumed to be a
* variationset id, in the VARIATIONSET table. The function then checks only
* the specified product variation stock level, for example
* only checking a 'Black T-shirt' in size 'small'
*/
$productId = cleanString($dbc, $productId);
$q = "
SELECT VALUE,
ATTRIBUTEVALUE.ID AS 'AttrId'
FROM PRODUCTS
JOIN VARIATIONSET ON
PRODUCTS.ID = VARIATIONSET.FK_PRODUCT_ID
JOIN VARIATION ON
VARIATIONSET.ID = VARIATION.FK_VARIATION_SET
JOIN ATTRIBUTEVALUE ON
VARIATION.FK_ATTRIBUTE_VALUE = ATTRIBUTEVALUE.ID
JOIN ATTRIBUTE ON
ATTRIBUTEVALUE.ATTRIBUTE_ID = ATTRIBUTE.ID
WHERE PRODUCTS.ID = '$productId'
AND VARIATIONSET.STOCK_LEVEL > 0
GROUP BY VALUE";
if($variationFlag)
{
$q = "SELECT STOCK_LEVEL FROM VARIATIONSET
WHERE ID = '$productId'";
}//End $variationFlag is set, only check stock level for that specific product variation
$r = mysqli_query($dbc, $q);
if(mysqli_num_rows($r) > 0) //Atleast one product variation in-stock
{
return true;
}else{
return false; //Product is not in-stock
}
}//End instock($dbc, $productId)
The text was updated successfully, but these errors were encountered:
First I would like to give many thanks for your great effort to making unicenta web frontend in PHP. I am using your code. Everything seems to work for me except few changes on db connection script.
I am facing problem while validating product stock using instock function. in uniCenta oPos 3.70 there is no table found named VARIATIONSET and VARIATION. Do you have any idea in this ? Thanks !!
The text was updated successfully, but these errors were encountered: