Post by Qphoria » Fri Feb 19, 2010 5:16 am

This is a mod to add direct file links to downloads as part of the order email.

It is only for 1.4.0 or later, as that is when the order email was moved to a template.

1. EDIT: catalog/view/theme/YOURTHEME/template/mail/order_confirm.tpl

2. FIND THE LAST INSTANCE OF:

Code: Select all

<?php } ?>
3. BEFORE, ADD:

Code: Select all

<!--//Q: BOF Add download links to email -->
  <?php
  global $db, $language, $loader;
  $url = new Url();
  Registry::set('url', $url);
  $loader->language('account/download');
  $query = $db->query("SELECT order_download_id, name FROM " . DB_PREFIX . "order_download WHERE order_id = '" . $order_id . "'");
  ?>
  <?php if ($query->num_rows) { ?>
  <tr>
    <td align="left" style="background-color: #069; color: #FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;"><?php echo $language->get('text_downloads'); ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left">
      <?php foreach ($query->rows as $download) { ?>
      - <a href="<?php echo $url->http('account/download/download&order_download_id=') . $download['order_download_id']; ?>"><?php echo $download['name']; ?></a><br/>
      <?php } ?>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <?php } ?>
  <!--//Q: EOF Add download links to email -->

Attachments

emaildownload.jpg

emaildownload.jpg (26.24 KiB) Viewed 7403 times


Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by caspara » Thu Feb 25, 2010 12:36 pm

Didn't seem to work for me with OpenCart 1.4. Added the code, uploaded and upon receiving the order confirmation, the normal customer email notification remained the same (no direct download link). Did I do something wrong?

DownloadXS.com : Stock Photos & Vintage Illustrations, Fresh PLR Articles and more.
http://www.DownloadXS.com


Newbie

Posts

Joined
Fri Feb 19, 2010 2:16 am

Post by Qphoria » Thu Feb 25, 2010 1:36 pm

nope.. that should be it. I'll try it on another of my test installs

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by caspara » Fri Feb 26, 2010 8:15 am

[EDIT]

Umm, I was wrong.

The mod works fine as is. Sorry.

Chris
Last edited by caspara on Fri Feb 26, 2010 10:05 am, edited 2 times in total.

DownloadXS.com : Stock Photos & Vintage Illustrations, Fresh PLR Articles and more.
http://www.DownloadXS.com


Newbie

Posts

Joined
Fri Feb 19, 2010 2:16 am

Post by Qphoria » Fri Feb 26, 2010 9:20 am

That really isn't right.. but I'll let you run with it .

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by allenshea » Mon Apr 05, 2010 10:16 pm

how to make this working for 1.4.6?

If I add these code, the host didn't send me any new order, but once I deleted them, I can always got new orders.

How can I fix it?

Thanks.

Allen

I know nothing about PHP and SQL, but I still try my best to understand it.


Active Member

Posts

Joined
Mon Dec 14, 2009 10:01 pm

Post by cwmahan » Fri Apr 30, 2010 6:46 am

Has anyone gotten this mod to work in 1.4.7?

I've added it as specified above, but it seems to break the email in general. At least, when its added, no order confirmation email is sent at all.

Would love to know if its just me or not.

thanks for the mod in the first place, and if I get it working b4 anyone else I'll try to post the fix here...

Newbie

Posts

Joined
Fri Apr 30, 2010 6:14 am

Post by Qphoria » Fri Apr 30, 2010 9:33 am

if it breaks completely then there is likely an error being logged in the error log. What does it show ? (system->error log)

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by dramony » Fri May 07, 2010 6:19 pm

how about for 1.3.2?
Thanks!

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 12:34 pm

Post by huxleydata » Tue May 25, 2010 12:07 am

cwmahan wrote:Has anyone gotten this mod to work in 1.4.7?

I've added it as specified above, but it seems to break the email in general. At least, when its added, no order confirmation email is sent at all.

Would love to know if its just me or not.

thanks for the mod in the first place, and if I get it working b4 anyone else I'll try to post the fix here...
I get exactly the same problem when I add the mod. No error message in the error logs. If I remove the code the confirmation is sent out again. My PHP skills are limited, but I'm pretty sure I've followed the instructions OK.

Would be really good to get this to work :)

Newbie

Posts

Joined
Mon May 24, 2010 5:29 pm

Post by mancourt » Fri May 28, 2010 8:10 am

Bumping this one... Anyone get it to work yet in 1.4.7?

Newbie

Posts

Joined
Sat Mar 06, 2010 4:26 am

Post by chillala » Tue Dec 07, 2010 8:49 pm

Bumping, hoping to see this can work in the latest 1.4.9.2. Anyone?

Newbie

Posts

Joined
Tue Dec 07, 2010 8:17 pm

Post by neosdesign » Fri Jan 14, 2011 2:05 am

Has anyone got this confirmed working on 1.4.9.1? I would very much like to use it. Thanks!

New member

Posts

Joined
Tue Aug 17, 2010 5:44 pm

Post by wintech » Sat May 28, 2011 12:16 pm

For anyone who might be interested in this, I was having the same problem where after inserting this code I would no longer get an order confirmation email sent to the customer.
I have been able to get this working successfully in OC 1.4.9.5 using the modified code below.
The problem I was having was with the url variable so I have just changed the code to use the $store_url variable already assigned in order_confirm.tpl.

Regards.

Code: Select all

<!--//Q: BOF Add download links to email -->
      <?php
      global $db, $language, $loader;
      $loader->language('account/download');
      $query = $db->query("SELECT order_download_id, name FROM " . DB_PREFIX . "order_download WHERE order_id = '" . $order_id . "'");
      ?>
      <?php if ($query->num_rows) { ?>
      <tr>
        <td align="left" style="background-color: #069; color: #FFF; font-size: 12px; font-weight: bold; padding: 0.5em 1em;"><?php echo $language->get('text_downloads'); ?></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="left">
          <?php foreach ($query->rows as $download) { ?>
          <a href="<?php echo $store_url; ?>index.php?route=account/download/download&order_download_id=<?php echo $download['order_download_id']; ?>"><?php echo $download['name']; ?></a><br/>
          <?php } ?>
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
      <?php } ?>
      <!--//Q: EOF Add download links to email -->

Newbie

Posts

Joined
Sat Sep 11, 2010 5:56 am

Post by kgerken » Wed Jun 08, 2011 3:45 am

WORKS GREAT! THANK YOU! ;D

Newbie

Posts

Joined
Fri May 27, 2011 7:03 am

Post by mattbrooker » Wed Jul 06, 2011 6:36 pm

wintech works great now thanks

Newbie

Posts

Joined
Tue May 31, 2011 5:41 pm

Post by Maansy » Wed Jul 06, 2011 10:44 pm

Waiting for v1.5

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by FT Industriels » Sat Jul 16, 2011 8:18 am

THANK YOU! WORKS GREAT!

OC 1.4.9
IX WEB Hosting
Matériel industriel Maroc



Posts

Joined
Sat Jul 09, 2011 2:35 am
Location - Morocco

Post by eleven28 » Thu Mar 22, 2012 9:38 am

Thanks wintech! Works for me in 1.5.1.3.

User avatar
Newbie

Posts

Joined
Fri Jan 27, 2012 6:41 am
Location - Australia

Post by budalal » Mon Jan 28, 2013 6:37 pm

Hi

Works nicely thanks. Will this show up only if there is a download?

Thanks

New member

Posts

Joined
Sun Oct 24, 2010 2:05 pm
Who is online

Users browsing this forum: No registered users and 14 guests