Validate stock in select payment method

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

I want to know, how can I validate the stock when I'm in onepagechekout page in the select payment method step, I mean, when select Credit card, validate the stock of the products in the cart, and if there is one above stock zero, show me an alert.
6 years ago
igonzalez wrote:
Hi all,

I want to know, how can I validate the stock when I'm in onepagechekout page in the select payment method step, I mean, when select Credit card, validate the stock of the products in the cart, and if there is one above stock zero, show me an alert.


It would require customization.  Would you explain more about what you are trying to do ...
What do you mean by "there is one above stock zero"?
Does "show me an alert" mean that you also want to prevent the checkout from continuing?
6 years ago
Hi,  

First: I have nopCommerce 4.0
Second: I configured my products with the option "Backorder: Allow qty below 0"
Third: I want to prevent the checkout continuing if the customer choose credit card as payment method (only that payment method), I mean, if the customer use credit card payment method verify the stock, if the stock = 0 prevent the checkout continuing, else continue normaly

Thanks for your help
Israel
6 years ago
It's going to require customization.  Ideally a plugin, but probably could be done 'quick & dirty' in the checkout/confirm .cshtml file using Resolve to get to the service methods needed (or query) to check the stock.
6 years ago
Hi,

I found the solution. I did a customization in the CheckoutController, in OpcLoadStepAfterPaymentMethod function.

Thanks anyway
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.