Manual

shoplist.class.php

Shoplist management

Usage:

{{lang:php}}
// INITIALIZATION
// constructor new shoplist($db, $user_id[, $extra = '1']);
$SL = new shoplist($DB, $_SESSION['user_id'], 'cid = 3'); // $DB is the object from sql class, $extra sets additional condition to users id
// Every user has one shopping list

//ITEMS
$SL->get_items(); // gets all shoplist items for current user
$SL->add_item(22); // puts market product ID 22 onto user's shoplist
$SL->remove_item(14); // removes market product ID 14 from user's shoplist
$SL->remove_shoplist(); // removes all items from user's shoplist
Try myPortal 2: