lifterlms icon indicating copy to clipboard operation
lifterlms copied to clipboard

Added support for all Post Statuses for sales reporting.

Open actuallyakash opened this issue 2 years ago • 10 comments
trafficstars

Description

The user was not able to filter sales reporting for a course with Private | Draft | Pending post statuses. This PR fixes the issue.

Fixes #2490

How has this been tested?

Manually.

Types of changes

Bug fix

Checklist:

  • [x] This PR requires and contains at least one changelog file.
  • [x] My code has been tested.
  • [x] My code passes all existing automated tests.
  • [x] My code follows the LifterLMS Coding & Documentation Standards.

actuallyakash avatar Jul 21 '23 08:07 actuallyakash

done escaping.

actuallyakash avatar Jul 21 '23 14:07 actuallyakash

Looks good, can you just escaping more stuff? This only to improve our past code you know... :D Thanks <3

it's done 👌

actuallyakash avatar Jul 25 '23 13:07 actuallyakash

@actuallyakash bump

eri-trabiccolo avatar Aug 02 '23 11:08 eri-trabiccolo

Hey @actuallyakash this is good - except for coding standards issues to fix. Also, have you checked for all the possible post statuses then, even for scheduled posts?

Hey @eri-trabiccolo

by "scheduled posts" did you mean "pending posts"?

actuallyakash avatar Aug 03 '23 14:08 actuallyakash

Hey @actuallyakash this is good - except for coding standards issues to fix. Also, have you checked for all the possible post statuses then, even for scheduled posts?

Hey @eri-trabiccolo

by "scheduled posts" did you mean "pending posts"?

hey @actuallyakash

I mean when you schedule a post to be published in the future: screenshot-20230803_163447_909760316 screenshot-20230803_163515_417089140

eri-trabiccolo avatar Aug 03 '23 14:08 eri-trabiccolo

@eri-trabiccolo

sorry for the late response.

I mean when you schedule a post to be published in the future:

No, the scheduled posts (courses/memberships) are not visible. We're currently using get_post_statuses() which only returns draft,pending,private,publish. Though, we can add a future tag by appending it to the array.

Should we show scheduled posts as old posts can be again rescheduled? Let me know your thoughts.

actuallyakash avatar Aug 09 '23 12:08 actuallyakash

@actuallyakash What I think we should do is to allow users to filter by all the (existing) courses/memberships that produced a sale that is visible in the graph/numbers. So check this: buy a course, turn its status to "whatever status" (except for trash/deleted), if the sale appears in that reporting screen (its amount is counted, the graphs shows it) etc, then we should be able to filter by that course too.

eri-trabiccolo avatar Aug 09 '23 13:08 eri-trabiccolo

@actuallyakash let's not forget about this :D

eri-trabiccolo avatar Sep 03 '23 09:09 eri-trabiccolo

@actuallyakash let's not forget about this :D

Didn't forget :D

I worked on it in between the tasks and still working on finding the solution. Will wrap it up soon.

actuallyakash avatar Sep 04 '23 18:09 actuallyakash

hey @eri-trabiccolo

I've added future post-status to data-post-statuses for showing scheduled posts (courses/memberships).

I don't think showing the sold posts is feasible at the moment as we are passing the courses and memberships post type here. We need to fetch the orders and then fetch the courses associated with them. Too long a process. Perhaps, there must be a shorter one which I'm not able to find without changing the logic in this query.

I think for now, adding future will be sufficient. Let me know your thoughts. 😁

actuallyakash avatar Sep 07 '23 20:09 actuallyakash

Did we accidentally undo the change to include private posts in the second commit here: https://github.com/gocodebox/lifterlms/pull/2493/commits/c4778166d67429cd921806f987a9fd1f5af62514#diff-62976cfc458475b0fd1f70759a37960b64b21da658718ede3884e3897062b4a6L62

Let's double check that. Test. Review and merge.

ideadude avatar Apr 03 '24 13:04 ideadude

Private posts were being included by default as part of the PR, but reverted. No changes to what it was before in that file.

brianhogg avatar May 07 '24 18:05 brianhogg