/** * Detects if the customer has access to any downloads and, if so, loads them * * @api `shopp('customer.has-downloads')` * @since 1.1 * * @param string $result The output * @param array $options The options * - **from**: A timestamp or datetime (2000-01-01 00:00:00) to get purchases after * - **to**: A timestamp or datetime (2000-01-01 00:00:00) to get purchases before * - **orderby**: `created` (id,created,modified) The column used to sort the downloads * - **order**: `DESC` The order to sort by ascending `ASC` or descending `DESC` * - **show**: The maximum number of downloads to show * @param ShoppCustomer $O The working object * @return bool True if there are downloads, false otherwise **/ public static function has_downloads($result, $options, $O) { $defaults = array('show' => false, 'from' => false, 'to' => false, 'orderby' => 'created', 'order' => 'DESC'); $options = array_merge($defaults, $options); return $O->has_downloads($options); }