Jump to content

How to call the location column from warehouse_product_location table?


markinhos3

Recommended Posts

Hi guys! My Prestashop version is 1.6.1.10.

 

I'm trying to call the location column from the ps_warehouse_product_location table in template delivery-slip.product-tab.tpl and when I use this code:

 

CODE from delivery-slip.product-tab.tpl:

...
{foreach $order_details as $order_detail}
			{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
			<tr class="product {$bgcolor_class}">
			<td class="product center">
				{$order_detail.location}				
			</td>

...

Instead I get the location number from the ps_product table and that is not what I wish because then I have to change manually every location field in the data base table ps_product. What I want is get the location field directly from the Prestashop following the route: catalog/ products/in any product/warehouses/location

 

Someone could tell me how can I call and get that location field from ps_warehouse_product_location table? I know exist some modules which make this but I only need to know how to call location field in delivery-slip.product-tab.tpl template

 

A lot of thanks in advance!! :)

Link to comment
Share on other sites

Hi again guys!

 

I just found the solution in the Spanish Forum, thanks to Ventura member  :)  :) 

 

You just have to add this sentence to delivery-slip.product-tab.tpl

{WarehouseProductLocation::getProductLocation($order_detail.product_id, $order_detail.product_attribute_id,$order_detail.id_warehouse)} 

I leave the code if someone need it in the future:

...
{foreach $order_details as $order_detail}
			{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
			<tr class="product {$bgcolor_class}">
			<td class="product center">
				{WarehouseProductLocation::getProductLocation($order_detail.product_id, $order_detail.product_attribute_id,$order_detail.id_warehouse)}
				{$order_detail.location}				
			</td>
...

Thanks to all, have a nice day!  :rolleyes:

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