Overriding GetTotalStockQuantity from Nop.Services

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

Within the ProductExtensions class we have method that returns our product stock quantity. My customer has partner providing him APIs which exposes stock available for order.

since this is dynamic he needs to control this before customers makes purchase. So my question would be how do I go about making sure that if product is of a specyfic type a different logic would be applied ?

i.e. adding something in lines of

            if (product.isCustomValue == true)
            {

                // http async Call to external partner for stock

                return result_of_call;

            }
5 years ago
rafPe wrote:
Hey ,

Within the ProductExtensions class we have method that returns our product stock quantity. My customer has partner providing him APIs which exposes stock available for order.

since this is dynamic he needs to control this before customers makes purchase. So my question would be how do I go about making sure that if product is of a specyfic type a different logic would be applied ?

i.e. adding something in lines of

            if (product.isCustomValue == true)
            {

                // http async Call to external partner for stock

                return result_of_call;

            }


Anyone has any idea how to do this? As the first post says, this is an extension, which is a static. Cannot be overrided.

GetTotalStockQuantity should really be a service method, and not an extension. Too much logic for an extension
4 years ago
I'm stuck on the same issue, does anyone solved has been able to handle this?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.