$view_parameters not working in shop module

Author Message

Lars Eirik R

Tuesday 27 July 2010 5:51:44 am

Hi.

I have created a custom accounthandler which needs to redirect with some additional parameters to the /shop/basket view if a user has not accepted terms.

I am currently using ezpublish 4.1.3.

When trying to output the $view_parameters debug info lets me know that this variable is not defined.

Is this a bug? is there another way for me to redirect to another module and include user_params?

Thiago Campos Viana

Tuesday 27 July 2010 5:58:14 am

Hi

You can pass your variables by get or post methods and retrieve values using http template operator, see: http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp

Also http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp_hasvariable

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Lars Eirik R

Tuesday 27 July 2010 6:14:27 am

i guess i could, but the problem is that this ezhttp operator is not stable when it comes to caching and such.

I had a look at basket.php and it turned out that no parameters are passed, neither view_parameters, or user_params.

I guess i have three options: 1 use ezhttp, create a new module to handle the basket (lame..) or hack the kernel (lame..)

thanks for answering.

Thiago Campos Viana

Tuesday 27 July 2010 6:57:51 am

if you plan create a new module or hack the kernel you could pass view_parameters variables to the called template with this piece of code:

...
$uri = eZURI::instance( eZSys::requestURI() );
$viewParameters = $uri->UserParameters();
$tpl->setVariable( 'view_parameters', $viewParameters );
...

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

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 04:58:19
Script start
Timing: Jan 18 2025 04:58:19
Module start 'layout'
Timing: Jan 18 2025 04:58:19
Module start 'content'
Timing: Jan 18 2025 04:58:20
Module end 'content'
Timing: Jan 18 2025 04:58:20
Script end

Main resources:

Total runtime0.8290 sec
Peak memory usage4,096.0000 KB
Database Queries61

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.4922152.6406
Module start 'layout' 0.00480.0024 742.132839.4766
Module start 'content' 0.00710.8202 781.6094561.8984
Module end 'content' 0.82740.0016 1,343.507812.1250
Script end 0.8289  1,355.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4104160.0002
Check MTime0.00140.1698160.0001
Mysql Total
Database connection0.00070.089410.0007
Mysqli_queries0.775293.5180610.0127
Looping result0.00080.0910590.0000
Template Total0.800996.620.4005
Template load0.00220.263820.0011
Template processing0.798796.349720.3994
Template load and register function0.00010.010210.0001
states
state_id_array0.00080.095310.0008
state_identifier_array0.00100.118720.0005
Override
Cache load0.00190.2323300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.076620.0003
Fetch class attribute name0.00140.170860.0002
XML
Image XML parsing0.00080.099520.0004
class_abstraction
Instantiating content class attribute0.00000.002080.0000
General
dbfile0.00170.2037220.0001
String conversion0.00000.000740.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs