$('.popular_prd').find('.view-content')
This will just return a jQuery object which never evaluates to false
You need to check the length of it
if(!$('.popular_prd').find('.view-content').length) { //no products.}
$('.popular_prd').find('.view-content')
This will just return a jQuery object which never evaluates to false
You need to check the length of it
if(!$('.popular_prd').find('.view-content').length) { //no products.}