Closed Lepozepo closed 11 years ago
Here is some code straight out of my app you will need the latest copy of the VendAPI class which I've just committed
after setup of $vendapi
object...
$sale = new \VendAPI\VendSale(null, $vendapi);
$sale->register_id = $register_id;
$sale->customer_id = $customer_id;
$sale->status = 'OPEN';
$products = array();
foreach ($items as $item) {
$products[] = array(
'product_id' => $item->product_id,
'quantity' => $item->quantity,
'price' => $item->price
);
}
$sale->register_sale_products = $products;
$sale->save();
echo "Created new order with id: ".$sale->id;
This is great! Thank you so much for spending time on this!
I've looked over the sdk but I can't find any functions to create a new order/sale. Is there any way to do this? Thank you for spending time on this!