Changing Product Email Display
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Changing Product Email Display
Hi,
I am trying to alter the display of the product emails that get sent to the client upon successful purchase of a product - but I'm have a lot of trouble isolating the templates to edit!
It seems that when you generate a product email it just uses the same template as the product display page which is used on the frontend of the site too - rather than using it's own template. How would I go about altering a specific template just for the email and including it. It seems this framework uses a lot of 'magic' to include its templates and makes it quite confusing to know what to alter!
I'm sure it is quite simple and I've over looking something obvious - any help would be appreciated.
Thanks
I am trying to alter the display of the product emails that get sent to the client upon successful purchase of a product - but I'm have a lot of trouble isolating the templates to edit!
It seems that when you generate a product email it just uses the same template as the product display page which is used on the frontend of the site too - rather than using it's own template. How would I go about altering a specific template just for the email and including it. It seems this framework uses a lot of 'magic' to include its templates and makes it quite confusing to know what to alter!
I'm sure it is quite simple and I've over looking something obvious - any help would be appreciated.
Thanks
Re: Changing Product Email Display
Normally, it's pretty straight-forward: One component/subpart has two templates (body and header).Luke wrote: I am trying to alter the display of the product emails that get sent to the client upon successful purchase of a product - but I'm have a lot of trouble isolating the templates to edit!
It seems that when you generate a product email it just uses the same template as the product display page which is used on the frontend of the site too - rather than using it's own template. How would I go about altering a specific template just for the email and including it. It seems this framework uses a lot of 'magic' to include its templates and makes it quite confusing to know what to alter!
In this case you are right, the "summary" templates are shared between the "basket standard", "checkout standard" and the HTML delivery and payment e-mails and there can't be different templates configured for them. We will change this in the next major release.
In the meantime, you could create a new class which extends from the subpart class you want to change the template to a different one (e.g. https://github.com/aimeos/aimeos-core/b ... efault.php) and overwrite the "getBody()" method using a different template path (see https://github.com/aimeos/aimeos-core/b ... efault.php for example). Please place your new class and template in the same directory structure in an Aimeos extension (https://aimeos.org/developer/extensions/), then it will work as expected.
Re: Changing Product Email Display
Hi thanks for the reply .
I have put my new file in
/home/me/html/our-client/ext/ai-aimeos-our-client/client/html/src/Client/Html/Email/Payment/Default.php
But it doesnt get picked up at any point - the path is the exact same as the one which gets picked up in the extension so I dont know what I've done wrong..
P.S I have cleared the cache etc nothing seems to work
I have put my new file in
/home/me/html/our-client/ext/ai-aimeos-our-client/client/html/src/Client/Html/Email/Payment/Default.php
But it doesnt get picked up at any point - the path is the exact same as the one which gets picked up in the extension so I dont know what I've done wrong..
P.S I have cleared the cache etc nothing seems to work
Re: Changing Product Email Display
You can not copy the existing class to a new location but have to *extend* the class instead, giving your new class a new name, e.g. "Client/Html/Email/Payment/Summary/Detail/Myproject.php". Afterwards, you can configure that your new class should be used: https://aimeos.org/docs/Configuration/C ... etail/nameLuke wrote: I have put my new file in
/home/me/html/our-client/ext/ai-aimeos-our-client/client/html/src/Client/Html/Email/Payment/Default.php
But it doesnt get picked up at any point - the path is the exact same as the one which gets picked up in the extension so I dont know what I've done wrong..
Re: Changing Product Email Display
Hi,
I still don't really understand what is going wrong / what I am doing wrong. I posted a reply yesterday but somehow it didn't save
Anyway - I understand how this is theoretically meant to work - very similar to the way Magento works I think. I just can't get it to actually work
So I've made a new class like so :
class Client_Html_Email_Payment_Html_Summary_Detail_Client
extends Client_Html_Common_Summary_Detail_Default
{
}
Which is in the folder directory
Client/Html/Email/Payment/Html/Summary/Detail/Client.php
And in the config shop file i have put
'client' => array(
'html' => array(
'email' => array(
'payment' => array(
'html' => array(
'summary' => array(
'detail' => 'client',
** Client name has been replaced with 'Client'
Please let me know what I am missing, I'm very confused as to what I am doing wrong!
Thanks for all the help you've given me so fa it is appreciated
I still don't really understand what is going wrong / what I am doing wrong. I posted a reply yesterday but somehow it didn't save
Anyway - I understand how this is theoretically meant to work - very similar to the way Magento works I think. I just can't get it to actually work
So I've made a new class like so :
class Client_Html_Email_Payment_Html_Summary_Detail_Client
extends Client_Html_Common_Summary_Detail_Default
{
}
Which is in the folder directory
Client/Html/Email/Payment/Html/Summary/Detail/Client.php
And in the config shop file i have put
'client' => array(
'html' => array(
'email' => array(
'payment' => array(
'html' => array(
'summary' => array(
'detail' => 'client',
** Client name has been replaced with 'Client'
Please let me know what I am missing, I'm very confused as to what I am doing wrong!
Thanks for all the help you've given me so fa it is appreciated
Re: Changing Product Email Display
There's only one minor error in you configuration. It must be:Luke wrote:Code: Select all
'client' => array( 'html' => array( 'email' => array( 'payment' => array( 'html' => array( 'summary' => array( 'detail' => 'client',
Code: Select all
....
'summary' => array(
'detail' => array(
'name' => 'Client',
Re: Changing Product Email Display
^ so close yet so far
Thanks for the help -> got it working
Thanks for the help -> got it working
Re: Changing Product Email Display
Great!Luke wrote:Thanks for the help -> got it working
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star