Dear moneysaver,
I tried this mod w/ 4.0.18 and I am not able to get it working...
I experienced an error right after the "submit..."
Code:
Your order is being placed. Please wait...
:
Parse error: parse error, unexpected T_STRING in /htdocs/mommymakeup.com/xcart/templates_c/%%E6^E62^E6283DF6%%order_invoice.tpl.php on line 67
FYI, line 67 of my order_invoice.tpl is the above mentioned,
Code:
if( empty( $orderid ) ) $orderid = $GLOBALS[secure_oid][0];
Hmm... any idea why this isn't working for me?
Here's my COMPLETE order_invoice.tpl:
Code:
{* $Id: order_invoice.tpl,v 1.14.2.16 2005/11/17 08:41:18 max Exp $ *}
{if $customer ne ''}{assign var="_userinfo" value=$customer}{else}{assign var="_userinfo" value=$userinfo}{/if}
{config_load file="$skin_config"}
{if $is_nomail ne 'Y'}
{literal}
<STYLE type="text/css">
BODY {
MARGIN-TOP: 10px;
FONT-SIZE: 12px;
MARGIN-LEFT: 10px;
FONT-FAMILY: arial,helvetica,sans-serif
}
TD {
FONT-SIZE: 12px;
FONT-FAMILY: arial,helvetica,sans-serif
}
TH {
FONT-SIZE: 13px;
FONT-FAMILY: arial,helvetica,sans-serif
}
H1 {
FONT-SIZE: 20px
}
</STYLE>
{/literal}
{/if}
<TABLE cellSpacing="0" cellPadding="0" width="{if $is_nomail eq 'Y'}100%{else}600{/if}" border="0" bgColor="#ffffff" color="#000000">
<TR>
<TD>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD valign="top">
[img]{$ImagesDir}/companyname_small.gif[/img]</TD>
<TD width="100%">
<TABLE cellSpacing="0" cellPadding="2" width="100%" border="0">
<TR>
<TD width="30"></TD>
<TD vAlign="top">
<FONT style="FONT-SIZE: 28px"><B style="text-transform: uppercase;">{$lng.lbl_invoice}[/b]</FONT>
{$lng.lbl_date}: {$order.date|date_format:$config.Appearance.datetime_format}
{$lng.lbl_order_id}: #{$order.orderid}
{$lng.lbl_order_status}: {include file="main/order_status.tpl" status=$order.status mode="static"}
{$lng.lbl_payment_method}:
{* BEGIN remove credit card ex-last 4 mod *}
{* {$order.payment_method} *}
{assign var="paren" value=$order.payment_method|strpos:' ('}
{assign var="paymentMethod" value=$order.payment_method|substr:0:$paren}
{$paymentMethod}
{if $paymentMethod eq 'Credit Card'}
б═ б═{php}
б═ б═б═ б═б═ б═
б═ б═#
б═ б═# Custom function by moneysaver67
б═ б═# Retrieve Order details (decrypted) from table by Order ID
б═ б═#
б═ б═б═ б═
б═ б═if( !function_exists( 'func_order_details' ) )
б═ б═{
б═ б═б═ б═
б═ б═б═ б═function func_order_details( $orderid )
б═ б═б═ б═{
б═ б═б═ б═б═ б═ global $sql_tbl;
б═ б═б═ б═б═ б═ // Grab the encrypted details
б═ б═б═ б═б═ б═ б═ б═
б═ б═б═ б═б═ б═ if( empty( $orderid ) ) $orderid = $GLOBALS[secure_oid][0];б═ б═б═ б═б═ б═ б═ б═
б═ б═б═ б═б═ б═ б═ б═
б═ б═б═ б═б═ б═ $sql_orders = func_query_first("SELECT details FROM $sql_tbl[orders] WHERE orderid = $orderid");
б═ б═б═ б═б═ б═
б═ б═б═ б═б═ б═ // Return decrypted details
б═ б═б═ б═б═ б═ return text_decrypt( $sql_orders['details'] );
б═ б═б═ б═}
б═ б═
б═ б═}
б═ б═
б═ б═
б═ б═#
б═ б═# Custom function by moneysaver67
б═ б═# Parse out the info after a given label
б═ б═#
б═ б═if( !function_exists( 'parseAfterLabel' ) )
б═ б═{
б═ б═б═ б═function parseAfterLabel( $label, $details )
б═ б═б═ б═{
б═ б═б═ б═б═ б═// Force to one line
б═ б═б═ б═б═ б═$details = preg_replace( '/\n/',' ', $details );
б═ б═б═ б═б═ б═if( !stristr( $details, $label ) )
б═ б═б═ б═б═ б═{б═ б═
б═ б═б═ б═б═ б═б═ б═$return = 'N/A';
б═ б═б═ б═б═ б═}
б═ б═б═ б═б═ б═else
б═ б═б═ б═б═ б═{б═ б═б═ б═б═ б═
б═ б═б═ б═б═ б═б═ б═$pattern = '/^.*'.$label.'\s{0,}(.*)\s{0,}.*$/i';
б═ б═б═ б═б═ б═б═ б═$chunk = preg_replace( $pattern, '${1}', $details );
б═ б═б═ б═б═ б═б═ б═// return everything prior to first space (auth code)
б═ б═б═ б═б═ б═б═ б═$return = substr( $chunk, 0, strpos( $chunk, ' ' ) );б═ б═б═ б═
б═ б═б═ б═б═ б═}
б═ б═б═ б═б═ б═return $return;
б═ б═б═ б═}б═ б═б═ б═б═ б═
б═ б═}б═ б═
б═ б═
б═ б═
б═ б═// Do you store CC info in the details column?
б═ б═if( $GLOBALS[store_cc] )
б═ б═{
б═ б═б═ б═$dec_details = func_order_details( $GLOBALS[orderid] );
б═ б═б═ б═$cc_num = parseAfterLabel( 'Card number:', $dec_details );б═ б═б═ б═
б═ б═б═ б═$cc_mask = str_repeat( 'x', strlen( $cc_num ) );
б═ б═б═ б═$cc_mask = substr( $cc_mask, 0, strlen( $cc_mask ) -4 ) . substr( $cc_num, -4, 4 );
б═ б═б═ б═
б═ б═б═ б═echo ': ' . parseAfterLabel( 'Card type:', $dec_details ) . '
' . $cc_mask;
б═ б═}
б═ б═{/php}
{/if}
{* END remove credit card ex-last 4 mod *}
{$lng.lbl_delivery}:{$order.shipping|trademark|default:$lng.txt_not_available}
</TD>
<TD vAlign="bottom" align="right">
{$config.Company.company_name}
{$config.Company.location_address}
{$config.Company.location_city},{$config.Company.location_state}{$config.Company.location_zipcode}
{$config.Company.location_country_name}
{if $config.Company.company_phone}{$lng.lbl_phone_1_title}: {$config.Company.company_phone}
{/if}
{if $config.Company.company_phone_2}{$lng.lbl_phone_2_title}: {$config.Company.company_phone_2}
{/if}
{if $config.Company.company_fax}{$lng.lbl_fax}: {$config.Company.company_fax}
{/if}
{if $config.Company.orders_department}{* {$lng.lbl_email}: *}{$config.Company.orders_department}
{/if}
{if $order.applied_taxes}
{foreach from=$order.applied_taxes key=tax_name item=tax}
{$tax.regnumber}
{/foreach}
{/if}
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD bgcolor="#000000">[img]{$ImagesDir}/spacer_black.gif[/img]</TD>
</TR>
<TR>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
</TABLE>
{* BEGIN FORMATTING MOD *}
<TABLE cellSpacing="0" cellPadding="0" width="45%" border="0">
{if $_userinfo.default_fields.company}
<TR>
<TD>{$lng.lbl_company}:</TD>
<TD>{$order.company}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.firstname}
<TR>
<TD noWrap>Name:</TD>
<TD>{$order.firstname} {$order.lastname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.lastname}
{/if}
{if $_userinfo.default_fields.phone}
<TR>
<TD>{$lng.lbl_phone}:</TD>
<TD>{$order.phone}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.fax}
<TR>
<TD>{$lng.lbl_fax}:</TD>
<TD>{$order.fax}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.email}
<TR>
<TD>{$lng.lbl_email}:</TD>
<TD>{$order.email}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.url}
<TR>
<TD>{$lng.lbl_url}:</TD>
<TD>{$order.url}</TD>
</TR>
{/if}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'C' || $v.section eq 'P'}
<TR>
<TD>{$v.title}:</TD>
<TD>{$v.value}</TD>
</TR>
{/if}
{/foreach}
</TABLE>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD width="45%" height="25">{$lng.lbl_billing_address}</TD>
<TD width="10%"></TD>
<TD width="45%" height="25">{$lng.lbl_shipping_address}</TD>
</TR>
<TR>
<TD bgColor="#000000" height="2">[img]{$ImagesDir}/spacer_black.gif[/img]</TD>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
<TD bgColor="#000000" height="2">[img]{$ImagesDir}/spacer_black.gif[/img]</TD>
</TR>
<TR>
<TD colSpan="3">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
{if $_userinfo.default_fields.firstname}
<TR>
<TD>{$order.b_firstname} {$order.b_lastname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.lastname}
{/if}
{if $_userinfo.default_fields.b_address}
<TR>
<TD>{$order.b_address}
{$order.b_address_2}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.b_city}
<TR>
<TD>{$order.b_city},{$order.b_state}{$order.b_zipcode}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.b_county && $config.General.use_counties eq 'Y'}
<TR>
<TD>{$order.b_countyname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.b_state}
{/if}
{if $_userinfo.default_fields.b_country}
<TR>
<TD>{$order.b_countryname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.b_zipcode}
{/if}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'B'}
<TR>
<TD>{$v.value}</TD>
</TR>
{/if}
{/foreach}
</TABLE>
</TD>
<TD></TD>
<TD>
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
{if $_userinfo.default_fields.firstname}
<TR>
<TD>{$order.s_firstname} {$order.s_lastname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.lastname}
{/if}
{if $_userinfo.default_fields.s_address}
<TR>
<TD>{$order.s_address}
{$order.s_address_2}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.s_city}
<TR><TD>{$order.s_city},{$order.s_state}{$order.s_zipcode}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.s_county && $config.General.use_counties eq 'Y'}
<TR>
<TD>{$order.s_countyname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.s_state}
{/if}
{if $_userinfo.default_fields.s_country}
<TR>
<TD>{$order.s_countryname}</TD>
</TR>
{/if}
{if $_userinfo.default_fields.s_zipcode}
{/if}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'S'}
<TR>
<TD>{$v.value}</TD>
</TR>
{/if}
{/foreach}
</TABLE>
{* END FORMATTING MOD *}
</TD>
</TR>
{assign var="is_header" value=""}
{foreach from=$_userinfo.additional_fields item=v}
{if $v.section eq 'A'}
{if $is_header eq ''}
<TR>
<TD colspan="3"></TD>
</TR>
<TR>
<TD width="45%" height="25">{$lng.lbl_additional_information}</TD>
<TD colspan="2" width="55%"></TD>
</TR>
<TR>
<TD bgColor="#000000" height="2">[img]{$ImagesDir}/spacer_black.gif[/img]</TD>
<TD colspan="2" width="55%">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD colSpan="3">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD><TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
{assign var="is_header" value="E"}
{/if}
<TR valign="top">
<TD>{$v.title}</TD>
<TD>{$v.value}</TD>
</TR>
{/if}
{/foreach}
{if $is_header eq 'E'}
</TABLE></TD>
<TD colspan="2" width="55%"></TD>
</TR>
{/if}
{if $config.Email.show_cc_info eq "Y" and $show_order_details eq "Y"}
<TR>
<TD colspan="3"></TD>
</TR>
<TR>
<TD width="45%" height="25">{$lng.lbl_order_payment_details}</TD>
<TD colspan="2" width="55%"></TD>
</TR>
<TR>
<TD bgColor="#000000" height="2">[img]{$ImagesDir}/spacer_black.gif[/img]</TD>
<TD colspan="2">[img]{$ImagesDir}/spacer.gif[/img]</TD>
<TR>
<TD colSpan="3">[img]{$ImagesDir}/spacer.gif[/img]</TD>
</TR>
<TR>
<TD colspan="3">{$order.details|replace:"\n":"
"}</TD>
</TR>
{/if}
{if $order.netbanx_reference}
<TR>
<TD colspan="3">NetBanx Reference: {$order.netbanx_reference}</TD>
</TR>
{/if}
</TABLE>
{include file="mail/html/order_data.tpl"}
</TD>
</TR>
{if $active_modules.Anti_Fraud eq '' && $show_order_details eq "Y" && ($usertype eq 'A' || ($usertype eq 'P' && $active_modules.Simple_Mode))}
<TR>
<TD align="center">
{$lng.txt_warning_antifraud_disabled}
</TD>
</TR>
{/if}
<TR>
<TD align="center">
<FONT style="FONT-SIZE:12px">{$lng.txt_thank_you_for_purchase}</FONT></TD>
</TR>
</TABLE>