Forums / Setup & design / List orders by customers

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

eZ debug

Timing: Jan 17 2025 22:56:52
Script start
Timing: Jan 17 2025 22:56:52
Module start 'content'
Timing: Jan 17 2025 22:56:52
Module end 'content'
Timing: Jan 17 2025 22:56:52
Script end

Main resources:

Total runtime0.7699 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 588.8281180.8359
Module start 'content' 0.00830.7554 769.6641609.1797
Module end 'content' 0.76370.0062 1,378.843846.1094
Script end 0.7699  1,424.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4153140.0002
Check MTime0.00130.1724140.0001
Mysql Total
Database connection0.00120.152810.0012
Mysqli_queries0.712192.4864660.0108
Looping result0.00060.0835640.0000
Template Total0.737795.820.3688
Template load0.00220.280820.0011
Template processing0.735595.526720.3677
Template load and register function0.00020.027110.0002
states
state_id_array0.00100.133610.0010
state_identifier_array0.00080.097920.0004
Override
Cache load0.00180.2282300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.073930.0002
Fetch class attribute name0.00130.174370.0002
XML
Image XML parsing0.00360.469730.0012
class_abstraction
Instantiating content class attribute0.00000.002680.0000
General
dbfile0.00640.8323260.0002
String conversion0.00000.000830.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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