I think you must try changing $item[‘id’] to this
foreach ( $order->get_items() as $item )
{
$product = $item->get_data();
$item_id = $item->get_product_id();
if( $item_id == 1136 )
{
// Keep Your code here.
}
}
Keep Posted.
I think you must try changing $item[‘id’] to this
foreach ( $order->get_items() as $item )
{
$product = $item->get_data();
$item_id = $item->get_product_id();
if( $item_id == 1136 )
{
// Keep Your code here.
}
}
Keep Posted.