// Hook to restrict shipping based on product and destination postcode add_filter('woocommerce_package_rates', 'restrict_shipping_by_product_and_postcode', 10, 2); function restrict_shipping_by_product_and_postcode($rates, $package) { // Replace '123456' with the postcode of Lucknow $lucknow_postcode = '226022'; // Check if the destination postcode is different from Lucknow if ($package['destination']['postcode'] != $lucknow_postcode) { // Check if there are restricted products in the cart $restricted_products = array(9651); // Replace with the IDs of the restricted products foreach ($package['contents'] as $item_id => $values) { $product_id = $values['product_id']; if (in_array($product_id, $restricted_products)) { // If any restricted product is found, unset all shipping methods $rates = array(); break; } } } return $rates; }{"id":37,"count":4,"description":"Kesariya Malai Gillauri a Ram Asrey exclusive sweet which has been invented by us.\r\n\r\nRam Asrey has been credited with innovation of many sweets over the years. However, the most famous being MALAI PAAN. \u00a0 [expand title='Continue reading...']It has probably the rarest collection of exclusive sweets starting from 150 years old Kashmiri delight NAKUL to the most recent FORTUNE BITES. Apart from it, it also pampers your taste with traditional BENGALI SWEETS, GAZAKS, PETHA delights etc.\r\n