Building Plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hi everyone,

I would like to develop a plugin that render itself inside ProductBox view near the price of the product.

How can I know which product is rendering each time?

Is it my question clear?

Thanks, Domenico.
10 years ago
Implement a widget plugin (IWidgetPlugin). Use "productbox_add_info" widget name
10 years ago
Thanks Andrei,

but how can I know which product is rendering each time?
10 years ago
You can get current route values (productId parameter)
10 years ago
Oh, ok! Thanks!!!

There's an example?
10 years ago
int Productid = Convert.ToInt32(System.Web.HttpContext.Current.Request.RequestContext.RouteData.Values["productId"]);

Regards
10 years ago
GREAT!!!

Thank you!
10 years ago
There's a problem...

If I put my plugin in "productdetails_after_pictures" zone I can get the ProductId with the code line

int Productid = Convert.ToInt32(System.Web.HttpContext.Current.Request.RequestContext.RouteData.Values["productId"]);

but in the zone "productbox_add_info" I don't have this data. The only RouteData I've are the controller and the method.

How can I get the ProductId in that zone?
10 years ago
Please see chnageset 6e51817414a4. Now developers can access "additional data" in widgets. "PublicInfo" method of widgets supports optional "additionalData" parameter. For example, you can get current product ID when implementing a widget for product box ("productbox_add_info" widget zone). Also updated all widget zones with appropriate addional data.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.