I want to override email template (`/template/mail/order_confirm.tpl`) via my extension, but AbanteCart doesn't allow to do that for some reason. Also I'd like to modify products list, before sending email, but I don't see any `Init` or `Update` hooks inside the Order Model which performs sending (`admin/model/sale/order.php`), so I can't do that. The only `hk_confirm`
hook is called before products list generation, so it doesn't help.
I wonder why it is not allowed. You should be able to include this and it will automatically replace it.
Double check that you have it in correct directory and included file path in main.php of extension.
Extension should be enabled
Quote from: eCommerce Core on August 25, 2016, 09:10:31 AM
I wonder why it is not allowed. You should be able to include this and it will automatically replace it.
Email template is called using
template->fetch method:
github.com/abantecart/abantecart-src/tree/master/public_html/storefront/model/checkout/order.php#L563And it seems like this method doesn't look into extensions folder:
github.com/abantecart/abantecart-src/tree/master/public_html/core/lib/template.php#L28-L57Am I wrong?
Now I get it. You are right. I was thinking of regular templates.
Currently, you can override it only with new template or replace this file in default template.
if (file_exists(DIR_TEMPLATE . $this->config->get('config_storefront_template') . '/template/' . $filename)){
$filename = $this->config->get('config_storefront_template') . '/template/' . $filename;
} else{
$filename = 'default/template/' . $filename;
}
Quote from: eCommerce Core on August 26, 2016, 07:24:21 AM
Now I get it. You are right. I was thinking of regular templates.
Currently, you can override it only with new template or replace this file in default template.
Thank you.
So, there is no way to do that via extension?
1. I can't force Order model to use some other template, correct?
2. Replacing original template is not extension way.
Confirm, please.
Unfortunately, you are correct. You can not replace this with an extension approach.
We will try to put an extension override in here for 1.2.9 or 1.3
Let's keep this post open and we will come back once we will have a code change here.
Quote from: eCommerce Core on September 09, 2016, 09:04:56 PM
We will try to put an extension override in here for 1.2.9 or 1.3
Let's keep this post open and we will come back once we will have a code change here.
Thank you. It would be great if you could include it in 1.2.9.