Developer forum

Forum » Development » Bug in "Amazon - Free Shipping"

Bug in "Amazon - Free Shipping"


Reply
After an update to the latest release (19.03.1 to 19.1.0.5), there is a bug in this custom module:

http://engage.dynamicweb.dk/Show-Article-361.aspx?PID=2472&ArticleID=153

After an update of the DLL references in VS I get this bug:

Member Dynamicweb.eCommerce.Frontend.Renderer.RenderPriceInfo(Dynamicweb.Ecommerce.Prices.IPriceInfo, Dynamicweb.TemplateV2.Template, string)' cannot be accessed with an instance reference; qualify it with a type name instead.

My code looks as the example above:

Renderer rnd = new Renderer();
-//-
rnd.RenderPriceInfo(Remaing, Template, "RemainingPrice");
rnd.RenderPriceInfo(FeeAmount, Template, "FreeShippingValue");
rnd.RenderPriceInfo(Price.GetDoublePriceInfo(FreeShippingLimit, Dynamicweb.eCommerce.Common.Context.Currency), Template, "FreeShippingLimit");

###


The Server Error in '/' Application:

Method not found: 'Void Dynamicweb.eCommerce.Frontend.Renderer.RenderPriceInfo(Dynamicweb.eCommerce.Prices.IPriceInfo, Dynamicweb.Templatev2.Template, System.String)'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: 'Void Dynamicweb.eCommerce.Frontend.Renderer.RenderPriceInfo(Dynamicweb.eCommerce.Prices.IPriceInfo, Dynamicweb.Templatev2.Template, System.String)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[MissingMethodException: Method not found: 'Void Dynamicweb.eCommerce.Frontend.Renderer.RenderPriceInfo(Dynamicweb.eCommerce.Prices.IPriceInfo, Dynamicweb.Templatev2.Template, System.String)'.]
   AddMoreAndGetFreeShipping.AddMoreAndGetFreeShipping.ExtendTemplate(Template Template, TemplateExtenderRenderingState RenderingState) +0
   Dynamicweb.eCommerce.Frontend.Renderer.RenderOrderTemplateExtenders(Order Order, Template Template, TemplateExtenderRenderingState RenderingState) +605
   Dynamicweb.eCommerce.Frontend.Renderer.RenderOrderDetails(Template template, Order order, Boolean extendedProperties) +58
   Dynamicweb.eCommerce.Frontend.Renderer.RenderOrder(Order Order, Template Template, Boolean ExtendedProperties, Int32 stepReq) +31
   Dynamicweb.eCommerce.Frontend.Cart.CartPageTemplateExtender.RenderTemplate(Template Template) +65
   Dynamicweb.Frontend.PageView.RenderPageTemplateExtenders(Template Template) +578
   Dynamicweb.Frontend.PageView.SetPageTemplateValues() +12155
   Dynamicweb.Frontend.PageView.Output() +189
   Dynamicweb.Frontend.PageviewControl.ParseControls() +33
   Dynamicweb.Admin.Load.Page_Load(Object sender, EventArgs e) +166
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3614
###

Can anyone tell me what goes wrong?

Replies

 
Reply
Hi there,

Looks like the method was changed from an instance method to a static method which is a breaking API change. Reflector says this for an older version of Dynamicweb:

public void RenderPriceInfo(IPriceInfo Price, Template Template, string TagName)

and this for the 19.1.0.5 version of Dynamicweb.dll:

public static void RenderPriceInfo(IPriceInfo Price, Template Template, string TagName)

Not sure if this is a deliberate change, or a bug that needs to be undone. For now, simply use the static method instead:

Renderer.RenderPriceInfo(Remaing, Template, "RemainingPrice");

Hope this helps,

Imar
 
Reply
Great Imar,
Thanks a lot - that did work out ;)

/Morten


 
Reply
Sorry, forgot to make it (that) forward compatible;-)

 

You must be logged in to post in the forum