Ok, you need to add in your snippet before this line
$url = $modx->makeUrl($redirectTo, '', '', $redirectScheme);
this:
setcookie('added_prod', $productId, time() + 60*60*24*30, '/'); // set cookie
and then create snippet [[!product_added]]
<?php
if (isset($_COOKIE) && isset($_COOKIE['added_prod']) && !empty($_COOKIE['added_prod'])) {
$id_prod = (int) $_COOKIE['added_prod'];
$resource = $modx->getObject('modResource',$id_prod);
setcookie("added_prod", "", time()-3600); // unset cookie
return '<div class="message">The product "'.$resource->get('pagetitle').'" is added to the basket</div>';
}