wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
215 stars 217 forks source link

Re-think Sales Log UI #194

Open JustinSainton opened 11 years ago

JustinSainton commented 11 years ago

I'd like to slate a re-thinking of the Sales Log UI for 4.2.

Some initial thoughts:

Much of the thoughts above may end up as the responsibility of separate APIs, or even other plugins, but I think, one way or another, all of that should be possible in WPeC.

Not feeling particularly dogmatic one way or the other - but this may be a really great opportunity to leverage a REST API for orders, which would necessitate the REST API going in for 4.1.

JustinSainton commented 9 years ago

Need to consider the relationship between an order and the customer who made it. So much inspiration here to take from https://github.com/easydigitaldownloads/Easy-Digital-Downloads/issues/2548

jtsternberg commented 7 years ago

Order notes already exists, right?

JustinSainton commented 7 years ago

yeah, but they're turrible.

jtsternberg commented 7 years ago

Discussed this internally. Idea is to:

Array of notes will be something like:

$notes = array(
    array(
        'type' => 'default',
        'status' => 'private',
        'time' => '<timestamp>',
        'content' => '<note content>',
    ),
    array(
        'type' => 'error',
        'status' => 'public',
        'time' => '<timestamp>',
        'content' => '<error content>',
    ),
);
JeffPyeBrook commented 7 years ago

the note column would certainly work... did you think about storing the notes as purchase meta? I am using the meta in my forks/plugins and it is working really well and doesn't require any extra work to get caching, and can store things other than text.

The only concern I would have is that any query that does a select * against the purchase log table would generate a lot of data if there are a lot of long text entries.

I am using the meta to store some images generated by a site customization process, and also historical shipping quotes for some shipper accountability.

jtsternberg commented 7 years ago

Thanks @JeffPyeBrook, we agree, and have switched to using purchase meta for notes storage, with a back-compatibility shim. The notes bit of this issue (as well as some of the other bits) are addressed with #2165.

JustinSainton commented 7 years ago

Part of this should include iterating on the order notes work done in https://github.com/wp-e-commerce/WP-e-Commerce/pull/2165

The low-level API includes the ability to have "types" and "statuses" like error/warning, or public/private. These could generate dynamic hooks that could be utilized dynamically for pretty powerful integrations. Email notices, in-account notices, push notifications, etc. The API exists - we just need the higher-level helper functions and UI in place for them.