Display Supplier data in emailed invoice?

Can anyone tell me how to get the Supplier’s account fields to display in the emailed Supplier invoice? I’m working in 2.0.14.



thanks,

Glen

In 2.0.14, the Suppliers addon doesn’t pass the Supplier profile array to the invoice.tpl email template.



To correct this, open /addons/suppliers/func.php and find:

```php $supplier = fn_get_supplier_data($supplier_id); ```

and replace with:

```php $supplier = fn_get_supplier_data($supplier_id, false);

Registry::get(‘view_mail’)->assign(‘supplier’, $supplier); ```



Now, you can edit /skins/yourskin/mail/addons/suppliers/invoice.tpl and add the Supplier info with code like {$supplier.b_city}



cheers,

Glen

Hi sixnin9,



Thanks for writing up this post, I’m trying to do the exact same thing but am not having any luck. I’ve added the code to the func.php, however I can’t seem to get the fields to display in the invoice.tpl template. Also, how do you know what supplier fields are available? I’m mainly looking to display the supplier name in the email subject and in the email body.



Thanks again for your help.

[quote name=‘designinside’]Also, how do you know what supplier fields are available? [/QUOTE]



To see the contents of a specific array, add this somewhere in your .tpl ```php

{$yourarray|print_r}
```



What version of CS-Cart are you in?



Glen

Thanks for the tip Glen, I’ll give it a try tonight. I’m running 2.0.15