Post by apartamenti » Tue Dec 29, 2015 11:30 pm

I have add Custom field with name VATID.

then on admin/controller/sale/order.php

$format = '{firstname} {lastname}' . "\n" . '{company}' . "\n" . '{vatid}' . "\n" . '{address_1}' . "\n" . '{address_2}' . "\n" . '{city} {postcode}' . "\n" . '{zone}' . "\n" . '{country}';

$find = array(
'{firstname}',
'{lastname}',
'{company}',
'{vatid}',
'{address_1}',
'{address_2}',
'{city}',
'{postcode}',
'{zone}',
'{zone_code}',
'{country}'
);

$replace = array(
'firstname' => $order_info['payment_firstname'],
'lastname' => $order_info['payment_lastname'],
'company' => $order_info['payment_company'],
'vatid' => $order_info['payment_custom_field'],
'address_1' => $order_info['payment_address_1'],
'address_2' => $order_info['payment_address_2'],
'city' => $order_info['payment_city'],
'postcode' => $order_info['payment_postcode'],
'zone' => $order_info['payment_zone'],
'zone_code' => $order_info['payment_zone_code'],
'country' => $order_info['payment_country']
);

$payment_address = str_replace(array("\r\n", "\r", "\n"), '<br />', preg_replace(array("/\s\s+/", "/\r\r+/", "/\n\n+/"), '<br />', trim(str_replace($find, $replace, $format))));

When i echo $payment_address in order_invoice.tpl VATID is not showing!

Имоти - имоти под наем


User avatar
Newbie

Posts

Joined
Tue Sep 29, 2015 10:56 pm


Post by IP_CAM » Wed Dec 30, 2015 2:22 am

I would have 'mis'-used an existing, but not used default Variable, like the Fax Number, for such a Task, then, you would just have to rename a language line contnent. It would have made Life a little easier, I assume. There are Mod's, and possibly even OC v.2 Functions, making such visible on invoices as well.

just to mention it. ;)
Ernie
bigmax.ch/shop/

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by apartamenti » Wed Dec 30, 2015 2:37 am

I am not trying to show my own company VATID :) VATID for customers. O0

Имоти - имоти под наем


User avatar
Newbie

Posts

Joined
Tue Sep 29, 2015 10:56 pm


Post by IP_CAM » Wed Dec 30, 2015 2:50 am

Sorry, but I figured, you wanted to display some Customer related Information on the invoice,
and the (text/title-wise adapted) Customer FAX-Field Content would be such a place, to do this...
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by apartamenti » Wed Dec 30, 2015 3:11 am

IP_CAM wrote:Sorry, but I figured, you wanted to display some Customer related Information on the invoice,
and the (text/title-wise adapted) Customer FAX-Field Content would be such a place, to do this...
Ernie
Exactly :)

Имоти - имоти под наем


User avatar
Newbie

Posts

Joined
Tue Sep 29, 2015 10:56 pm


Post by IP_CAM » Wed Dec 30, 2015 4:11 am

then, there you go:
http://www.opencart.com/index.php?route ... n_id=22666

then, find some Mod, or possibly built-in Option, to display it on the invoice:
http://www.opencart.com/index.php?route ... %20Invoice

I once created such a Mod for OC v.1.5.6.x:
http://www.opencart.com/index.php?route ... n_id=22454
you should be able, I guess, to make it work!

Good Luck
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by apartamenti » Wed Dec 30, 2015 5:29 am

IP_CAM wrote:then, there you go:
http://www.opencart.com/index.php?route ... n_id=22666

then, find some Mod, or possibly built-in Option, to display it on the invoice:
http://www.opencart.com/index.php?route ... %20Invoice

I once created such a Mod for OC v.1.5.6.x:
http://www.opencart.com/index.php?route ... n_id=22454
you should be able, I guess, to make it work!

Good Luck
Ernie
No luck :(

Имоти - имоти под наем


User avatar
Newbie

Posts

Joined
Tue Sep 29, 2015 10:56 pm


Post by apartamenti » Wed Dec 30, 2015 5:04 pm

Problem is fixed! I clean the cache! Thank you very much to all and Happy new year!

Имоти - имоти под наем


User avatar
Newbie

Posts

Joined
Tue Sep 29, 2015 10:56 pm

Who is online

Users browsing this forum: No registered users and 119 guests