Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orders - Element Export vs Commerce Export #976

Closed
1 task
engram-design opened this issue Aug 26, 2019 · 5 comments
Closed
1 task

Orders - Element Export vs Commerce Export #976

engram-design opened this issue Aug 26, 2019 · 5 comments
Labels
Milestone

Comments

@engram-design
Copy link
Contributor

engram-design commented Aug 26, 2019

I've noticed that the native Element Export (introduced in Craft 3.2 with paginating order elements) exports differently to the normal Commerce export functionality. This is a bit confusing for clients, as these two buttons should do the same thing.

In our use-case, we're using beforeGenerateExport to modify the export.

@nfourtythree
Copy link
Contributor

Hey @engram-design

Can definitely see that this could be confusing to the end-user. Will have to have a think about this, to see if we transition to the CMS style of exports or stick with the Commerce variety.

In the meantime, and I know this is less than ideal, but you could add a quick bit of code to hide the native exports bar on the orders view in the CP. Throw something like the following in a custom module:

Event::on(View::class, View::EVENT_END_BODY, function($event) {
    $request = Craft::$app->getRequest();
    if ($request->isCpRequest && $request->fullPath == 'admin/commerce/orders') {
        $js = "(function(){ $('#content-container #footer').hide(); })();";
        $event->sender->registerJs($js);
    }
});

Again, I know this isn't a nice solution but could cause fewer issues for clients in the interim while we come up with a solution.

Thanks.

@nfourtythree nfourtythree added bug 💡 enhancement Ideas and suggestions labels Aug 26, 2019
@engram-design
Copy link
Contributor Author

Thanks for the feedback @nfourtythree I think we'll go ahead and do that. Not 100% sure what the best approach would be here - I suppose siding with the native Craft export behaviour. Only issue for us is being able to modify the output before the file is generated.

I suppose this is due to Commerce implementing this feature before Craft did!

Thanks,

@nfourtythree
Copy link
Contributor

No problem @engram-design .

Will chat with everyone here, but ideally, we will transition to using the native Craft export but then add in some events so we give people greater flexibility and there is no loss of functionality.

This would likely be a breaking changing and if it does happen would be in a major release cycle.

@lukeholder
Copy link
Member

Going to introduce into core the concept of exports which are extensible like element actions.

@lukeholder
Copy link
Member

Fixed in commerce 3.0-RC1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants