Checking if a product is in an order ?

Author Message

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/

H-Works Agency

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 ?

Martin

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 09:14:22
Script start
Timing: Jan 19 2025 09:14:22
Module start 'layout'
Timing: Jan 19 2025 09:14:22
Module start 'content'
Timing: Jan 19 2025 09:14:24
Module end 'content'
Timing: Jan 19 2025 09:14:24
Script end

Main resources:

Total runtime1.2548 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 589.1563152.6250
Module start 'layout' 0.00620.0033 741.781339.4609
Module start 'content' 0.00951.2428 781.2422538.0313
Module end 'content' 1.25230.0024 1,319.273412.1563
Script end 1.2547  1,331.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2707160.0002
Check MTime0.00130.1023160.0001
Mysql Total
Database connection0.00100.077710.0010
Mysqli_queries1.199095.5503570.0210
Looping result0.00070.0551550.0000
Template Total1.212796.620.6063
Template load0.00230.182920.0011
Template processing1.210496.458820.6052
Template load and register function0.00010.007710.0001
states
state_id_array0.00250.198810.0025
state_identifier_array0.00330.263120.0017
Override
Cache load0.00190.1509220.0001
Sytem overhead
Fetch class attribute can translate value0.00100.076120.0005
Fetch class attribute name0.00100.079750.0002
XML
Image XML parsing0.00130.099820.0006
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00120.0935230.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs