Building Plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 10 años
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.
Hace 10 años
Implement a widget plugin (IWidgetPlugin). Use "productbox_add_info" widget name
Hace 10 años
Thanks Andrei,

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

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

Regards
Hace 10 años
GREAT!!!

Thank you!
Hace 10 años
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?
Hace 10 años
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.