redrum Posted September 2, 2017 Share Posted September 2, 2017 As far as I can see there is not possible to add a warehouse location for each products in prestashop 1.7.2.2(ie. on which shelf you keep your product, so you easily can find it when your packing your orders). I'm aware of the rebuild of Advanced Stock Management, but just having a warehouse location should be something a lot of shops would find useful.Is there any module to achieve this, or is it any plans to add this in the core Prestashop? Link to comment Share on other sites More sharing options...
redrum Posted September 2, 2017 Author Share Posted September 2, 2017 I played around with it, and if someone is interested it can be done in the following way; ============Add item location field in add/edit product page to insert a warehouse location in the 'location'-row in the table 'product'.============ src/PrestaShopBundle/Resources/views/Admin/Product/catalog.html.twigAROUND ROW 364 ADD: <div class="form-group"> <h2> Item location <span class="help-box" data-toggle="popover" data-content="[spam-filter] "Your warehouse location for this product. Allowed special characters: .-_#\."|trans({}, 'Admin.Catalog.Help') [spam-filter]" ></span> </h2> [spam-filter] form_errors(form.step6.location) [spam-filter] <div class="row"> <div class="col-xl-12 col-lg-12" id="product_location_field"> [spam-filter] form_widget(form.step6.location) [spam-filter] </div> </div> </div> src/PrestaShopBundle/Model/Product/AdminModelAdapter.phpAROUND ROW 510 ADD: 'location' => $this->product->location, src/PrestaShopBundle/Form/Admin/Product/ProductOptions.phpAROUND ROW 154 ADD: ->add('location', 'Symfony\Component\Form\Extension\Core\Type\TextType', array( 'required' => false, 'label' => $this->translator->trans('Location', [], 'Admin.Global') )) Link to comment Share on other sites More sharing options...
NicolasIT Posted September 11, 2017 Share Posted September 11, 2017 Ehy redrum, you sure about this i've different rows in same PS version, you said to add div in the middle of a table. Can you check again row numbers? Thanks! NicholasIT Link to comment Share on other sites More sharing options...
redrum Posted September 11, 2017 Author Share Posted September 11, 2017 The rows may differ a bit, thats why I wrore "AROUND" But in src/PrestaShopBundle/Resources/views/Admin/Product/catalog.html.twig you should be able to put it where ever you want it to be displayed.So try to put the code on a different row and see if it will work better for your needs. And if you improve it, please post it. Link to comment Share on other sites More sharing options...
NicolasIT Posted September 26, 2017 Share Posted September 26, 2017 Hi there, i was able to edit both last 2 files but can you provide me some more informations about editing catalog.html.twig? if you can paste the lines above or after or explain better where you added that div it will be really useful while advanced stock management is still to be. Thanks so much, NicholasIT Link to comment Share on other sites More sharing options...
NicolasIT Posted September 26, 2017 Share Posted September 26, 2017 (edited) Official devs suggested me to use the "per liter, per kilo" field on price tab as if it's not filled by price it's not shown on frontend. I think this workaround will be the best solution while waiting for advanced stock to be implemented. Consider to use this solution as it's best to keep core clean. NicholasIT Edited September 26, 2017 by NicolasIT (see edit history) 1 Link to comment Share on other sites More sharing options...
redrum Posted September 26, 2017 Author Share Posted September 26, 2017 Hi there, i was able to edit both last 2 files but can you provide me some more informations about editing catalog.html.twig? if you can paste the lines above or after or explain better where you added that div it will be really useful while advanced stock management is still to be. Thanks so much, NicholasIT As for the file src/PrestaShopBundle/Resources/views/Admin/Product/catalog.html.twig you should be able to place the code wherever you want the input field to appear. However, this Prestashop forum don't allow entering some code lines. It transform some code to [spam-filter]. Its quite odd that the forum don't allow to enter Prestashop core code. Official devs suggested me to use the "per liter, per kilo" field on price tab as if it's not filled by price it's not shown on frontend. I think this workaround will be the best solution while waiting for advanced stock to be implemented. Consider to use this solution as it's best to keep core clean. NicholasIT Ahh, yes. If that is possible and you don't use "per litere, per kilo" I guess its a much better solution. Its best to keep the core code as clean as possible. And whenever the "warehouse location" will be available in the core it shouldn't be that difficult to move the data into that table. Thanks for finding out about this solution. Link to comment Share on other sites More sharing options...
selectshop.at Posted September 26, 2017 Share Posted September 26, 2017 However, this Prestashop forum don't allow entering some code lines. It transform some code to [spam-filter]. Its quite odd that the forum don't allow to enter Prestashop core code. Insert code by using the button < > of the editor, than nothing will be marked as spam. Link to comment Share on other sites More sharing options...
redrum Posted September 26, 2017 Author Share Posted September 26, 2017 Insert code by using the button < > of the editor, than nothing will be marked as spam. Thanks! Link to comment Share on other sites More sharing options...
JuanjoSC Posted April 18, 2018 Share Posted April 18, 2018 @redrum Can you esplain the correct text in filter of spam ? I tried put this but not work: Thanks! Link to comment Share on other sites More sharing options...
La Cafeine Posted September 12, 2018 Share Posted September 12, 2018 hi Everyone, how to activate this field, I can see this location field on product table, but it's invisible on BO ? Best Reguards, La Cafeine Link to comment Share on other sites More sharing options...
[email protected] Posted January 5, 2019 Share Posted January 5, 2019 Hi, Also looking for this code for Ps1.7 I have it for 1.6 and also visable in FO products under referencenumber. And don`t want to turn on advanced stock managment. Anyone got this working for ps1.7? Link to comment Share on other sites More sharing options...
Jeff A Posted February 8, 2020 Share Posted February 8, 2020 For anyone who has even a small number of stock items, being able to see the LOCATION is essential. It is hard to understand why it is so hard to make the location visible. If anyone has a sensible solution / recommendation, please let me know too. Link to comment Share on other sites More sharing options...
Jeff A Posted February 8, 2020 Share Posted February 8, 2020 I have one other basic thing needed for Stock Management - which is a system-wide minimum-stock-level - this is a limit that the system will keep without selling, e.g. If we set this to 3 and there are 8 in stock, the maximum that the system will sell before going 'out-of-stock' is 5. This is needed by one of my customers who grows several hundred varieties of plant. They need to keep at least 3 of each plant as core growing stock. At the moment, they use a spreadsheet to keep the real stock numbers, and I have to write macros to upload the actual-less-3 number into the system every couple of days. I am new to PrestaShop - but have been writing PHP and web-apps in several languages for more than 15 years - if anyone in Prestashop Core wants some help, I have time that I can dedicate to upgrading / fixing the missing stock features. Contact me directly if you want me to help. Thanks, Jeff Link to comment Share on other sites More sharing options...
Ehsanai Posted July 22, 2022 Share Posted July 22, 2022 On 9/3/2017 at 3:53 AM, redrum said: I played around with it, and if someone is interested it can be done in the following way; ============ Add item location field in add/edit product page to insert a warehouse location in the 'location'-row in the table 'product'. ============ src/PrestaShopBundle/Resources/views/Admin/Product/catalog.html.twig AROUND ROW 364 ADD: <div class="form-group"> <h2> Item location <span class="help-box" data-toggle="popover" data-content="[spam-filter] "Your warehouse location for this product. Allowed special characters: .-_#\."|trans({}, 'Admin.Catalog.Help') [spam-filter]" ></span> </h2> [spam-filter] form_errors(form.step6.location) [spam-filter] <div class="row"> <div class="col-xl-12 col-lg-12" id="product_location_field"> [spam-filter] form_widget(form.step6.location) [spam-filter] </div> </div> </div> src/PrestaShopBundle/Model/Product/AdminModelAdapter.php AROUND ROW 510 ADD: 'location' => $this->product->location, src/PrestaShopBundle/Form/Admin/Product/ProductOptions.php AROUND ROW 154 ADD: ->add('location', 'Symfony\Component\Form\Extension\Core\Type\TextType', array( 'required' => false, 'label' => $this->translator->trans('Location', [], 'Admin.Global') )) Hi, do you have solution for 1.7.8.5 ? Link to comment Share on other sites More sharing options...
redrum Posted July 25, 2022 Author Share Posted July 25, 2022 On 7/22/2022 at 9:39 AM, Ehsanai said: Hi, do you have solution for 1.7.8.5 ? As of at least 1.7.7.7 this function is built in. Under the tab "Quantities" you have a field with the name "Stock location". 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