Jump to content

Custom order-history (history.tpl) for more info in table (help needed)


Recommended Posts

We use Prestashop as a sales-tool for our salesman who register their sales in the system for different costumers. It works very good, the only thing the salesman has to do is to place an order and add a new address at checkout (for the costumer).

 

Than in backoffice our administrators can see the sale done by all salesman, who the costumer is, commision and so on.

 

We have already made a lot of customisations to the system and now I'd like to add a small info-field (an extra column) in order-history.

 

This is for the salesman so thay easily can find a sale by checking the history. Now they have to preview each order to find the right costumer. (I want to add Company-name)

 

I edited my history.tpl as followed so now I have en extra column in which I would like to have the company-name in. I can for example read in the adress-ID and diaplay that, but that is't very helpful.

 

How do I do to make it check upp that adress-ID and display what is stored under "company" column instead?

 

<thead>
  <tr>
	<th class="first_item">{l s='Order'}</th>
	<th class="item">{l s='Date'}</th>
	<th class="item">{l s='Total price'}</th>
	<th class="item">{l s='Payment'}</th>
	<th class="item">{l s='Status'}</th>
****	<th class="item">{l s='Firma'}</th>
	<th class="item">{l s='Invoice'}</th>
	<th class="last_item" style="width:65px"> </th>
  </tr>
 </thead>
 <tbody>
 {foreach from=$orders item=order name=myLoop}
  <tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{/if}">
	<td class="history_link bold">
	 {if isset($order.invoice) && $order.invoice && isset($order.virtual) && $order.virtual}<img src="{$img_dir}icon/download_product.gif" class="icon" alt="{l s='Products to download'}" title="{l s='Products to download'}" />{/if}
	 <a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, 'order-detail');">{l s='#'}{$order.id_order|string_format:"%06d"}</a>
	</td>
	<td class="history_date bold">{dateFormat date=$order.date_add full=0}</td>
	<td class="history_price"><span class="price">{displayPrice price=$order.total_paid_real currency=$order.id_currency no_utf8=false convert=false}</span></td>
	<td class="history_method">{$order.payment|escape:'htmlall':'UTF-8'}</td>
	<td class="history_state">{if isset($order.order_state)}{$order.order_state|escape:'htmlall':'UTF-8'}{/if}</td>
****	<td class="history_name"> {$order.id_address_invoice|escape:'htmlall':'UTF-8'}</td>
	<td class="history_invoice">
	{if (isset($order.invoice) && $order.invoice && isset($order.invoice_number) && $order.invoice_number) && isset($invoiceAllowed) && $invoiceAllowed == true}
	 <a href="{$base_dir}pdf-invoice.php?id_order={$order.id_order|intval}" title="{l s='Invoice'}"><img src="{$img_dir}icon/pdf.gif" alt="{l s='Invoice'}" class="icon" /></a>
	 <a href="{$base_dir}pdf-invoice.php?id_order={$order.id_order|intval}" title="{l s='Invoice'}">{l s='PDF'}</a>
	{else}-{/if}
	</td>
	<td class="history_detail">
	 <a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, 'order-detail');">{l s='details'}</a>
	 <a href="{$base_dir_ssl}{if isset($opc) && $opc}order-opc{else}order{/if}.php?submitReorder&id_order={$order.id_order|intval}" title="{l s='Reorder'}">
	  <img src="{$img_dir}arrow_rotate_anticlockwise.png" alt="{l s='Reorder'}" title="{l s='Reorder'}" class="icon" />
	 </a>
	</td>
  </tr>
 {/foreach}
 </tbody>

 

These are the only two lines I've added so far and the "Firma"-column is the result.

Now, somehow I need to get the "$address_company" variable displayed instead but I can't figure out how to do that.post-355965-0-90345000-1335337653_thumb.jpg

  • Like 2
Link to comment
Share on other sites

Bump.

 

Would someone please give me some input? At least where I need to start.

 

A little help with the code how to take take the adressID and turn it into the name or company came instead would set me on my way...

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