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

Template for backend export #596

Closed EnzephaloN closed 4 weeks ago

EnzephaloN commented 1 month ago

Hello

After you gave us the great backend-event for adding own buttons, I have a button. But now TYPO3 fails with TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException because there ist no temaplte file in format 'xml' found in EXT:cart. I've a file, placed at EXT:theme_bf/Resources/Private/Extensions/Templates/Backend/Order/Order/Export.xml and I've tried to load this with typoscript. But this does not work. How can I "add" my template to the configuration?

Best regards EnzephaloN

rintisch commented 4 weeks ago

I can hardly imagine that this really is a problem which is related to cart but more a false implementation. But without more information even that is hard to determine.

Have you debugged properly by e.g. first simply overwriting the existing csv template and so on? If it's not related to cart you should ask in the general slack channel.

EnzephaloN commented 4 weeks ago

Ok, here is some code

part of my typoscript

plugin.tx_cart{
    view{
        templateRootPaths.10 = EXT:theme_bf/Resources/Private/Extensions/Templates/
   }
}

My template is at EXT:theme_bf/Resources/Private/Extensions/Templates/Backend/Order/Order/Export.xml

But I get TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException about not found Export.xml in /home/www/shop/vendor/extcode/cart/Resources/Private/Templates/ This means to me, that configuring the template-path by setting plugin.tx_cart.view... has no effect. But I do not find anything like module.tx_cart or so. Because of this I ask here about definitions of backend-templates can be found. (and sorry, I can't use slack at this time)

best regards EnzephaloN

rintisch commented 4 weeks ago

This is indeed not a problem related to EXT:cart. Of course is it not possible to define a backend path with TypoScript because TypoScript is only FE related. I guess you are working for a customer and earn money by it so it does not feel right to help you for free in my spare time, especially when you are not even using channels that exists for general questions.

As a last hint, have a look at https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Backend/BackendModules/ModuleTemplate.html

I will close that ticket now. I hope you can understand that.

extcode commented 4 weeks ago

For backend modules you can not use plugin.tx_cart. plugins are for frontend. In the backend plugins are colled modules.

I'm not sure, it is possible to export XML without an own function handling this. An own Controller Action should do the job. I wouldn't recommend to generate an XML File by a Fluid template. This can be done by PHP easier, faster and in a reliable way. Exporting CSV by a Fluid Template is possible but a mess. This export is a poor man solution. For a customer work, I will always provide an individual solution.

Perhaps https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-96812-OverrideBackendTemplatesWithTSconfig.html can help you. (not tested)

As Gerald said. If you earn money with the project you can ask for paid support. I you have futher questions, please use the Slack Channel.