Author Topic: Hack for VirtueUpload to work in 1.1  (Read 12139 times)

jan suhr

  • Jr. Member
  • **
  • Posts: 59
Hack for VirtueUpload to work in 1.1
« on: June 28, 2008, 18:07:44 pm »
I have used VirtueUpload and after upgrading to 1.1 it didn't work anymore.

Problem is easily solved by a minor hack in a few places.

For the older version VirtueUpload used the file account.order_details.php at the end for its code. This code must now be inserted in account.order_details.tpl.php instead.

After about line 543 insert this:
Code: [Select]
    //Include VirtueMart Upload
   
    ?>
<hr/>
<?php
  
$query "SELECT * FROM #__virtueuploads WHERE order_id=" $order_id;
  $db->setQuery($query);
  $uploads $db->loadObjectList();
  if (count($uploads)>0) {
  echo '<strong>Image Files</strong>: <ul>';
  foreach ($uploads as $upload) {
  $downlink $mosConfig_live_site "/index2.php?option=com_virtueupload&task=download&id=" $upload->id;
  if ($upload->comment!='') {
$comment '(<em>' $upload->comment '</em>)';
  } else {
$comment '';
  }
  echo '<li><a href="' $downlink '">' $upload->file_name '</a> ' $comment '</li>';
  }
  echo '</ul><br/>';
  }
?>

<input type="button" class="button" value="Upload your imagefile" onclick="window.open('index2.php?option=com_virtueupload&task=show_form&pop=1&order_id=<?php echo $order_id?>','win2','status=no,toolbar=no,scrollbars=no,titlebar=no,menubar=no,resizable=yes,width=450,height=260,directories=no,location=no');" />
<?php
    
//End VirtueMart upload

N.B. that $database is changed to $db


The other file that VirtueUpload replaces is order.order_print.php and that file doesn't work properly with the language, in 1.1 there is a new convention for the variables in the language files. So the easiest way is to paste in the VirtueUpload part in to the new order.order_print.php file.

At about line 558 look for <td colspan="2"> and after that paste in this code

Code: [Select]
<?php
  $query "SELECT * FROM #__virtueuploads WHERE order_id=" $order_id;
  $db->setQuery($query);
  $uploads $db->loadObjectList();
  if (count($uploads)>0) {
  echo '<strong>Bildfiler</strong>: <ul>';
  foreach ($uploads as $upload) {
  $downlink $mosConfig_live_site "/administrator/index3.php?option=com_virtueupload&task=download&id=" $upload->id;
  echo '<li><a href="' $downlink '">' $upload->file_name '</a></li>';
  }
  echo '</ul><br/>';
  }
  ?>

  <input type="button" class="button" value="Ladda up en bildfil" onclick="window.open('../index2.php?option=com_virtueupload&task=show_form&pop=1&order_id=<?php echo $order_id?>','win2','status=no,toolbar=no,scrollbars=no,titlebar=no,menubar=no,resizable=yes,width=450,height=260,directories=no,location=no');" />


This will make your orderform look alright.

Hope this helps anyone using this great feature.

I might put together a real package later if not someone else does it.

Jan

Jan Suhr
Color Consult AB
Stockholm, Sweden

cnlx

  • Beginner
  • *
  • Posts: 9
Re: Hack for VirtueUpload to work in 1.1
« Reply #1 on: September 19, 2008, 07:21:26 am »
hi Jan, I tried your hack, but still not working. Do you have a full package for you hack, if you can send it to me that will be very appreciated.
Thanks very much.
Vanness

Mike Horsten

  • Beginner
  • *
  • Posts: 24
Re: Hack for VirtueUpload to work in 1.1
« Reply #2 on: October 01, 2008, 15:29:31 pm »
Love to have it also. So a total package.
Im not that good with PHP

Mike

Ruud

  • Beginner
  • *
  • Posts: 1
Re: Hack for VirtueUpload to work in 1.1
« Reply #3 on: October 15, 2008, 10:52:50 am »
Hy Jan,

Cant get you code to work either. The code for the account.order_details.php and the order.order_print.php files is a little different in the virtuemart 1.1.2 version. Do you have an updated patch? That would be great.

t.i.a.

jamesls

  • Beginner
  • *
  • Posts: 9
Re: Hack for VirtueUpload to work in 1.1
« Reply #4 on: January 16, 2009, 23:27:05 pm »
I would also love this as I have been reading a lot of posts dating as far back as 2006.

I am surprised that the VM team has not integrated this already with the amount of people wanting this feature

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27670
  • Always on vacation
    • Jenkin Hill Internet
Re: Hack for VirtueUpload to work in 1.1
« Reply #5 on: January 17, 2009, 23:02:11 pm »
If a lot of you want it why not get together & commission a programmer to develop it for you?

eg http://www.scriptlance.com/projects/1198914699.shtml
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.11 10292 on Joomla 3.9.16 PHP 7.0.33

Joseph

  • Beginner
  • *
  • Posts: 5
Re: Hack for VirtueUpload to work in 1.1
« Reply #6 on: May 16, 2009, 15:25:53 pm »
Can anyone please give me this component for virtuemart 1.1.3 please. :D