I have just added a new category with different products with limited quantities (an operation to raise funds for hospitals).
Here's an example: I put a jersey online indicating a stock of 6 products for size 2. Problem: it is possible to order 80 jerseys of this size, without having indicated that the product is out of stock.
Problem #2 : J I have set up a product rule of 20%. So the price is displayed with the discount, but I can't see the old crossed-out price?
#1 For the solution you have to set backorder yes then product will never go to out of stock status.
But if you are set backorder and product is already out of stock then it will not work, for this you need to change product in stock.
For this try then set product qty 1 and set backorder yes and buy 10 product,then you will see product stock set -9 but it will still show in stock.
You need to Override file for some changes. Vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml to Vendor/theme/Magento_ConfigurableProduct/templates/product/price/final_price.phtml
the change around line 22.
<?php if (!$block->isProductList() && $block->hasSpecialPrice()): ?> replace by <?php if ($block->hasSpecialPrice()): ?>
[special_price will display]
and <span class="old-price sly-old-price no-display"> replace by <span class="old-price sly-old-price">
[remove the no-display class]
Let me know if any issues
If my answer is useful, please Accept as Solution & give Kudos