CommerceLicenseFile.class.php in Commerce File 7.2
File
plugins/license_type/CommerceLicenseFile.class.php
View source
<?php
class CommerceLicenseFile extends CommerceLicenseBase {
public function isConfigurable() {
return FALSE;
}
public function accessDetails() {
$product = $this->wrapper->product
->value();
$display = array(
'label' => 'hidden',
'type' => 'commerce_file',
'settings' => array(
'check_access' => FALSE,
),
);
$output = field_view_field('commerce_product', $product, 'commerce_file', $display);
return drupal_render($output);
}
public function checkoutCompletionMessage() {
$_SESSION['commerce_license_uid'] = $this->uid;
$product = $this->wrapper->product
->value();
$message = t('Thank you for purchasing %product.', array(
'%product' => $product->title,
)) . '<br />';
$message .= t('Download now:');
return $message . $this
->accessDetails();
}
public function renew($expires) {
parent::renew($expires);
commerce_file_download_log_clear(array(
'license_id' => $this->license_id,
));
}
}