/* 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(); $productsInCollection = getcollection(1234567890); //where 1234567890 is the colelction id (see user guide for more information) $isProductInCollection = false; foreach ($DATA['items'] as $item) { if (in_array($item['product_id'],$productsInCollection)) { $isProductInCollection = true; } } return $_RATES; /* do not edit below this line */ }