how do I pass product price to controller

Hi all I have a file called addon/my_addon/controller/customer/products.pre.php containing

from the products page I would like to retrieve the product price to this page so i can process it.





if ($mode == 'view') {
$the_price = $view->get_var('???????');
$view->assign('the_price', $the_price);
}

?>


can some one point me in the right direction pls.

Cheers'

I think that for what you want to do you want to use products.post.php. This is called AFTER the system has retrieved data and processed the parameters. In this you would:


$product = $view->get_var('product');
$product['price'] = my_price_modification_function();
$view->assign('product', $product);




A PRE controller is generally used when you need to process your own parameters and/or modify those that are coming INTO the controller BEFORE the system processes the request.

Awesome tbirnseth…

After some testing I got it to work thanks for the pointer…



starting to understand controllers…



/P



Merry Xmas all…

hmm question can´t quick view use same controller as product page ?

No idea what you're asking…

I have added a block to product page that takes the price of the product and processes it in customer/products.post.php and returns the result fine, but when you click on quick view on products listing page the block appears in quick view but don't seem to process the price…



/P

Different 'views' request different data from the database. Are you sure whatever view you are looking at has the original price info for you to manipulate?