Jump to content

Override to select warehouse within order detail admin page


cercamon

Recommended Posts

Hi, we want to implement an override that would allow us to edit the warehouse assigned to each product in the order admin page.

 

I attach a descriptive screenshot.

 

We use the Advanced Stock Management function (ASM) and we allow products not present in warehouse to be sold.

 

In case of an order with such products (currently not present in any of the warehouses), we found out that prestashop fills de field id_warehouse from table ps_order_detail with the first match on the list of assigned warehouses for that particular product.

 

In that case, if we procure the product using other allowed warehouse than the assigned by default, it won't be substracted once it's sold. Therefore, prior to assingning shipped status, we need to edit the order and select the right warehouse for the product.

 

What I've done so far...

 

Overrided:

/ADMIN/themes/default/template/controllers/orders/helpers/view/view.tpl -> /override/controllers/admin/templates/orders/helpers/view/view.tpl

And changed:

From:
{* Include product line partial *}
{include file='controllers/orders/_product_line.tpl'}

To:
{* Include product line partial *}
{include file='../../_product_line.tpl'}

And then, started to play with the file:

/override/controllers/admin/templates/orders/_product_line.tpl

But so far, I haven't got a clue on how to populate a dropdown selector with the assigned warehouses, and how to save that value into the database.

 

Any hints?

Thanks!!

post-22095-0-89377200-1418750252_thumb.jpg

  • Like 1
Link to comment
Share on other sites

  • 8 months later...
  • 2 weeks later...

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...