Jump to content

Warehouse Location in 1.7.2.2


redrum

Recommended Posts

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

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')
        )) 
Link to comment
Share on other sites

  • 2 weeks later...

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

  • 2 weeks later...

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

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 by NicolasIT (see edit history)
  • Like 1
Link to comment
Share on other sites

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

  • 6 months later...
  • 4 months later...
  • 3 months later...
  • 1 year later...

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

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

  • 2 years later...
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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...