That warning was suppressed in earlier PHP versions. But now PHP7.2+ has elevated the warning to encourage better coding practices.
The solution is to test the variable to confirm it is countable BEFORE counting it. It would be something like this:
Code:
$smarty->assign('wPidCount', (($sale['criteria']['wholesale'] instanceof Countable) && count(isset($sale['criteria']['wholesale'])) ? $sale['criteria']['wholesale'] : 0)+1);
This is just a coding example and may not work as-is. My example is just to give you a fundamental idea on how to fix it.
BTW, PHP7.3 introduced the is_countable() function as alternate way to do the "instanceof Countable" var test. Details here:
https://www.php.net/manual/en/function.is-countable.php
.