Aimeos not generating Voucher Codes

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
gizmo
Posts: 21
Joined: 18 Jan 2021, 20:42

Aimeos not generating Voucher Codes

Post by gizmo » 25 Aug 2021, 20:16

Hi There

I'm trying to get the voucher product to work, but it never generates a voucher code after purchase.

I've read the following Docs:
https://aimeos.org/docs/2021.x/manual/p ... /#vouchers
https://aimeos.org/docs/2021.x/manual/coupons/#voucher

I've set up the Voucher Provider within the marketing discout area in the backend. And the product is also of type voucher.

To test it, I've installed a brand new installation with the Aimeos Distribution Packages and there it also does not generate a Voucher Code after you purchase the demo voucher product.

I assume that after a customer purchases a voucher product, that the code will be sent to the customer with the order confirmation and in the backend I'm able to see the generated code in the Voucher Discout that has been set up.

The regular order confirmation E-Mail is being sent correctly and I've also set up the Scheduler Job "Voucher Related E-Mails" to run every minute.

Is there somehow a bug or am I just missing something?

Thanks for the help!

My Environment:
TYPO3 10.4.20
Aimeos 21.7.1
PHP 7.4
Currently running in an DDEV Container

User avatar
aimeos
Administrator
Posts: 5643
Joined: 01 Jan 1970, 00:00

Re: Aimeos not generating Voucher Codes

Post by aimeos » 26 Aug 2021, 05:56

Seems to be correct what you describe. The "Voucher Related E-Mails" job controller executed by the scheduler generates the vouchers and send them to the customers:
https://github.com/aimeos/ai-client-htm ... andard.php

Maybe there's a minor thing wrong in your setup you've overseen.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

gizmo
Posts: 21
Joined: 18 Jan 2021, 20:42

Re: Aimeos not generating Voucher Codes

Post by gizmo » 29 Aug 2021, 11:47

Thanks for point me to the right code.

The Problem was, that an order with the payment invoice has the status "authorzied". And per default the Voucher E-Mail Job looks for orders with the status "received".

In the typoscript in the Scheduler Job I could overwrite the config like so:

Code: Select all

controller{
    jobs{
        order{
            email{
                voucher{
                    status {
                        0 = 5
                        1 = 6
                    }
                }
            }
        }
    }
}
Now it checks for order with the status "authorized" and "received".

I was not able to overwrite the config via setup.typoscript file, which would be nice so I can add it to my custom EXT.

In the Setup I've used the backend prefix

Code: Select all

module.tx_aimeos.settings.
for the config. (I've also testet the frontend prefix

Code: Select all

plugin.tx_aimeos.settings.
).


Is it even possible to overwrite a config for a Job via typoscript file? Or does it need to be set in the job it self?

User avatar
aimeos
Administrator
Posts: 5643
Joined: 01 Jan 1970, 00:00

Re: Aimeos not generating Voucher Codes

Post by aimeos » 31 Aug 2021, 05:48

You should be able to use the @import statement in the TSConfig field of the scheduler task:
https://docs.typo3.org/m/typo3/referenc ... ludes.html

The settings you add to the TSConfig field can be either prefixed by "plugin.tx_aimeos.settings" or without prefix.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply