$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.