Building Plugin

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

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

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

Regards
10 年 前
GREAT!!!

Thank you!
10 年 前
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 年 前
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.