<?php public function addToCartUrl($site, $statamic, $addons)
{
return 'https://statamic.com/cart/bulk-add?'.http_build_query([
'site' => $site->key(),
'statamic' => ! $statamic->valid(),
'products' => $addons->reject->valid()->map->addon()->map(function ($addon) {
$product = $addon->marketplaceId();
if ($edition = $addon->edition()) {
$product .= ':'.$edition;
}
return $product;
})->implode(','),
]);
}
}