Skip to content
Snippets Groups Projects
Commit 0c5e9a5e authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Make the order object available in the templates (so one can add checks on...

Make the order object available in the templates (so one can add checks on order status or date, like the revocation right termination message for downloads)
parent cc696ef6
No related branches found
No related tags found
No related merge requests found
BASE=downloads_for_sale BASE=downloads_for_sale
PLUGINTYPE=vmcustom PLUGINTYPE=vmcustom
VERSION=1.7 VERSION=1.8
PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html
......
...@@ -433,6 +433,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin { ...@@ -433,6 +433,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
case 'paid_download': case 'paid_download':
if ($orderitem) { if ($orderitem) {
$order = $this->orderDataFromItem ($orderitem->virtuemart_order_item_id); $order = $this->orderDataFromItem ($orderitem->virtuemart_order_item_id);
$field->order = $order;
} elseif ($cuid>0) { } elseif ($cuid>0) {
$orderModel = VmModel::getModel('orders'); $orderModel = VmModel::getModel('orders');
foreach ($orderModel->getOrdersList($cuid, true) as $ol) { foreach ($orderModel->getOrdersList($cuid, true) as $ol) {
...@@ -440,6 +441,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin { ...@@ -440,6 +441,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
foreach ($o['items'] as $i) { foreach ($o['items'] as $i) {
if ($i->virtuemart_product_id == $field->virtuemart_product_id && in_array($i->order_status, $field->paid_status)) { if ($i->virtuemart_product_id == $field->virtuemart_product_id && in_array($i->order_status, $field->paid_status)) {
$order = $o['details']['BT']; $order = $o['details']['BT'];
$field->order = $o;
} }
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl> <authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright> <copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license> <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license>
<version>1.7</version> <version>1.8</version>
<description>VMCUSTOM_DLSALE_DESC</description> <description>VMCUSTOM_DLSALE_DESC</description>
<files> <files>
<filename plugin="downloads_for_sale">downloads_for_sale.php</filename> <filename plugin="downloads_for_sale">downloads_for_sale.php</filename>
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment