Developer forum

Forum » Development » Caching on Product.UnitStock

Caching on Product.UnitStock

Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

We have a critical issue with caching on Product.UnitStock in 9.4.9, which means that the UnitStock is not updated before this method is called: ValidateOrder(settings As ModuleSettings, order As Order)

 

Can you please make sure that the UnitStock is reloaded before doing the validation? Right now we have a shop which are able to sell items which are not in stock.

 

Hope you are able to have this corrected in the next hotfix?

 

Best regards, Anders


Replies

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Anders,

Sorry for a bug - we will fix it asap.
I registered it: Bug 49097 Product UnitStock is not updated

Kind regards,
Vladimir

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi Vladimir,

 

Do you have some sort of workaroud for the this? Can I with an observer reload the UnitStock before the validation?

 

Best regards, Anders

 
Vladimir Shushunov Dynamicweb Employee
Vladimir Shushunov
Reply

Hi Anders,

Althought I don't sure that this is the best workaround:

1. use AfterCustomerAcceptedValueIsSet notification
2. use reflecton:

                    Dim stockField As FieldInfo = _prod.GetType().GetField("_unitStock", BindingFlags.NonPublic or BindingFlags.Instance)
                    If stockField IsNot Nothing Then  stockField.SetValue(_prod, Nothing)

Best regards,
Vladimir

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi DW,

 

Is this issue fixed in 9.4.10?

 
Nicolai Pedersen
Reply

No, it did not make it. But will be out with a release of Dynamicweb.Ecommerce shortly (tomorrow)

 
Morten Buhl Dynamicweb Employee
Morten Buhl
Reply

Fix has been released in package Dynamicweb.Ecommerce 1.4.33 and is available from MyGet. It will also be included in 9.4.11 whenever that is released.

/Morten Buhl, DW

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Anders

Problem with product unitstock not updating is now fixed in version 9.4.11

To upgrade please choose this version from backend or download from here:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1

 

You must be logged in to post in the forum