extcode / cart

Cart is a small but powerful extension which "solely" adds a shopping cart to your TYPO3 installation. The extension allows you to create coupons, products with or without variants, special prices.
GNU General Public License v2.0
57 stars 51 forks source link

[HOWTO] add a button to backend-module for XML-export #588

Closed EnzephaloN closed 1 month ago

EnzephaloN commented 1 month ago

Hello Sorry, slack won't work on my machines, so I have to ask here.

In the past I tried to add a XML-export-button to backend-module by overriding backend-module-templates. This does not work anymore. The default-button is generated by $this->getListButtons() in OrderController. This is nice, but how can I add an own button to DocHeader for exporting orders as XML? Or is there any other extension which handles a XML-export?

Kindly regards EnzephaloN

EnzephaloN commented 1 month ago

Hello and thank you. This looks good. I hope you can merge this soon and maybe give us a little howto-documentation. Kindly regards EnzephaloN

rintisch commented 1 month ago

Hey, just as info: extcode will make an improved version of my PR which will get merged.

extcode commented 1 month ago

I have created my own PR based on @rintisch work. I will discuss this with him. I am uncomfortable passing $this to an event and also think that a special event to modify the ButtonBar is what was requested as an feature here. I use the event itself in the PR, so theoretically it should be possible to replace the CSV export with a custom XML export. I have also used the event for the buttons in the showAction so that it be possible to add own buttons to this action as well.

EnzephaloN commented 1 month ago

Hello @extcode . I'm curious about it and hope that you can give me a howto for adding a XML-export ;-) best regards EnzephaloN

extcode commented 1 month ago

I merged the PR. If you want to add your own button with your own action, you can have a look to \Extcode\Cart\EventListener\Template\Components\ModifyButtonBar. The extension use it's own event to add the buttons to DocHeader section. I will add a second new event with another ticket. If this is finished, I will release both together.

EnzephaloN commented 1 month ago

Thanx for your great work!