Forums / General / Checking if a product is in an order ?
H-Works Agency
Wednesday 17 January 2007 1:40:59 am
I have a ezp extension that automatically synchronize products with a shop stock software.
This synchronisation is made with a csv file and the "diff" command.
Before deleting products i need to check if they are in an order or not : How can i do that as i see no fetch function for "order".
Martin
EZP is Great
Eirik Alfstad Johansen
Thursday 18 January 2007 9:30:45 am
Hi Martin,
To fetch order:
$order = eZOrder::fetch( $OrderID );
Products in order:
$items = $order->productItems();
Remember to include kernel/classes/ezorder.php
Sincerely, Eirik Alfstad Johansen http://www.netmaking.no/
Thursday 18 January 2007 9:36:00 am
Thanx a lot for your help.
What if i have no orderID ?
Do i have to fetch all orderIDS then check products in those orders ?