/* This macro will be parsed as PHP code (see http://www.php.net) The calculateshipping function is called every time a shipping calculation request is made by Shopify. The function must return an array of available shipping options, otherwise no shipping options will be returned to your customers. */ function calculateshipping($DATA) { /* do not edit above this line */ $_RATES = array(); $DATA = enrichProductDetails($DATA); $containsTag = false; //looks for a tag named MY_TAG (case sensitive) foreach ($DATA['items'] as $item) { if (isset($item['tags']) && in_array('MY_TAG',$item['tags'])) { $containsTag = true; } } return $_RATES; /* do not edit below this line */ }