// 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;
}
MIX SWEETS BOX -I Archives - Ram Asrey Sweets
ramasreyfoods@gmail.com +919454512700, 0522-4006000 Hazratganj, Lucknow Opens at 08:00am
Mix sweets box are a collection of different variety of sweets. These are an ideal gifting and sweets tasting option popular among customers. These boxes come in different variants of weights and sweet varieties. So go ahead and order your favorite combination now!Continue reading
Alternatively you may leave your comments for including the choice of sweets collection and we would be happy to include it online.