Although you can use dates on orders as views fields and filters, you can't use them as arguments. Since providing a dynamic view of orders would be a standard thing, we should get this fixed.

There may be other entities that don't have argument support for dates.

CommentFileSizeAuthor
#11 commerce.date_arguments_1231350_11.patch16.06 KBrfay

Comments

rszrama’s picture

I'm not entirely sure what you're looking for here... you're saying dates do work as filters (and I presume exposed filters), but you want to be able to craft URLs that show all the orders from a given date range without using an exposed filter? Maybe I just need an example use case to work against.

rfay’s picture

Here's an example: I want to provide a block which can show orders by month, or orders for the previous month (like a blog archive). It requires arguments/contextual filters, not exposed filters.

rszrama’s picture

Looks like there's already a default Views handler called views_handler_argument_date. Can you do any testing with that as our argument handler in commerce_order.views.inc? If that works, we can just use that for all our qualifying entities.

hozt’s picture

Are there any updates on getting date to work as a views argument? I am trying to create a series of sales reports and need sales by day, week, and month. It would also be great to be able to use payment date as an attribute also. Thanks!

TheWizz’s picture

subscribe

EndEd’s picture

subscribe

rszrama’s picture

Issue tags: +1.1 blocker

Tagging.

wjaspers’s picture

sub.

hawkdrupal’s picture

Subscribe.

My experience is that ANY date should be useable in this way (in every possible way). Businesses always seem to want dynamic reports, views, or whatever, by date of bid, ordered, modified, shipped (might be several dates of partial shipments), billed, paid, and also by custom date fields a particular business might require (manufacturing processes can have many dates).

rfay’s picture

Assigned: Unassigned » rfay

I'll see what I can do with this today.

rfay’s picture

Status: Active » Needs review
StatusFileSize
new16.06 KB

Here's a patch that allows sophisticated date arguments for both created and changed on customer, order, payment, and product.

wjaspers’s picture

Why do you need a handler for every date part?

rfay’s picture

@wjaspers it's from the other places where this is done. So you can do a view like a blog view, where the arguments are 2011/10/02, and use any one of the three parts.

Status: Needs review » Needs work

The last submitted patch, commerce.date_arguments_1231350_11.patch, failed testing.

rfay’s picture

Status: Needs work » Needs review

Queueing so this will retest after the branch testing works again.

rfay’s picture

rszrama’s picture

Title: Can't use Order date fields as views arguments (Contextual filters) » Add argument handlers for all of our entities' created / changed timestamp columns
Component: Order » Views integration
Assigned: rfay » Unassigned
Category: bug » feature
Status: Needs review » Fixed

Woohoo, committed. Happy report building! ; )

Automatically closed -- issue fixed for 2 weeks with no activity.