Order ID in email subject instead of invoice no

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)
Spam and unrelated posts will be removed immediately!
promptnet
Posts: 77
Joined: 24 Jul 2019, 12:22

Order ID in email subject instead of invoice no

Post by promptnet » 18 Dec 2024, 11:05

Hi,

after the upgrade to 2024 the order email has the invoice no set in the email subject.
For easier handling we still need the order id instead.
How or where can that be set.

Aimeos: 24.10.2
TYPO3: 12.4.23
Attachments
image002.png
image002.png (62.56 KiB) Viewed 16932 times
image001.png
image001.png (159.47 KiB) Viewed 16932 times

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

Re: Order ID in email subject instead of invoice no

Post by aimeos » 18 Dec 2024, 23:10

The easiest way is to set the value of the invoiceno column in the mshop_locale_site table to the latest order ID. Then, both are the same. For old orders, you can also set the mshop_order.invoiceno field to the same value as the order ID.

Alternatively, you can add a macro for "invoicenumber" in your own extension:

Code: Select all

\Aimeos\MShop\Order\Item\Standard::macro('invoicenumber', function($order) {
   return $order->getId();
});
See also: https://github.com/aimeos/aimeos-core/b ... hp#L49-L51
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

promptnet
Posts: 77
Joined: 24 Jul 2019, 12:22

Re: Order ID in email subject instead of invoice no

Post by promptnet » 19 Dec 2024, 06:50

That's simple indeed!
Thanks.

promptnet
Posts: 77
Joined: 24 Jul 2019, 12:22

Re: Order ID in email subject instead of invoice no

Post by promptnet » 23 Jan 2025, 10:17

Unfortunately, the simple solution doesn't work for the future but only for the current (or past) order.
If a user breaks up during the checkout, only the order number is incremented but not the invoice number. That's why we now have the same problem again.
How can I implement your suggestion in my extension? I checked https://aimeos.org/docs/2024.x/typo3/extend/ but for me it's not clear how to extend that very method (Aimeos\MShop\Order\Item\Standard::getInvoiceNumber()).

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

Re: Order ID in email subject instead of invoice no

Post by aimeos » 24 Jan 2025, 13:15

You can add it to the ext_localconf.php if your project specific Aimeos extension.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

promptnet
Posts: 77
Joined: 24 Jul 2019, 12:22

Re: Order ID in email subject instead of invoice no

Post by promptnet » 24 Jan 2025, 13:18

Ah, ok, thanks.

Post Reply