How can I get vat_id via SOAP without additional modifications?
-
13-04-2021 - |
Question
I understand that, by default, Magento doesn't expose the vat_id field via SOAP. The accepted answer there is to edit the core/add a module. Unfortunately, I don't have such luxury because I don't have the filesystem access to Magento: I have just the basic SOAP access and I cannot do any modification.
So: how do I retrive the vat_id via SOAP from a Magento ver. 1.9.4.2?
This is what I've tried so far:
$result = $proxy->salesOrderInfo($sessionId, '200000006');
$customer = $proxy->customerCustomerInfo($sessionId, '765');
$addresses = = $proxy->customerAddressList($sessionId, '765');
foreach $addresses:
$proxy->customerAddressList($sessionId, '211');
Unfortunately, the vat_id is nowhere to be seen.
What can I do?
Solution
This is my solution: copy the vat_id
to the taxvat
field in the checkout page, then use taxvat
from SOAP:
<script>
jQuery(document).on('change', '#billing\\:vat_id', function() {
var vat = jQuery(this).val();
jQuery('#billing\\:taxvat').val(vat);
});
</script>
(jQuery required)
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange