List orders by customers

Author Message

Nicolas OTTAVI

Tuesday 13 December 2005 2:28:01 am

Hi,

I want to give access to the orderlist to my customers. How should I do ?
the orderlist/ or custumerorderview lead me to an access denied errror, and I can't found any policy rules allowing users to see these precious information.

Thanks for your help,
C.

Łukasz Serwatka

Tuesday 13 December 2005 11:53:31 pm

Hi Claude,

You will have grant access to module "shop" and function "administrate". Then your users will have access to shop/orderlist and to shop/customerlist

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Nicolas OTTAVI

Wednesday 14 December 2005 2:36:36 am

Thanks for the answer Lukasz,

but with such rights a customer can see all orders made on the shop. It seems we can not limitate this right to his <b>own</b> orders.

That's an issue to my point of view ? I will probably post a "enhancement report", what do you think about it ? Is it relevant ?

thanks,
C.

Łukasz Serwatka

Wednesday 14 December 2005 11:44:00 pm

Yes, for now there is no fetch function for orders. However you can create new siteaccess with access to shop/orderlist. or use public and override template:

design/standard/templates/shop/orderlist.tpl

There is array $order_list, you can look can compare current user_id with user_id from order

{let current_user=fetch( user, current_user )}
{section name="Order" loop=$order_list sequence=array(bglight,bgdark)}
    {section show=eq( $Order:item.user_id, $current_user.contentobject_id )}
        display something here
    {/section}
{/secction}
{/let}

You will have to count of order per user in loop and store it in $order_list_count and pass to google navigator.

This should work. Feel free to report new enhancement.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Lo' F.

Wednesday 01 June 2011 9:09:50 am

or...

{let current_user=fetch( user, current_user )}
{section name="Order" loop=$order_list sequence=array(bglight,bgdark)}
{section-exclude match=$Order:item.user_id|ne($current_user.contentobject_id)}
        display something here
{/section}
{/let}

loredanaebook.it

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 18 2025 02:05:06
Script start
Timing: Jan 18 2025 02:05:06
Module start 'layout'
Timing: Jan 18 2025 02:05:06
Module start 'content'
Timing: Jan 18 2025 02:05:07
Module end 'content'
Timing: Jan 18 2025 02:05:07
Script end

Main resources:

Total runtime0.6722 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 587.9141152.6250
Module start 'layout' 0.00440.0031 740.539139.4453
Module start 'content' 0.00750.6632 779.9844604.1016
Module end 'content' 0.67070.0014 1,384.085912.1641
Script end 0.6721  1,396.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4540160.0002
Check MTime0.00120.1845160.0001
Mysql Total
Database connection0.00060.088710.0006
Mysqli_queries0.616291.6761650.0095
Looping result0.00070.1046630.0000
Template Total0.644695.920.3223
Template load0.00190.280420.0009
Template processing0.642795.615820.3214
Template load and register function0.00010.022210.0001
states
state_id_array0.00090.136310.0009
state_identifier_array0.00100.150620.0005
Override
Cache load0.00160.2405300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.093730.0002
Fetch class attribute name0.00100.151070.0001
XML
Image XML parsing0.00150.228030.0005
class_abstraction
Instantiating content class attribute0.00000.003080.0000
General
dbfile0.00160.2402240.0001
String conversion0.00000.001040.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs