Hi guys, I want to give each user the ability to "manage their inventory". First of all is this the right way to do it? or is there an easier way? maybe inventory module or something? secondly, id so, how do I manipulate the code to have it function for each user and maybe by category?
<?php
$sql = 'SELECT e.nid, n.title, e.sku, e.price, e.is_recurring, e.price_interval, e.price_unit, e.price_cycle, e.auto_charge, e.ptype, e.hide_cart_link FROM {ec_product} e INNER JOIN {node} n where n.nid = e.nid
ORDER BY e.ptype, n.title';
$result = db_query($sql);
while ($anode = db_fetch_object($result)) {
$items[]= array(l($anode->nid,'node/'.$anode->nid) ,
$anode->ptype,
$anode->title,
$anode->sku,
$anode->price,
($anode->is_recurring ? 'Yes' : 'No'),
($anode->price_interval == 0 ? NULL :
$anode->price_interval),
($anode->price_unit == '0' ? NULL : $anode->price_unit),
($anode->price_cycle == 0 ? NULL : $anode->price_cycle),
($anode->hide_cart_link ? 'No' : 'Yes'),
l('edit','node/'.$anode->nid.'/edit')
);
}
print theme('table', array('Node','Type','Title', 'SKU','Price','Recur','Intvl','Unit','Cycle','Cart',''), $items);