Skip to content

Instantly share code, notes, and snippets.

View dyslabpro's full-sized avatar

Yurii Diubets dyslabpro

View GitHub Profile
<?php
function _commerce_tax_included_commerce_order_presave($order) {
//checkout_shipping
$custom_vat = 0;
$profile_id = $order->commerce_customer_shipping['und'][0]['profile_id'];
$profile = commerce_customer_profile_load($profile_id);
if ($profile->commerce_customer_address['und'][0]['postal_code'] == 'GY Guernsey') {
//change vat
$order_wrapper = entity_metadata_wrapper('commerce_order', $order);