Post by nikolaoskai » Wed Dec 20, 2017 4:39 pm

Can someone help me please to modify the order invoice and order email.
I want to add Customer field under Shipping method.
I have already tried to add in order_invoice.tpl file this
<?php echo $text_customer_group_id; ?></b> <?php echo $order['customer_group_id']; ?>
but it doesn't work.
Need some help please.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by paulfeakins » Wed Dec 20, 2017 6:11 pm

Try here:

Code: Select all

/catalog/view/theme/default/template/mail/order.tpl

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Wed Dec 20, 2017 9:16 pm

- catalog/view/theme/<your_custom_theme>/template/mail/order.tpl file if using a custom theme.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Wed Dec 20, 2017 11:19 pm

Thank you for your quick answer.
I have tried this but i get error in email.
Notice: Undefined variable: text_customer_group_id in catalog/view/theme/journal2/template/mail/order.tpl on line 34 Notice: Undefined variable: order in catalog/view/theme/journal2/template/mail/order.tpl on line 34

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Wed Dec 20, 2017 11:21 pm

Please post your TPL file as an attachment. I will take a look at it.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Thu Dec 21, 2017 12:10 am

Here is the file please.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Thu Dec 21, 2017 12:12 am

Where?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Thu Dec 21, 2017 12:13 am

Somehow i can't add attachment

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by nikolaoskai » Thu Dec 21, 2017 12:14 am


Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Thu Dec 21, 2017 12:18 am

No OC version posted on the first post. This should of been verified by a forum moderator. Which OC version are you using?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Thu Dec 21, 2017 12:35 am

For v2.3.0.2 release,

in your catalog/model/checkout/order.php file,

find:

Code: Select all

$data['order_status'] = $order_status;
add below:

Code: Select all

$this->load->model('setting/setting');
				
				$setting = $this->model_setting_setting->getSetting('config', $order_info['store_id']);
				
				$customer_group_id = isset($setting['config_customer_group_id']) ? $setting['config_customer_group_id'] : $this->config->get('config_customer_group_id');
				
				$data['text_customer_group_id'] = sprintf($this->language->get('text_customer_group_id'), (int)$customer_group_id);
Then, in your catalog/language/<your_language_code>/mail/order.php file,

add at the bottom:

Code: Select all

$_['text_customer_group_id'] = 'Customer Group ID: %s';
In your mail/order.tpl file,

replace:

Code: Select all

<?php echo $text_customer_group_id; ?></b> <?php echo $order['customer_group_id']; ?>
with:

Code: Select all

<?php if ($text_customer_group_id) { ?>
    <?php echo $text_customer_group_id; ?></b> <?php echo $order['customer_group_id']; ?>
<?php } ?>
This should rectify the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Thu Dec 21, 2017 3:27 pm

Hello, my Opencart version is 2.3.0.2.
I have tried your suggestion but again i get an error.
text_customer_group_id Notice: Undefined variable: order in catalog/view/theme/journal2/template/mail/order.tpl on line 35

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Thu Dec 21, 2017 9:35 pm

Sorry, it should be this one:

Code: Select all

<?php if ($text_customer_group_id) { ?>
    <?php echo $text_customer_group_id; ?>
<?php } ?>

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Fri Dec 22, 2017 2:13 am

Sorry but still it does't work.
No error it shows only this "text_customer_group_id" nothing more.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Fri Dec 22, 2017 2:26 am

Did you added the language definition into the mail/order.php language file as well?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Fri Dec 22, 2017 2:45 am

Yes i have 2 languages and i have added to both of them.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Fri Dec 22, 2017 3:43 am

Please post the files as an attachment, I will take a look.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Fri Dec 22, 2017 10:57 pm

Hi, here are the files.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am

Post by straightlight » Fri Dec 22, 2017 11:14 pm

$customer_group_id = isset($setting['config_customer_group_id']) ? $setting['config_customer_group_id'] : $this->config->get(<space><space><space><space><space>'config_customer_group_id');
Have no idea where the spaces comes from (I added the word <space> in this example). It should be like this:

Code: Select all

$customer_group_id = isset($setting['config_customer_group_id']) ? $setting['config_customer_group_id'] : $this->config->get('config_customer_group_id');
In your mail/order.tpl file from your ZIP file, I don't see anywhere where the provided code has been added.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by nikolaoskai » Fri Dec 22, 2017 11:19 pm

Sorry i have it removed because the shop is online and didn't wont to have errors in orders.

Just tested again but still the same error.

Newbie

Posts

Joined
Wed Nov 15, 2017 1:43 am
Who is online

Users browsing this forum: No registered users and 0 guests