Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How to edit emails sent from cs-cart to the customer? Rate Topic   - - - - -

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 06 May 2010 - 05:28 PM #1

The title pretty much says it all. I am trying to figure out what files to edit in order to change what the customer receives upon checking the complete box in the admin tab.

 
  • jobosales
  • Senior Member
  • Members
  • Join Date: 04-Nov 06
  • 3114 posts

Posted 06 May 2010 - 06:47 PM #2

You can change the email subject and header for the 'Completed' in Orders->Order statuses. If you want to make changes to the layout, you will need to modify /skins/YOURSKIN/mail/orders/invoice.tpl

Bob
CS-Cart 2.0.14 (testing)

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 08:40 PM #3

I don't see the editable text in the file. All I see is css tags.

I need to be able to add a message to the email that is sent to customers. Essentially, I need to add a <p> tag somewhere.

 
  • jobosales
  • Senior Member
  • Members
  • Join Date: 04-Nov 06
  • 3114 posts

Posted 07 May 2010 - 08:59 PM #4

Depending on where you want the message to appear, you can do either of the following:

To change the header message (EASY)
=================================
In the admin area, go to Orders->Order statuses. Click the 'edit' link for the order status you want to change the message. You can enter your new email header (and subject, if you wish) and then click the "Save" button.

To add a message in the body of the invoice (More involved)
=================================================
Open /skins/YOURSKIN/mail/orders/invoice.tpl in a text editor. Work out where you want to add your new message and add the <p> tag there.

There are some hooks available in the TPL; if you can use those, you won't need to reapply the change after each upgrade that changes the invoice.tpl. In particular, if you want to add your message at the bottom of the invoice, there is the following hook:
{hook name="orders:invoice"}

Bob
CS-Cart 2.0.14 (testing)

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 09:12 PM #5

Thank you for the response, I will give it a try.

Somehow, something went terribly wrong and now I am unable to generate invoices for customers. Would it have to do with this file? I cannot move orders from processed to completed and I also cannot print the invoices in pdf or html.

Please help!

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 09:14 PM #6

Thank you for the response, I will give it a try.

Somehow, something went terribly wrong and now I am unable to generate invoices for customers. Would it have to do with this file? I cannot move orders from processed to completed and I also cannot print the invoices in pdf or html.

Please help!

{* $Id: invoice.tpl 8713 2010-01-28 08:59:03Z lexa $ *}

{if $order_info}
{literal}
<style media="print">
.main-table {
background-color: #ffffff !important;
}
</style>
<style type="text/css" media="screen,print">
body,p,div {
color: #000000;
font: 10px Arial;
}
body {
padding: 0;
margin: 0;
}
a, a:link, a:visited, a:hover, a:active {
color: #000000;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
.main-table {
background-color: #f4f6f8;
}
</style>
{/literal}

<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main-table" style="height: 100%;">
<tr>
<td align="center" style="width: 100%; height: 100%; padding: 24px 0;">
<div style="background-color: #ffffff; border: 1px solid #e6e6e6; margin: 0px auto; padding: 0px 44px 0px 46px; width: 510px; text-align: left;">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 27px 0px 8px 0px;">
<tr>
<td align="left" style="border-bottom: 1px solid #868686; padding-bottom: 3px;" valign="middle"><img src="{$images_dir}/{$manifest.Mail_logo.filename}" width="{$manifest.Mail_logo.width}" height="{$manifest.Mail_logo.height}" border="0" alt="{$settings.Company.company_name}" /></td>
<td width="100%" valign="bottom" style="border-bottom: 1px solid #868686; text-align: right; font: bold 26px Arial; text-transform: uppercase; margin: 0px;">{$lang.invoice_title}</td>
</tr>
</table>

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="top">
<td style="width: 50%; padding: 14px 0px 0px 2px;">
<h2 style="font: bold 12px Arial; margin: 0px 0px 3px 0px;">{$settings.Company.company_name}</h2>
{$settings.Company.company_address}<br />
{$settings.Company.company_city} {$settings.Company.company_state_descr} {$settings.Company.company_zipcode}<br />
{$settings.Company.company_country_descr}
<table cellpadding="0" cellspacing="0" border="0">
{if $settings.Company.company_phone}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.phone1_label}:</td>
<td width="100%">{$settings.Company.company_phone}</td>
</tr>
{/if}
{if $settings.Company.company_phone_2}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.phone2_label}:</td>
<td width="100%">{$settings.Company.company_phone_2}</td>
</tr>
{/if}
{if $settings.Company.company_fax}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.fax}:</td>
<td width="100%">{$settings.Company.company_fax}</td>
</tr>
{/if}
{if $settings.Company.company_website}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.web_site}:</td>
<td width="100%">{$settings.Company.company_website}</td>
</tr>
{/if}
{if $settings.Company.company_orders_department}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.email}:</td>
<td width="100%"><a href="mailto:{$settings.Company.company_orders_department}">{$settings.Company.company_orders_department}</a></td>
</tr>
{/if}
</table>
</td>

<td style="padding-top: 14px;">
<h2 style="font: bold 17px Tahoma; margin: 0px;">{$lang.order} #{$order_info.order_id}</h2>
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.status}:</td>
<td width="100%">{include file="common_templates/status.tpl" status=$order_info.status display="view"}</td>
</tr>
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.date}:</td>
<td>{$order_info.timestamp|date_format:"`$settings.Appearance.date_format`, `$settings.Appearance.time_format`"}</td>
</tr>
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.payment_method}:</td>
<td>{$order_info.payment_method.payment}</td>
</tr>
{if $order_info.shipping}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.shipping_method}:</td>
<td>
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{$shipping.shipping}
{if !$smarty.foreach.f_shipp.last}, {/if}
{if $shipping.tracking_number}{assign var="tracking_number_exists" value="Y"}{/if}
{/foreach}</td>
</tr>
{if $tracking_number_exists}
<tr valign="top">
<td style="font: 12px verdana, helvetica, arial, sans-serif; text-transform: uppercase; color: #000000; padding-right: 10px; white-space: nowrap;">{$lang.tracking_number}:</td>
<td>
{foreach from=$order_info.shipping item="shipping" name="f_shipp"}
{if $shipping.tracking_number}{$shipping.tracking_number}
{if !$smarty.foreach.f_shipp.last},{/if}
{/if}
{/foreach}</td>
</tr>
{/if}
{/if}
</table>
</td>
</tr>
</table>

{assign var="profile_fields" value='I'|fn_get_profile_fields}
{if $profile_fields}
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 32px 0px 24px 0px;">
<tr valign="top">
{if $profile_fields.C}
{assign var="profields_c" value=$profile_fields.C|fn_fields_from_multi_level:"field_name":"field_id"}
<td width="33%">
<h3 style="font: bold 17px Tahoma; padding: 0px 0px 3px 1px; margin: 0px;">{$lang.customer}:</h3>
<p style="margin: 2px 0px 3px 0px;">{if $profields_c.firstname}{$order_info.firstname} {/if}{if $profields_c.lastname}{$order_info.lastname}{/if}</p>
{if $profields_c.email}<p style="margin: 2px 0px 3px 0px;"><a href="mailto:{$order_info.email}">{$order_info.email}</a></p>{/if}
{if $profields_c.phone}<p style="margin: 2px 0px 3px 0px;"><span style="text-transform: uppercase;">{$lang.phone}:</span> {$order_info.phone}</p>{/if}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.C}
</td>
{/if}
{if $profile_fields.B}
{assign var="profields_b" value=$profile_fields.B|fn_fields_from_multi_level:"field_name":"field_id"}
<td width="34%" style="{if $profile_fields.S}padding-right: 10px;{/if} {if $profile_fields.C}padding-left: 10px;{/if}">
<h3 style="font: bold 17px Tahoma; padding: 0px 0px 3px 1px; margin: 0px;">{$lang.bill_to}:</h3>
{if $order_info.b_firstname && $profields_b.b_firstname || $order_info.b_lastname && $profields_b.b_lastname}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_b.b_firstname}{$order_info.b_firstname} {/if}{if $profields_b.b_lastname}{$order_info.b_lastname}{/if}
</p>
{/if}
{if $order_info.b_address && $profields_b.b_address || $order_info.b_address_2 && $profields_b.b_address_2}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_b.b_address}{$order_info.b_address} {/if}{if $profields_b.b_address_2}{$order_info.b_address_2}{/if}
</p>
{/if}
{if $order_info.b_city && $profields_b.b_city || $order_info.b_state_descr && $profields_b.b_state || $order_info.b_zipcode && $profields_b.b_zipcode}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_b.b_city}{$order_info.b_city} {/if}{if $profields_b.b_state}{$order_info.b_state_descr} {/if}{if $profields_b.b_zipcode}{$order_info.b_zipcode}{/if}
</p>
{/if}
{if $order_info.b_country_descr && $profields_b.b_country}
<p style="margin: 2px 0px 3px 0px;">
{$order_info.b_country_descr}
</p>
{/if}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.B}
</td>
{/if}
{if $profile_fields.S}
{assign var="profields_s" value=$profile_fields.S|fn_fields_from_multi_level:"field_name":"field_id"}
<td width="33%">
<h3 style="font: bold 17px Tahoma; padding: 0px 0px 3px 1px; margin: 0px;">{$lang.ship_to}:</h3>
{if $order_info.s_firstname && $profields_s.s_firstname || $order_info.s_lastname && $profields_s.s_lastname}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_s.s_firstname}{$order_info.s_firstname} {/if}{if $profields_s.s_lastname}{$order_info.s_lastname}{/if}
</p>
{/if}
{if $order_info.s_address && $profields_s.s_address || $order_info.s_address_2 && $profields_s.s_address_2}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_s.s_address}{$order_info.s_address} {/if}{if $profields_s.s_address_2}{$order_info.s_address_2}{/if}
</p>
{/if}
{if $order_info.s_city && $profields_s.s_city || $order_info.s_state_descr && $profields_s.s_state || $order_info.s_zipcode && $profields_s.s_zipcode}
<p style="margin: 2px 0px 3px 0px;">
{if $profields_s.s_city}{$order_info.s_city} {/if}{if $profields_s.s_state}{$order_info.s_state_descr} {/if}{if $profields_s.s_zipcode}{$order_info.s_zipcode}{/if}
</p>
{/if}
{if $order_info.s_country_descr && $profields_s.s_country}
<p style="margin: 2px 0px 3px 0px;">
{$order_info.s_country_descr}
</p>
{/if}
{include file="profiles/profiles_extra_fields.tpl" fields=$profile_fields.S}
</td>
{/if}
</tr>
</table>
{/if}
{* Customer info *}


{* Ordered products *}

<table width="100%" cellpadding="0" cellspacing="1" style="background-color: #dddddd;">
<tr>
<th width="70%" style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.product}</th>
<th style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.quantity}</th>
<th style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.unit_price}</th>
{if $order_info.use_discount}
<th style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.discount}</th>
{/if}
{if $order_info.taxes}
<th style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.tax}</th>
{/if}
<th style="background-color: #eeeeee; padding: 6px 10px; white-space: nowrap;">{$lang.subtotal}</th>
</tr>
{foreach from=$order_info.items item="oi"}
{hook name="orders:items_list_row"}
{if !$oi.extra.parent}
<tr>
<td style="padding: 5px 10px; background-color: #ffffff;">
{$oi.product|unescape|default:$lang.deleted_product}
{hook name="orders:product_info"}
{if $oi.product_code}<p style="margin: 2px 0px 3px 0px;">{$lang.code}: {$oi.product_code}</p>{/if}
{/hook}
{if $oi.product_options}<br/>{include file="common_templates/options_info.tpl" product_options=$oi.product_options}{/if}
</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: center;">{$oi.amount}</td>
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;">{if $oi.extra.exclude_from_calculate}{$lang.free}{else}{include file="common_templates/price.tpl" value=$oi.original_price}{/if}</td>
{if $order_info.use_discount}
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;">{if $oi.extra.discount|floatval}{include file="common_templates/price.tpl" value=$oi.extra.discount}{else} - {/if}</td>
{/if}
{if $order_info.taxes}
<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;">{if $oi.tax_value}{include file="common_templates/price.tpl" value=$oi.tax_value}{else} - {/if}</td>
{/if}

<td style="padding: 5px 10px; background-color: #ffffff; text-align: right;"><b>{if $oi.extra.exclude_from_calculate}{$lang.free}{else}{include file="common_templates/price.tpl" value=$oi.display_subtotal}{/if}</b> </td>
</tr>
{/if}
{/hook}
{/foreach}
{hook name="orders:extra_list"}
{/hook}
</table>

{hook name="orders:ordered_products"}
{/hook}
{* /Ordered products *}

{* Order totals *}
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="right">
<table border="0" style="padding: 3px 0px 12px 0px;">
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.subtotal}:</b> </td>
<td style="text-align: right; white-space: nowrap;">{include file="common_templates/price.tpl" value=$order_info.display_subtotal}</td>
</tr>
{if $order_info.discount|floatval}
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.including_discount}:</b> </td>
<td style="text-align: right; white-space: nowrap;">
{include file="common_templates/price.tpl" value=$order_info.discount}</td>
</tr>
{/if}


{if $order_info.subtotal_discount|floatval}
<tr>
<td style="text-align: right; white-space: nowrap;">{$lang.order_discount}:</td>
<td style="text-align: right; white-space: nowrap;">
{include file="common_templates/price.tpl" value=$order_info.subtotal_discount}</td>
</tr>
{/if}

{if $order_info.coupons}
{foreach from=$order_info.coupons item="coupon" key="key"}
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.coupon}:</b> </td>
<td style="text-align: right; white-space: nowrap;">{$key}</td>
</tr>
{/foreach}
{/if}
{if $order_info.taxes}
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.taxes}:</b> </td>
<td style="text-align: right; white-space: nowrap;"> </td>
</tr>
{foreach from=$order_info.taxes item=tax_data}
<tr>
<td style="text-align: right; white-space: nowrap;">{$tax_data.description} {include file="common_templates/modifier.tpl" mod_value=$tax_data.rate_value mod_type=$tax_data.rate_type}{if $tax_data.price_includes_tax == "Y" && $settings.Appearance.cart_prices_w_taxes != "Y"} {$lang.included}{/if}{if $tax_data.regnumber} ({$tax_data.regnumber}){/if}: </td>
<td style="text-align: right; white-space: nowrap;">{include file="common_templates/price.tpl" value=$tax_data.tax_subtotal}</td>
</tr>
{/foreach}
{/if}
{if $order_info.tax_exempt == 'Y'}
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.tax_exempt}</b></td>
<td style="text-align: right; white-space: nowrap;"> </td>
<tr>
{/if}

{if $order_info.payment_surcharge|floatval}
<tr>
<td style="text-align: right; white-space: nowrap;">{$lang.payment_surcharge}: </td>
<td style="text-align: right; white-space: nowrap;"><b>{include file="common_templates/price.tpl" value=$order_info.payment_surcharge}</b></td>
</tr>
{/if}


{if $order_info.shipping}
<tr>
<td style="text-align: right; white-space: nowrap;"><b>{$lang.shipping_cost}:</b> </td>
<td style="text-align: right; white-space: nowrap;">{include file="common_templates/price.tpl" value=$order_info.display_shipping_cost}</td>
</tr>
{/if}
{hook name="orders:totals"}
{/hook}

<tr>
<td colspan="2"><hr style="border: 0px solid #d5d5d5; border-top-width: 1px;" /></td>
</tr>
<tr>
<td style="text-align: right; white-space: nowrap; font: 15px Tahoma; text-align: right;">{$lang.total_cost}: </td>
<td style="text-align: right; white-space: nowrap; font: 15px Tahoma; text-align: right;"><strong style="font: bold 17px Tahoma;">{include file="common_templates/price.tpl" value=$order_info.total}</strong></td>
</tr>
</table>
</td>
</tr>
</table>

{* /Order totals *}

{if $order_info.notes}
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr valign="top">
<td><strong>{$lang.notes}:</strong></td>
<td width="100%"><div style="padding-left: 7px; padding-bottom: 15px; overflow-x: auto; clear: both; width: 505px; height: 100%; padding-bottom: 20px; overflow-y: hidden;">{$order_info.notes|wordwrap:85:"\n":false|nl2br}</div></td>
</tr>
</table>
{/if}

{if $content == "invoice"}
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td>
{include file="buttons/continue_shopping.tpl" but_href=$continue_url|default:$index_script but_arrow="on" skin_area="customer"}</td>
<td align="right">
{include file="buttons/button_popup.tpl" but_text=$lang.print_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`" width="800" height="600" skin_area="customer"}</td>
</tr>
</table>
{/if}
{/if}

{hook name="orders:invoice"}
{/hook}
</div>
</td>
</tr>
</table>
on" skin_area="customer"}</td>
<td align="right">
{include file="buttons/button_popup.tpl" but_text=$lang.print_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`" width="800" height="600" skin_area="customer"}</td>
</tr>
</table>
{/if}
{/if}

{hook name="orders:invoice"}
{/hook}
</div>
</td>
</tr>
</table>



 
  • jobosales
  • Senior Member
  • Members
  • Join Date: 04-Nov 06
  • 3114 posts

Posted 07 May 2010 - 09:32 PM #7

Somehow, something went terribly wrong and now I am unable to generate invoices for customers. Would it have to do with this file? I cannot move orders from processed to completed and I also cannot print the invoices in pdf or html.

If this was the only change you made then this is likely the reason it is not working - you probably placed the edit in the wrong place. Just restore from your backup.

It sounds like you are editing your live site. You should be applying and testing your changes on a test setup.

Bob
CS-Cart 2.0.14 (testing)

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 10:59 PM #8

I don't even remember editing the file. It just happened all of a sudden. I know i was looking at the file on my computer, but I don't think I made any changes.

 
  • jobosales
  • Senior Member
  • Members
  • Join Date: 04-Nov 06
  • 3114 posts

Posted 07 May 2010 - 11:03 PM #9

Restore the file from the skins repository. If it fixes the problem, then something was changed.

Bob
CS-Cart 2.0.14 (testing)

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 11:20 PM #10

I am sorry, I am rather ignorant to cs-cart in general. Where is the skins repository located?

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 11:22 PM #11

I actually found it in the var folder, but there are no tpl files in there, just images.

 
  • zackstark
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 73 posts

Posted 07 May 2010 - 11:24 PM #12

I found it. For future reference it can be found at:

www.yourwebsite.com/web/content/var/skins_repository/base/mail/orders/invoice.tpl

 

Posted 05 June 2010 - 12:50 AM #13

Has anyone had success completely customizing their email invoices? I modified the following files and saw only minor changes, certainly not what I wanted.

/TEMPLATE_NAME/mail/letter_header.tpl
/TEMPLATE_NAME/mail/orders/order_notification.tpl
/TEMPLATE_NAME/mail/orders/invoice.tpl

Specifically I am trying to change the body font to something more pleasing, such as Century Gothic or another sans serif font - the default Times Roman is rather boring.

Just want to know if I am looking at the correct files, maybe that is why the emails do not appear to change.
Web development in progress with CS-Cart 3.x

 

Posted 05 June 2010 - 02:49 AM #14

You're changing the right files.. make sure you're adjusting the ones under the skin you are using .. and maybe try clearing your cache and compiled folders

http://www.RacingSolution.com
Performance & Styling Auto Parts
CS-Cart v4.5.2


 

Posted 06 June 2010 - 01:42 AM #15

Cache did it - so hate that and always forget. Thanks.
Web development in progress with CS-Cart 3.x

 
  • remoteone
  • Member
  • Members
  • Join Date: 06-Oct 09
  • 776 posts

Posted 15 November 2011 - 02:00 AM #16

One thing to keep in mind when creating/editing invoice templates is that many email clients dont handle html very well. And especially CSS!. Ive done extensive invoice.tpl and other mods and have completely removed CSS , replacing it with the tedious in-line formatting.

Q: How to reset the margins for the PDF version of the invoice? The pdf function uses the same invoice.tpl file but about a 1" border is around the whole thing. And now that Ive set made the invoice template wider, there is some of the invoice missing on the rhs of the pdf invoice.I want to set that border to zero for PDF invoices.

Answer:
Find this code under the "fn_html_to_pdf" function in the /core/fn.common.php
$media->set_margins(array('left' => 20, 'right' => 20, 'top' => 20, 'bottom' => 0));
	$media->set_pixels(600);
replace it with:
$media->set_margins(array('left' => 2, 'right' => 2, 'top' => 2, 'bottom' => 2));
	$media->set_pixels(820);
This works well for invoice widths of 600-800 px.
The issue with the original settings is that if your invoice.tpl file uses a width of >600px then the pdf file is expanded by the ratio = invoice width/set_pixels !
The rule of thumb here is to set the set_pixels value about 10% higher than the width setting of your invoice template and set the set_margins values to about 2.

Which begs the question? Why has cs-cart hard-coded the margins and page scale into a core.php function?
This needs to scale corectly for any invoice width setting IMHO.