JHtml::_('jquery.framework'); $doc->addStylesheet(JURI::base() . 'components/com_docmanpaypal/css/style.css'); $doc->addScript(JURI::base() . 'components/com_docmanpaypal/js/script.js'); $lang = JFactory::getLanguage(); $extension = 'com_docmanpaypal'; $lang->load($extension, JPATH_SITE . '/components/com_docmanpaypal'); include_once(JPATH_SITE . '/administrator/components/com_docmanpaypal/docmanpaypal.class.php'); $dm = new docmanpaypal(); $item = $dm->getItem($document->id); $price = $item->price; if ($price > 0 && $dm->canDownload($document->id,'',false) == false) { //$showAddToCart = true; $showBuyNow = true; $currencySymbol = $dm->currencies[$dm->cfg['currency']]['ASCII']; if ($dm->cfg['pdfPreviewPages'] > 0 && pathinfo($item->storage_path, PATHINFO_EXTENSION) == 'pdf') { $showPreviewButton = true; } } $show_download = true; $priceFormat = money_format($price, 2); if ($showBuyNow) { $show_download = false; } if ($showBuyNow) {
} } /** * Free X seconds after registration */ /*if (time() - strtotime($my->registerDate) <= $dm->cfg['free_download_after_seconds'] && $price > 0) { $price = 0; }*/ /** * The user is back from PayPal and has the order key, or it's the delivery email, can he download? Did he hit the download limit? */ //if ($order_id > 0 && $price > 0) { if ($price > 0) { $canDownload = $dm->canDownload($doc_id,$key); if ($canDownload == true) { $price = 0; } } //Check if it's offline good, and take the user to buy now again. if ($item->offlineGood > 0) { $price = $item->price; } /** * If there is no reason that let's the user download for free, we redirect him to finish the order! */ if ($price > 0) {