Jump to content

Add A New Column With "status" Data In The Order Details


Pierre-Antoine

Recommended Posts

Hi,


 


I am using Prestashop 1.6.0.14


 


In the back office, I can access through Orders > Orders menu to all the orders that have been done on my website by my clients.


 


By choosing one, I access all the details of one specific order, especially a table with all the products included in this order, like shown in this picture.


 


Presta_Forum.jpg


 


In this table, I have the products images, the products names, prices, ordered and available quantities. And I would like to include in this table a column with the products status ("New", "Refurbished" or "Others").


 


Does anyone have an idea about how to do this, please ?


 


Thank you in advance for your help !


Link to comment
Share on other sites

No

i just applied modifications to my demo shop to check if it will work.

please note that this will display ACTUAL "condition" of the product

it's because prestashop doesnt store information about product condition in order details

Link to comment
Share on other sites

What do you mean by actual condition ? 

How have you done that, please ? :)

 

hello

sorry for late reply i had a lot of commercial works to handle :)  but im finally back :-)

 

okay, as i mentioned, this feature shows ACTUAL condition of product - exactly the same value as you have here:

t8vTIHw.png

 

 

this means that if you change this option here, you will see changed value also on order details page.

 

Link to comment
Share on other sites

to _product_line.tpl i added new column in table with products list

    <td>
    {assign var=condition value=Db::getInstance()->getRow("SELECT `condition` FROM ps_product WHERE id_product={$product['product_id']}")}
    {$condition.condition}
    </td>

to view.tpl i added new column heading

<th><span class="title_box ">{l s='Condition'}</span></th>
Link to comment
Share on other sites

Hi Vekia, 

 

Last question: it works perfectly, but I would like to sort those conditions according to the name.

I saw in the source code I should use

<a>
<i class="icon-caret-up"></i>
</a>

<a>
<i class="icon-caret-down"></i>
</a> 

and using links in the <a> balise, but this code doesn't seem to be working and I don't understand why.

<a {if isset($condition) && ($key == $condition) && ($order_way == 'DESC')}class="active"{/if} href="{$currentIndex|escape:'html':'UTF-8'}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=desc&token={$token|escape:'html':'UTF-8'}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
   <i class="icon-caret-down"></i>
</a>

<a {if isset($condition) && ($key == $condition) && ($order_way == 'ASC')}class="active"{/if} href="{$currentIndex|escape:'html':'UTF-8'}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=asc&token={$token|escape:'html':'UTF-8'}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
   <i class="icon-caret-up"></i>
</a>

Did I make a mistake ?

 

Thanks again for your help,

Link to comment
Share on other sites

  • 1 month later...
Hi,
 
Thanks Vekia, i've adapted your code in order to display tags and it works :
{assign var=id_tag value=Db::getInstance()->getRow("SELECT * FROM xxx_product_tag LEFT JOIN wx8_tag ON xxx_product_tag.id_tag = xxx_tag.id_tag WHERE id_product={$product['product_id']}")}

I was wondering if it's possible to make an override when we edit this file :

 
  • product_line.tpl

 

This override is working :

override/controllers/admin/templates/orders/helpers/view/view.tpl

 

This one is not working :

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

Edited by Cloud Nine (see edit history)
Link to comment
Share on other sites

  • 1 year 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...