Revision: 69325
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 30, 2015 17:25 by hungryweb
Initial Code
function fn_hw_product_stock($product_id){ $values = db_get_row("SELECT amount, tracking FROM ?:products WHERE product_id = ?s LIMIT 1", $product_id); $amount = $values['amount']; if($values['tracking'] == 'O'){ $options_amount = db_get_row("SELECT SUM(amount) as amount FROM ?:product_options_inventory WHERE product_id = ?s LIMIT 1", $product_id); $amount = $options_amount['amount']; } return $amount; }
Initial URL
https://www.hungryweb.net/cs-cart-addons/
Initial Description
PHP function that returns product amount wich can be used in any custom development
Initial Title
Get Product Amount
Initial Tags
Initial Language
PHP