Martin L uniag Posted September 23, 2020 Share Posted September 23, 2020 Hello, I would like to ask a question, if it is possible to set up the availability/disabilty to order a product when it's stock level is more than 0. The reason is that sometimes we have 50 customers ordering the same product at the same time. We only allow bank wire payments and before they agree to terms and conditions and click the order button, the product is sold out. We have the low-stock level set to 5, but Prestashop only sends a general notification (not even related to a specific product) that something in stock is only 5 pcs. We would like to have it set up in a way, that when the stock-level reaches 5 - it will disable ordering this product. I hope I wrote it clearly and is it possible to set it up this way without having to buy some kind of a module? Thank you in advance for assistance. Martin Link to comment Share on other sites More sharing options...
joseantgv Posted September 23, 2020 Share Posted September 23, 2020 I think this is what you need https://addons.prestashop.com/en/price-management/26993-hide-or-show-price-and-disallow-purchase.html Link to comment Share on other sites More sharing options...
Martin L uniag Posted September 24, 2020 Author Share Posted September 24, 2020 (edited) So the answer is that it is not possible to set it up without buying another module? We do not have the best experience with various modules from developers around the globe, after updates and upgrades on the servers and even the Prestashop system, they don't work and have to be re-set by the developers. Edited September 24, 2020 by Martin L uniag (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted September 24, 2020 Share Posted September 24, 2020 hace 1 hora, Martin L uniag dijo: So the answer is that it is not possible to set it up without buying another module? It's not configurable. Of course you can modify core to include this functionality instead of buying a module. Link to comment Share on other sites More sharing options...
Martin L uniag Posted September 24, 2020 Author Share Posted September 24, 2020 And by modyfying the core, you mean altering the code in PHP? Would this be more stable during updates? And do you have any advice to where to find the right file and how edit the code? Link to comment Share on other sites More sharing options...
Martin L uniag Posted September 28, 2020 Author Share Posted September 28, 2020 No help for this question? Link to comment Share on other sites More sharing options...
Martin L uniag Posted September 28, 2020 Author Share Posted September 28, 2020 ok, I found this piece of code (lines 64 - 67) in the StockManager.php in the Prestashop core: if ($product->pack_stock_type == Pack::STOCK_TYPE_PRODUCTS_ONLY || $product->pack_stock_type == Pack::STOCK_TYPE_PACK_BOTH || ($product->pack_stock_type == Pack::STOCK_TYPE_DEFAULT && $configuration->get('PS_PACK_STOCK_TYPE') > 0) Now, we are a University Publishing and since it is the beginning of the winter term, our eshop is running at max speed. So before I do any damage to the live system, I just would like to ask, that: if I alter the "> 0" to "> 3" in the last line of code pasted above, will we get the result we are looking for (that the system will consider the product is out of stock at level 3)? Link to comment Share on other sites More sharing options...
musicmaster Posted September 28, 2020 Share Posted September 28, 2020 I don't think this is what you are looking for. "pack_stock_type" is about bundling several products from your catalogue together and selling the set as one product. Link to comment Share on other sites More sharing options...
Marie59 Posted September 30, 2022 Share Posted September 30, 2022 Hello, I currently have the same issue. I have a lot of products with low stock and I have to refund my customers because they have been sold meanwhile. Is there a way to automatically disallow the order of low stock level products without disabling them ? I want them to still be visible on the website and to be automatically saleable when stock is > 3 for example. I don't think the plugin mentioned above disallow/allow the order of the products automatically. I can't test it, the demo is not working. Does anyone has a solution or knows a plugin who does that ? Thank you very much ! have a nice day ;) Link to comment Share on other sites More sharing options...
c64girl Posted July 3, 2024 Share Posted July 3, 2024 (edited) On 9/30/2022 at 9:44 AM, Marie59 said: Hello, I currently have the same issue. I have a lot of products with low stock and I have to refund my customers because they have been sold meanwhile. Is there a way to automatically disallow the order of low stock level products without disabling them ? I want them to still be visible on the website and to be automatically saleable when stock is > 3 for example. I don't think the plugin mentioned above disallow/allow the order of the products automatically. I can't test it, the demo is not working. Does anyone has a solution or knows a plugin who does that ? Thank you very much ! have a nice day I make changes that products lower than 2 will be autohide, you can use my fix. I use PS 1.7.8.x Changes: \controllers\front\ProductController.php Changes: \classes\stock\StockAvailable.php *line 454 Edited July 4, 2024 by c64girl (see edit history) Link to comment Share on other sites More sharing options...
ZHSoft Posted July 3, 2024 Share Posted July 3, 2024 You can set the switch in the background. You can also deliberately write 5 less product quantity, so that when the inventory is 0, you can use the mechanism that comes with Prestashop without purchasing a third-party module. For example, the real inventory is 100, and the online inventory is set to 95. When the customer buys 95, you actually have 5 as a backup, but the customer has been prohibited from placing an order online. Link to comment Share on other sites More sharing options...
c64girl Posted July 3, 2024 Share Posted July 3, 2024 1 hour ago, ZHSoft said: You can set the switch in the background. You can also deliberately write 5 less product quantity, so that when the inventory is 0, you can use the mechanism that comes with Prestashop without purchasing a third-party module. For example, the real inventory is 100, and the online inventory is set to 95. When the customer buys 95, you actually have 5 as a backup, but the customer has been prohibited from placing an order online. Some have ERP linked to prestashop and the quantity are pulled automatically. So your solution may be correct but for people who have a small number of products and no connection to an external ERP. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now