X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding fields to Search display results in Orders Management (https://forum.x-cart.com/showthread.php?t=72319)

Rodney 06-18-2015 03:58 PM

Adding fields to Search display results in Orders Management
 
Adding fields can help with bookkeeping. I'd like to modify the PHP code to display a few more fields in an Orders Management search result. Currently the search displays Order #, Status, Customer, Date, and Total.

I'd like to also add Country, Subtotal, Taxes, and Shipping Cost too. Does anyone know what files and what code changes could easily add these to search results? Any help is greatly appreciated.

BTW, I'm using X-cart 4.4.5 (Unix).

Rodney 06-22-2015 06:47 PM

Re: Adding fields to Search display results in Orders Management
 
Managed to solve this on my own tonight. For anyone else trying to do this, the code can be added to the orders_list.tpl file under the skin/common_files/main folder. It is beautiful now, I still have the columns as before, but have added columns for shipping country, shipper choice, coupon, discount (sum of discount and coupon discount), discounted subtotal, shipping cost, and tax, plus I summed the dollar totals at the bottom. Monthly bookkeeping is now just a few quick entries of totals for all the orders in a month.

Keys Care 09-10-2015 05:00 AM

Re: Adding fields to Search display results in Orders Management
 
Hi, Thanks for the post. I am trying to add the "company name" to the summary. Can you explain how you added the items of show a screen shot of the code changes. I am a bit lost of how to do this minor change.

Many of our wholesale customers have different locations but the same buyer at a single billing address.

Bob

razortw 09-12-2015 06:31 AM

Re: Adding fields to Search display results in Orders Management
 
Quote:

Originally Posted by Keys Care
Hi, Thanks for the post. I am trying to add the "company name" to the summary. Can you explain how you added the items of show a screen shot of the code changes. I am a bit lost of how to do this minor change.

Many of our wholesale customers have different locations but the same buyer at a single billing address.

Bob

Hi Bob.
As the topicstarter mentioned earlier, you will need to customize the /common_files/main/orders_list.tpl file.
Here is the basic code change you should make ('-' means to remove the loc, '+' means to add one):
Code:

-  <td width="20%" nowrap="nowrap">{if $search_prefilled.sort_field eq "provider"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=provider{if $search_prefilled.sort_field eq "provider"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_provider}</a></td>

-  <td width="20%" nowrap="nowrap">{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=date{if $search_prefilled.sort_field eq "date"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_date}</a></td>

-  <td width="20%" nowrap="nowrap">{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=total{if $search_prefilled.sort_field eq "total"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_total}</a></td>

+  <td width="15%" nowrap="nowrap">{if $search_prefilled.sort_field eq "provider"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=provider{if $search_prefilled.sort_field eq "provider"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_provider}</a></td>

+  <td width="15%" nowrap="nowrap">{if $search_prefilled.sort_field eq "date"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=date{if $search_prefilled.sort_field eq "date"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_date}</a></td>

+  <td width="15%" nowrap="nowrap">{if $search_prefilled.sort_field eq "total"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}&nbsp;{/if}<a href="orders.php?mode=search&amp;sort=total{if $search_prefilled.sort_field eq "total"}&amp;sort_direction={if $search_prefilled.sort_direction eq 1}0{else}1{/if}{/if}">{$lng.lbl_total}</a></td>

+  <td width="15%" align="right" nowrap="nowrap">{$lng.lbl_company}</td>

Then add this
Code:

<td nowrap="nowrap" align="right">{$orders[oid].company}</td>
after this
Code:

  <td nowrap="nowrap">
  <a href="order.php?orderid={$orders[oid].orderid}">{currency value=$orders[oid].total}</a>
  </td>

This is just a basic change, you can customize this columns any way you want, make it sortable, and so on.

Keys Care 09-12-2015 08:59 AM

Re: Adding fields to Search display results in Orders Management
 
Thank You! Worked perfectly

Bob

razortw 09-12-2015 09:06 AM

Re: Adding fields to Search display results in Orders Management
 
Quote:

Originally Posted by Keys Care
Thank You! Worked perfectly

Bob

You're welcome!
Glad that you sorted it out :)


All times are GMT -8. The time now is 04:59 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.