if (isset($_REQUEST[$arParams["ACTION_VARIABLE"]]) && isset($_REQUEST[$arParams["PRODUCT_ID_VARIABLE"]]))
{
if(isset($_REQUEST[$arParams["ACTION_VARIABLE"]."BUY"]))
$action = "BUY";
elseif(isset($_REQUEST[$arParams["ACTION_VARIABLE"]."ADD2BASKET"]))
$action = "ADD2BASKET";
else
$action = strtoupper($_REQUEST[$arParams["ACTION_VARIABLE"]]);
...