Email invoices are not formatted

ThemeBurn SupportForumsOpenCart ThemesShoppica OpenCart ThemeEmail invoices are not formatted

This topic has been marked as resolved.

Hi,

I couldn’t find anything on this topic when I searched. Sorry if I didn’t find it.

My email invoices are not formatted. When I look at the html code there isn’t any id’s (ex. id=”list”) on the or tags in the email received. I noticed that there isn’t an order.tpl in the shoppica theme. I am assuming that it is using the mail template from the default theme. When I check that order.tpl file I see the css settings in the file and the various id’s for formatting are in the html tags. Can you tell me why my email invoices are not formatted, and how do I fix it?

Regards,
Al

February 1, 2012 at 6:30 am #5762

I just noticed that Invoices from the administration page are also using the default theme.

February 1, 2012 at 7:02 am #5763

I see that when the invoice link on the email is clicked the invoice that shows on the website is in the shoppica format.

February 1, 2012 at 7:56 am #5764

I see that admin/view/template/sale/order_invoice.tpl is the file for the invoice from the admin backend. Which file controls the email invoice?

February 1, 2012 at 8:26 am #5765

Damn Gmail! When I look at the same email in Outlook it is formatted as expected.

You can mark this as solved.

February 1, 2012 at 11:57 am #5769

Since Gmail strips all the css between style tags out of emails, css needs to be coded inline with the element.

Now to convert the order.tpl file to use inline css.

February 1, 2012 at 12:11 pm #5772

I have moved the css inline and it seems to be working in gmail now. Here is the code for order.tpl in case anyone else wants it ….

I also removed the “Powered by Opencart” from the bottom.

EDIT – see below for actual code – failed to use tags on this post

Cheers,
Al

  • This reply was modified 4476 days ago by  freakyal. Reason: forgot to use tags

February 1, 2012 at 1:01 pm #5779

oops .. let’s try that again


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $title; ?></title>
</head>
<body style="color: #000000;font-family: Arial, Helvetica, sans-serif;font-size: 12px;">
<div style="width: 680px;"><a style="font-size: 12px;color: #378DC1;text-decoration: underline;cursor: pointer;" href="<?php echo $store_url; ?>" title="<?php echo $store_name; ?>"><img style="border: none;" src="<?php echo $logo; ?>" alt="<?php echo $store_name; ?>" style="margin-bottom: 20px;" /></a>
  <p style="margin-top: 0px;margin-bottom: 20px;"><?php echo $text_greeting; ?></p>
  <?php if ($customer_id) { ?>
  <p style="margin-top: 0px;margin-bottom: 20px;"><?php echo $text_link; ?></p>
  <p style="margin-top: 0px;margin-bottom: 20px;"><a style="font-size: 12px;color: #378DC1;text-decoration: underline;cursor: pointer;" href="<?php echo $link; ?>"><?php echo $link; ?></a></p>
  <?php } ?>
  <?php if ($download) { ?>
  <p style="margin-top: 0px;margin-bottom: 20px;"><?php echo $text_download; ?></p>
  <p style="margin-top: 0px;margin-bottom: 20px;"><a style="font-size: 12px;color: #378DC1;text-decoration: underline;cursor: pointer;" href="<?php echo $download; ?>"><?php echo $download; ?></a></p>
  <?php } ?>
  <table style="border-collapse: collapse;width: 100%;border-top: 1px solid #DDDDDD;border-left: 1px solid #DDDDDD;margin-bottom: 20px;">
    <thead style="background-color: #EFEFEF;padding: 0px 5px;">
      <tr>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;" colspan="2"><?php echo $text_order_detail; ?></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><b><?php echo $text_order_id; ?></b> <?php echo $order_id; ?><br />
          <b><?php echo $text_date_added; ?></b> <?php echo $date_added; ?><br />
          <b><?php echo $text_payment_method; ?></b> <?php echo $payment_method; ?><br />
          <?php if ($shipping_method) { ?>
          <b><?php echo $text_shipping_method; ?></b> <?php echo $shipping_method; ?>
          <?php } ?></td>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><b><?php echo $text_email; ?></b> <?php echo $email; ?><br />
          <b><?php echo $text_telephone; ?></b> <?php echo $telephone; ?><br />
          <b><?php echo $text_ip; ?></b> <?php echo $ip; ?><br /></td>
      </tr>
    </tbody>
  </table>
  <?php if ($comment) { ?>
    <table style="border-collapse: collapse;width: 100%;border-top: 1px solid #DDDDDD;border-left: 1px solid #DDDDDD;margin-bottom: 20px;">
    <thead style="background-color: #EFEFEF;padding: 0px 5px;">
      <tr>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_instruction; ?></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $comment; ?></td>
      </tr>
    </tbody>
  </table>
  <?php } ?>
  <table style="border-collapse: collapse;width: 100%;border-top: 1px solid #DDDDDD;border-left: 1px solid #DDDDDD;margin-bottom: 20px;">
    <thead style="background-color: #EFEFEF;padding: 0px 5px;">
      <tr>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_payment_address; ?></td>
        <?php if ($shipping_address) { ?>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_shipping_address; ?></td>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $payment_address; ?></td>
        <?php if ($shipping_address) { ?>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $shipping_address; ?></td>
        <?php } ?>
      </tr>
    </tbody>
  </table>
  <table style="border-collapse: collapse;width: 100%;border-top: 1px solid #DDDDDD;border-left: 1px solid #DDDDDD;margin-bottom: 20px;">
    <thead style="background-color: #EFEFEF;padding: 0px 5px;">
      <tr>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_product; ?></td>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_model; ?></td>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_quantity; ?></td>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_price; ?></td>
        <td style="text-decoration: none;color: #222222;font-weight: bold;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $text_total; ?></td>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($products as $product) { ?>
      <tr>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $product['name']; ?>
          <?php foreach ($product['option'] as $option) { ?>
          <br />
          &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
          <?php } ?></td>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: left;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $product['model']; ?></td>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $product['quantity']; ?></td>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $product['price']; ?></td>
        <td style="vertical-align: top;padding: 0px 5px;font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $product['total']; ?></td>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php foreach ($totals as $total) { ?>
      <tr>
        <td colspan="4" style="font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><b><?php echo $total['title']; ?>:</b></td>
        <td style="font-size: 12px;text-align: right;padding: 7px;border-right: 1px solid #DDDDDD;border-bottom: 1px solid #DDDDDD;"><?php echo $total['text']; ?></td>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
  <p style="margin-top: 0px;margin-bottom: 20px;"><?php echo $text_footer; ?></p>
</div>
</body>
</html>

February 1, 2012 at 1:02 pm #5781

Thanks for your efforst, Al!

This will be useful to everybody. :)

Best regards,
Svetoslav

ThemeBurn team

February 2, 2012 at 9:41 pm #5843

@freak yal : for which version of opencart is this tpl file modified and tested to run fine??

February 24, 2012 at 2:36 pm #6495

@freak yal: maybe thats what i need

February 24, 2012 at 2:36 pm #6496

atriskhan,

I am using Opencart 1.5.1.3.

Cheers,
Al

February 26, 2012 at 12:02 pm #6533

Thanks for this freakyal.

I presume that voucher.tpl will also have the same problems looking at the template.
Although my css skills are not up to converting it

 GWP
February 27, 2012 at 11:39 am #6552

@GWP i hav not tested voucher.tpl , although @freayal i have converted following to shopppica theme
Testimonials,fido new/blog,FAQ,tell a friend/Currently viewed by others,You viewed,most viewed.

If any1 needs help i can give those files.

please do inform me 1nce any1 fixes voucher.tpl

February 27, 2012 at 1:29 pm #6557

GWP … Thanks for pointing that out, I need to do the same for voucher.tpl. I will look at it tomorrow.

atirkhan … If you got the testimonials extension working with the shoppica theme I would love to get those files. I haven’t gotten around to modding them. Low on my priority list. Drop me a line … freakyal[at]gmail.com.

Regards,
Al

February 27, 2012 at 9:29 pm #6571
Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.