Jump to content
redrum

Warehouse Location in 1.7.2.2

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?

Share this post


Link to post
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')
        )) 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Insert code by using the button < > of the editor, than nothing will be marked as spam.

Thanks!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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? 

location.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More