3 replies [Last post]
finnalden's picture
Offline
Joined: 05/13/2013
Juice: 15
Was this information Helpful?

I am looking for some advice on how to achieve the following:

  1. Create a new order state called Archived.
  2. Make all the orders/invoices that are more than 6 months and completed, automatically be archived.
  3. Hide all orders/invoices from the orders view under store.

I am currently using Drupal 6 and Ubercart 2.x.

The best solution would of course be to use a module, but I am not a drupal programmer and need some help with this task. I do know some PHP, CSS and HTML.

DanZ's picture
Offline
Joined: 08/07/2011
Juice: 1738
Re: Create a new order state, archive, to remove orders from vie

You could just set a filter on the View to only display orders less than six months old, and this would accomplish everything you want. That's a really easy configuration change.

Also, I'm not sure about Ubercart 2, but on Ubercart 3, there's an order state and an order status. If I remember correctly, order states are hard-coded, but you can add a new order status as a simple configuration change. So, you could add an "archived" order status.

You'd use some sort of cron task with Conditional Actions to periodically put stuff into "archive" status. That's an Ubercart 2 thing, so I'm not sure how it works.

finnalden's picture
Offline
Joined: 05/13/2013
Juice: 15
Thanks

I will check out Views tomorrow and see how it works. Conditional actions might be the solution to move it in to an archive mode.

finnalden's picture
Offline
Joined: 05/13/2013
Juice: 15
Solution

The solution was simpler than I thought. Go to View and there are other views listed for Ubercart. I chose to enable orders and added a filter and that took care of the view.

I decided to keep the menu as it is now, but add the new view as a new menu item.

I think it would have been more elegant to archive the old orders, but considering the time and effort, I am happy with this solution.