You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I'm trying to do this using the following from the shopping cart include, but no images are coming through. What am I doing wrong? I've made some changes to the confirmation email already
<?php
// +--
// | This include is used to print order summary information for
// | XHTML order confirmaiton email messages.
// +--
$eol = $this->globals('core.eol');
$ns = $this->globals('core.namespace');
$order = $this->globals('ecom.order_summary');
$dtformat = $this->globals('core_settings.core.datetime_format');
$shownums = $this->globals('core_settings.ecom.dispprodnums');
$currapp = $this->globals('core_settings.core.basecurrency');
$currshow = $this->globals('core_session.show_currency');
$mailtype = $this->globals('ecom.mail_msgtype');
$optlb = $this->globals('core_settings.ecom.dispprodoptlinebr');
$taxcountrysys = $this->globals('core_settings.core.taxcountrysys');
$cart = $this->globals('ecom.cart_contents');
$imgwidth = $this->globals('core_settings.ecom.imgsizeprodcart');
$imgpath = $this->globals('core.path_public') . '/media/ecom/prodlg/';
$shownums = '1';
if ($taxcountrysys == 'EUVAT') {
$text_taxcountry = $this->globals('core_settings.core.taxcountryeuname') . ' Total';
$text_taxcountryref = 'LESS: ' . $this->globals('core_settings.core.taxcountryeuname') . ' Refund Total';
$text_excvat = ' ' . $this->globals('core_settings.core.taxcountryeutextexcl');
} else {
$text_taxcountry = $this->globals('core_settings.core.taxcountrystdname') . ' Total';
$text_taxcountryref = 'LESS: ' . $this->globals('core_settings.core.taxcountrystdname') . ' Refund Total';
$text_excvat = '';
} // End of if statement.
// +--
// | Always show prices in the component currency for BackEnd
// | requests.
// +--
if ($this->globals('core.interface') == 'BackEnd') {
$currshow = $this->globals('core_settings.core.basecurrency');
} // End of if statement.
// +--
// | Always show prices in the component currency for internal and
// | shipper requests.
// +--
if (($mailtype == 'INTERNAL') || ($mailtype == 'SHIPPER')) {
$currshow = $this->globals('core_settings.core.basecurrency');
} // End of if statement.
// +--
// | Determine whether the order is complete or not.
// +--
$ordercompl = 0;
if (($order['order']['status'] != 'P') && ($order['order']['status'] != 'X')) {
$ordercompl = 1;
} // End of if statement.
// +--
// | Print the order summary if we have both an order and items.
// +--
if ((!(empty($order['order']))) && (!(empty($order['items'])))) {
// +--
// | If the mail type is not 'SHIPPER', we print order totals.
// +--
if ($mailtype != 'SHIPPER') {
// +--
// | Figure out our order totals.
// +--
$totals = array();
if ((!(empty($order['order']['subtotal']))) && ($order['order']['subtotal'] > 0)) {
$totals['Item Subtotal' . $text_excvat] = $order['order']['subtotal'];
}
if ((!(empty($order['order']['shiptotal']))) && ($order['order']['shiptotal'] > 0)) {
$totals['Delivery Total'] = $order['order']['shiptotal'];
}
if ((!(empty($order['order']['custsurchargetotal']))) && ($order['order']['custsurchargetotal'] > 0)) {
$text = 'Surcharge Total';
if (!(empty($order['order']['custsurchargedesc']))) {$text = $order['order']['custsurchargedesc'];}
$totals[$text] = $order['order']['custsurchargetotal'];
}
if ((!(empty($order['order']['taxsptotal']))) && ($order['order']['taxsptotal'] > 0)) {
$totals['State/Province Tax Total'] = $order['order']['taxsptotal'];
}
if ((!(empty($order['order']['taxctotal']))) && ($order['order']['taxctotal'] > 0)) {
$totals[$text_taxcountry] = $order['order']['taxctotal'];
}
if ((!(empty($order['order']['taxcreftotal']))) && ($order['order']['taxcreftotal'] > 0)) {
$totals[$text_taxcountryref] = $order['order']['taxcreftotal'];
}
if ((!(empty($order['order']['disctotal']))) && ($order['order']['disctotal'] > 0)) {
$totals['LESS: Discount Total'] = $order['order']['disctotal'];
}
if ((!(empty($order['order']['custsaletotal']))) && ($order['order']['custsaletotal'] > 0)) {
$text = 'Sale';
if (!(empty($order['order']['custsaledesc']))) {$text = $order['order']['custsaledesc'];}
$totals['LESS: ' . $text] = $order['order']['custsaletotal'];
}
if ((!(empty($order['order']['recurtotal']))) && ($order['order']['recurtotal'] > 0)) {
$totals['Recurring Charge Total'] = $order['order']['recurtotal'];
}
if ((!(empty($order['order']['ordertotal']))) && ($order['order']['ordertotal'] > 0)) {
$totals['Total'] = $order['order']['ordertotal'];
} else {
$totals['Total'] = 0;
}
// +--
// | Print the order totals.
// +--
print '<tr><td><hr><span class="eml-heading">Order Totals</span><br/>' . $eol . $eol;
print '<table id="ORDERTOTALS" class="regtable">' . $eol . $eol;
foreach ($totals as $text => $amount) {
$amount_array = array('amount' => $amount,
'entrycurr' => $currapp,
'returncurr' => $currshow,
'formatwsym' => 1,
'formatweutax' => 0);
$xtext = $this->xhtml_encode($text);
$amount = $this->include_namespace('core','getprice',$amount_array);
$amount = $this->xhtml_encode($amount);
if (($text == 'Total') || ($text == 'Recurring Charge Total')) {
print '<tr class="regtable">' . $eol;
print '<td class="regtable" style="width: 90%"><strong>' . $xtext . '</strong></td>' . $eol;
print '<td class="regtable" style="width: 10%; text-align: right"><strong>' . $amount . '</strong></td>' . $eol;
print '</tr>' . $eol;
} else {
print '<tr class="regtable">' . $eol;
print '<td class="regtable" style="width: 90%">' . $xtext . '</td>' . $eol;
print '<td class="regtable" style="width: 10%; text-align: right">' . $amount . '</td>' . $eol;
print '</tr>' . $eol;
} // End of if statement.
} // End of foreach statement.
print '</table></tr>' . $eol . $eol;
// +--
// | If we're using the EU tax system we need to show a VAT breakdown
// | here - if we are permitted to.
// +--
$taxcountrysys = $this->globals('core_settings.core.taxcountrysys');
$taxeusummarydisp = $this->globals('core_settings.core.taxeusummarydisp');
if (($taxcountrysys == 'EUVAT') && (!(empty($taxeusummarydisp)))) {
print '<div class="regtablehead">European Union VAT Summary</div>' . $eol . $eol;
print '<table id="TAX SUMMARY" class="regtable">' . $eol . $eol;
print '<tr class="regtable">' . $eol;
print '<th class="regtable">Item</td>' . $eol;
print '<th class="regtable">Quantity</td>' . $eol;
print '<th class="regtable">Total' . $text_excvat . '</td>' . $eol;
print '<th class="regtable">VAT</td>' . $eol;
if ((!(empty($order['order']['taxcreftotal']))) && ($order['order']['taxcreftotal'] > 0)) {
print '<th class="regtable">Refund</td>' . $eol;
}
print '<th class="regtable">Actual Rate</td>' . $eol;
print '</tr>' . $eol;
$shiptotal = 0;
$shiptaxtotal = 0;
$shiptaxreftotal = 0;
$shippcttotal = 0;
$shippctcount = 0;
foreach ($order['items'] as $num => $item) {
if ($shownums) {$name = $item['itemnum'] . ' - ' . $item['itemname'];}
else {$name = $item['itemname'];}
$name = $this->xhtml_encode($name);
$quan = $this->xhtml_encode($item['itemquan']);
$subtotal = '0.00';
$tax = '0.00';
$refund = '0.00';
$rate = '0.00';
$amount_array = array('entrycurr' => $currapp, 'returncurr' => $currshow, 'formatwsym' => 1, 'formatweutax' => 0);
$ordertotal = $item['ordertotal'];
if (isset($item['cartdata']['totalbasis']['taxcountrydisplay'])) {
$shiptotal = $shiptotal + $item['cartdata']['totalbasis']['shipping'];
$shiptaxtotal = $shiptaxtotal + ($item['cartdata']['totalbasis']['taxcountry'] - $item['cartdata']['totalbasis']['taxcountrydisplay']);
$shiptaxreftotal = $shiptaxreftotal + ($item['cartdata']['totalbasis']['taxcountryref'] - $item['cartdata']['totalbasis']['taxcountryrefdisplay']);
$shippcttotal = $shippcttotal + $item['cartdata']['totalbasis']['taxcountrypctshipdisplay'];
$shippctcount++;
}
$amount_array['amount'] = $ordertotal;
$subtotal = $this->include_namespace('core','getprice',$amount_array);
$subtotal = $this->xhtml_encode($subtotal);
if (empty($item['cartdata']['totalbasis']['taxcountry'])) {$xtaxcountry = 0;} else {$xtaxcountry = $item['cartdata']['totalbasis']['taxcountry'];}
if (isset($item['cartdata']['totalbasis']['taxcountrydisplay'])) {$xtaxcountry = $item['cartdata']['totalbasis']['taxcountrydisplay'];}
$amount_array['amount'] = $xtaxcountry;
$taxcountry = $this->include_namespace('core','getprice',$amount_array);
$taxcountry = $this->xhtml_encode($taxcountry);
if (empty($item['cartdata']['totalbasis']['taxcountryref'])) {$xtaxcountryref = 0;} else {$xtaxcountryref = $item['cartdata']['totalbasis']
['taxcountryref'];}
if (isset($item['cartdata']['totalbasis']['taxcountryrefdisplay'])) {$xtaxcountryref = $item['cartdata']['totalbasis']['taxcountryrefdisplay'];}
$amount_array['amount'] = $xtaxcountryref;
$taxcountryref = $this->include_namespace('core','getprice',$amount_array);
$taxcountryref = $this->xhtml_encode($taxcountryref);
$rate = 0; if ($ordertotal > 0) {$rate = ($xtaxcountry - $xtaxcountryref) / $ordertotal;}
if (($rate > 0) && (isset($item['cartdata']['totalbasis']['taxcountrypctdisplay']))) {$rate = $item['cartdata']['totalbasis']['taxcountrypctdisplay'];}
$rate = round(100 * $rate,3);
if (preg_match('/\./',$rate)) {list($integer,$decimal) = preg_split('/\./i',$rate,2);} else {$integer = $rate; $decimal = 0;}
while (strlen($decimal) < 3) {$decimal .= '0';}
$rate = $this->xhtml_encode($integer . '.' . $decimal . '%');
print '<tr class="regtable">' . $eol;
print '<td class="regtable">' . $name . '</td>' . $eol;
print '<td class="regtable">' . $quan . '</td>' . $eol;
print '<td class="regtable">' . $subtotal . '</td>' . $eol;
print '<td class="regtable">' . $taxcountry . '</td>' . $eol;
if ((!(empty($order['order']['taxcreftotal']))) && ($order['order']['taxcreftotal'] > 0)) {
print '<td class="regtable">' . $taxcountryref . '</td>' . $eol;
}
print '<td class="regtable">' . $rate . '</td>' . $eol;
print '</tr>' . $eol;
} // End of foreach statement.
if (!(empty($shiptotal))) {
$amount_array = array('entrycurr' => $currapp, 'returncurr' => $currshow, 'formatwsym' => 1, 'formatweutax' => 0);
$amount_array['amount'] = $shiptotal;
$subtotal = $this->include_namespace('core','getprice',$amount_array);
$subtotal = $this->xhtml_encode($subtotal);
$amount_array['amount'] = $shiptaxtotal;
$taxcountry = $this->include_namespace('core','getprice',$amount_array);
$taxcountry = $this->xhtml_encode($taxcountry);
$amount_array0['amount'] = $shiptaxreftotal;
$taxcountryref = $this->include_namespace('core','getprice',$amount_array);
$taxcountryref = $this->xhtml_encode($taxcountryref);
$rate = 0; if ($shiptotal > 0) {$rate = ($shiptaxtotal - $shiptaxreftotal) / $shiptotal;}
if (($rate > 0) && (!(empty($shippcttotal))) && (!(empty($shippctcount)))) {$rate = $shippcttotal / $shippctcount;}
$rate = round(100 * $rate,3);
if (preg_match('/\./',$rate)) {list($integer,$decimal) = preg_split('/\./i',$rate,2);} else {$integer = $rate; $decimal = 0;}
while (strlen($decimal) < 3) {$decimal .= '0';}
$rate = $this->xhtml_encode($integer . '.' . $decimal . '%');
print '<tr class="regtable">' . $eol;
print '<td class="regtable">Delivery</td>' . $eol;
print '<td class="regtable">1</td>' . $eol;
print '<td class="regtable">' . $subtotal . '</td>' . $eol;
print '<td class="regtable">' . $taxcountry . '</td>' . $eol;
if ((!(empty($order['order']['taxcreftotal']))) && ($order['order']['taxcreftotal'] > 0)) {
print '<td class="regtable">' . $taxcountryref . '</td>' . $eol;
}
print '<td class="regtable">' . $rate . '</td>' . $eol;
print '</tr>' . $eol;
} // End of if statement.
print '</table>' . $eol . $eol;
} // End of if statement.
} // End of if statement.
// +--
// | Print our summary information.
// +--
print '<tr><td><hr><span class="eml-heading">Order Details</span><br/>' . $eol . $eol;
print '<table id="ORDERNUMTIME" class="regtable">' . $eol . $eol;
$id = $this->xhtml_encode($order['order']['id']);
$status = $order['order']['status'];
if (!(empty($order['display']['orderstatus'][$status]))) {$status = $order['display']['orderstatus'][$status];}
$status = $this->xhtml_encode($status);
$date = @date($dtformat,$order['order']['epochorder']);
$date = $this->xhtml_encode($date);
$gwprint = $this->xhtml_encode($order['gateway']['name']);
print '<tr class="subhead">' . $eol;
print '<td style="width: 150px; font-weight: bold;">Date & Time</td>' . $eol;
print '<td style="padding: 0px 0px 0px 30px;">' . $date . '</td>' . $eol;
print '</tr>' . $eol;
print '<tr class="subhead">' . $eol;
print '<td style="width: 150px; font-weight: bold;">Order Number</td>' . $eol;
print '<td style="padding: 0px 0px 0px 30px;">' . $id . '</td>' . $eol;
print '</tr>' . $eol;
print '<tr class="subhead">' . $eol;
print '<td style="width: 150px; padding-bottom: 15px; font-weight: bold;">Payment Method</td>' . $eol;
print '<td style="padding: 0px 0px 0px 30px;">' . $gwprint . '</td>' . $eol;
print '</tr>' . $eol;
// +--
// | Print the billing information if the mail type is not 'SHIPPER'.
// +--
if ($this->globals('ecom.mail_msgtype') != 'SHIPPER') {
$address = array('fname' => $order['order']['fname'],
'lname' => $order['order']['lname'],
'company' => $order['order']['company'],
'addone' => $order['order']['addone'],
'addtwo' => $order['order']['addtwo'],
'city' => $order['order']['city'],
'stateprov' => $order['order']['stateprov'],
'country' => $order['order']['country'],
'postalcode' => $order['order']['postalcode']);
$address = $this->include_namespace('core','getaddress',array('address' => $address, 'format' => 'XHTML'));
print '<tr class="subhead">' . $eol;
print '<td style="width: 150px; font-weight: bold;" valign="top">Billing & Contact Info</td>' . $eol;
print '<td style="padding: 0px 0px 0px 30px;">' . $address . ' ' . $eol;
if (!(empty($order['order']['email']))) {
$email = $this->xhtml_encode($order['order']['email']);
print '<br/>' . $email . ' ' . $eol;
} // End of if statement.
if (!(empty($order['order']['phone']))) {
$phone = $this->xhtml_encode($order['order']['phone']);
print '<br/>' . $phone . ' ' . $eol;
} // End of if statement.
if (!(empty($order['order']['fax']))) {
$fax = $this->xhtml_encode($order['order']['fax']);
print '<br/>fax ' . $fax . '' . $eol;
} // End of if statement.
print '</td>' . $eol;
print '</tr>' . $eol;
print '</table>' . $eol . $eol;
} // End of if statement.
// +--
// | Handle tracking numbers.
// +--
$track_count = 0;
foreach ($order['order'] as $key => $data) {
if ((preg_match('/^track/',$key)) && (!(empty($data)))) {
$track_count++;
} // End of if statement.
} // End of foreach statement.
if ((!(empty($track_count))) && (empty($order['order']['guest']))) {
print '<div class="regtablehead">Tracking Information</div>' . $eol . $eol;
print '<table id="TRACKINFO" class="regtable">' . $eol . $eol;
print '<tr class="regtable">' . $eol;
print '<td class="regtable" style="width: 100%"><p class="strong">Package Tracking Available</p>';
print '<p>Tracking information is available online for this order. To view ';
print 'tracking information for this order, login to your account and ';
print 'access the Review Online Orders page in the Account Menu.</p>' . $eol;
print '</td></tr>' . $eol;
print '</table>' . $eol;
} // End of if statement.
// +--
// | Create our shipping groups. We do this because we group items based on
// | shipping address.
// +--
$ship_array = array('NOTSHIPPED' => array());
$ship_addys = array();
$ship_count = 0;
foreach ($order['items'] as $num => $item) {
if ($item['shipstatus'] == 'N') {
$ship_array['NOTSHIPPED'][] = $item['id'];
} else {
$ship_addy = array('fname' => $item['fname'],
'lname' => $item['lname'],
'company' => $item['company'],
'addone' => $item['addone'],
'addtwo' => $item['addtwo'],
'city' => $item['city'],
'stateprov' => $item['stateprov'],
'country' => $item['country'],
'postalcode' => $item['postalcode']);
$ship_hash = md5(serialize($ship_addy));
$ship_addys[$ship_hash] = $ship_addy;
$ship_array[$ship_hash][] = $item['id'];
$ship_count++;
} // End of foreach statement.
} // End of foreach statement.
// +--
// | Print our items.
// +--
print '<tr><td><hr><span class="eml-heading">Items</span><br/>' . $eol . $eol;
print '<table>' . $eol . $eol;
foreach ($ship_array as $ship_type => $ship_items) {
if (!(empty($ship_items))) {
// +--
// | Print a row for the ship group.
// +--
print '<tr class="regtable">' . $eol;
// +--
// | Figure out whether we need to display images or recurring
// | charges.
// +--
$show_recur = 0;
$show_imgs = 0;
foreach ($cart as $num => $cartdata) {
if ($cartdata['savetype'] == $type) {
if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) {
if (!(file_exists($imgpath . $cartdata['imgsm']))) {
$cart[$num]['imgsm'] = 'none.png';
} // End of if statement.
} // End of if statement.
} // End of if statement.
} // End of foreach statement.
foreach ($cart as $num => $cartdata) {
if ($cartdata['savetype'] == $type) {
if ($cartdata['subtotalrec'] > 0) {$show_recur = 1;}
if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) {$show_imgs = 1;}
} // End of if statement.
} // End of foreach statement.
if (!($this->globals('core_settings.ecom.cartdispimg'))) {$show_imgs = 0;}
// +--
// | Define the images tag.
// +--
if ($show_imgs) {
$imgname = $cartdata['imgsm'];
if (empty($imgname)) {$imgname = 'none.png';}
if ($imgname == 'none.png') {
$imgtag = ' ';
} else {
$imgurl = 'media/ecom/prodlg/' . $imgname;
$imgtag = '<img src="' . $imgurl . '" ';
if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';}
$imgtag .= 'alt="' . $this->xhtml_encode($cartdata['name']) . '" />';
} // End of if statement.
} // End of if statement.
// +--
// | Print our item information cell.
// +--
if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%;" valign="top">' . $eol;}
elseif ($ship_count == 0) {print '<td class="regtable" style="width: 100%" valign="top">' . $eol;}
else {print '<td class="regtable" style="width: 100%" colspan="2" valign="top">' . $eol;}
foreach ($ship_items as $key_num => $item_num) {
foreach ($order['items'] as $num => $item) {
if ($item_num == $item['id']) {
// +--
// | Print the item name.
// +--
if ($shownums) {
$name = $item['itemnum'] . ' - ' . $item['itemname'];
} else {
$name = $item['itemname'];
} // End if.
$name = $this->xhtml_encode($name);
$quan = $this->xhtml_encode($item['itemquan']);
print '<br/>' . $imgtag . '' . $name . ' (x' . $quan . ')' . $eol;
// +--
// | Print options.
// +--
if (!(empty($item['cartdata']['optdisp']))) {
$xodisp = '';
foreach ($item['cartdata']['optdisp'] as $oname => $ovalue) {
if (!(empty($ovalue))) {
$oname = $this->xhtml_encode($oname);
$ovalue = $this->xhtml_encode($ovalue);
$xodisp .= $oname . ': ' . $ovalue;
if ($optlb) {$xodisp .= '<br />';} else {$xodisp .= '; ';}
} // End of if statement.
} // End of foreach statement.
$xodisp = preg_replace('/\; $/','',$xodisp);
$xodisp = preg_replace('/\<br \/\>$/','',$xodisp);
if (!(empty($xodisp))) {print '<p>' . $xodisp . '</p>';}
} // End of if statement.
// +--
// | Print download information.
// +--
if (!(empty($item['cartdata']['dlfiles']))) {
if (empty($ordercompl)) {
print '<p>Digital download access information will
be sent via email for this item when this
order has completed processing.</p>' . $eol;
} else {
$printeddl = 0;
$dlfiles = $this->make_list($item['cartdata']['dlfiles']);
print '<p>The following digital download access information is
available for this item:</p>' . $eol;
$dlfilecount = 0;
foreach ($dlfiles as $num => $dlfile) {
if (!(empty($order['download']['files'][$dlfile]))) {$dlfilecount++;}
} // End of foreach statement.
foreach ($dlfiles as $num => $dlfile) {
if (!(empty($order['download']['files'][$dlfile]))) {
$numplusone = $num + 1;
$text = 'File ' . $numplusone . ' of ' . $dlfilecount;
if ($mailtype != 'SHIPPER') {
print '<p><a href="' . $order['download']['files'][$dlfile] . '" title="Download File">';
print $text . '</a></p>' . $eol;
$printeddl = 1;
} // End of if statement.
} // End of if statement.
} // End of foreach statement.
if (!(empty($printeddl))) {
print '<p>Username: ' . $this->xhtml_encode($order['download']['username']) . '</p>' . $eol;
print '<p>Password: ' . $this->xhtml_encode($order['download']['password']) . '</p>' . $eol;
} else {
print '<p>Digital download access information will be sent
via email for this item separately.</p>' . $eol;
} // End of if statement.
} // End of if statement.
} // End of if statement.
// +--
// | Print upload information.
// +--
if (!(empty($item['cartdata']['uploads']))) {
if (empty($ordercompl)) {
print '<p>Uploaded file information will
be sent via email for this item when this
order has completed processing.</p>' . $eol;
} else {
print '<p>The following uploaded file information is
available for this item:</p>' . $eol;
$upfilecount = 0;
foreach ($item['cartdata']['uploads'] as $num => $upfile) {
if (!(empty($order['uploads']['files'][$upfile]))) {$upfilecount++;}
} // End of foreach statement.
foreach ($item['cartdata']['uploads'] as $num => $upfile) {
if (!(empty($order['uploads']['files'][$upfile]))) {
$numplusone = $num + 1;
$text = 'File ' . $numplusone . ' of ' . $upfilecount;
if ($mailtype != 'SHIPPER') {
print '<p><a href="' . $order['uploads']['files'][$upfile] . '" title="Uploaded File">';
print $text . '</a></p>' . $eol;
} // End of if statement.
} // End of if statement.
} // End of foreach statement.
} // End of if statement.
} // End of if statement.
// +--
// | Print quantity and amounts.
// +--
$amount_array = array('amount' => $item['ordertotal'],
'entrycurr' => $currapp,
'returncurr' => $currshow,
'formatwsym' => 1,
'formatweutax' => 1,
'eutaxrate' => $item['cartdata']['taxinfo']);
$taxcountryeudisp = $this->globals('core_settings.core.taxcountryeudisp');
$this->globals('core_settings.core.taxcountryeudisp','EXCL');
$subtotal = $this->include_namespace('core','getprice',$amount_array);
$subtotal = $this->xhtml_encode($subtotal);
$this->globals('core_settings.core.taxcountryeudisp',$taxcountryeudisp);
// print '<p>Quantity: ' . $quan . '</p>' . $eol;
if ($mailtype != 'SHIPPER') {
print '<p>Subtotal: ' . $subtotal . '</p>' . $eol;
if ($item['recurtotal'] > 0) {
$amount_array = array('amount' => $item['recurtotal'],
'entrycurr' => $currapp,
'returncurr' => $currshow,
'formatwsym' => 1,
'formatweutax' => 1,
'eutaxrate' => 'EXEMPT');
$subtotalrec = $this->include_namespace('core','getprice',$amount_array);
$subtotalrec = $this->xhtml_encode($subtotalrec);
print '<p>Recurring Charge: ' . $subtotalrec . '</p>' . $eol;
} // End of if statement.
} // End of if statement.
// print '<p class="ultablesp"> </p>' . $eol . $eol;
// +--
// | Print additional confirmation email text.
// +--
if ((!(empty($item['cartdata']['addemtext']))) && ($mailtype != 'SHIPPER')) {
print '<p>' . $this->xhtml_encode($item['cartdata']['addemtext']) . '</p>' . $eol . $eol;
} // End of if statement.
} // End of if statement.
} // End of foreach statement.
} // End of foreach statement.
print '</td>' . $eol;
// +--
// | Print our delivery address cell if needed.
// +--
if ($ship_type != 'NOTSHIPPED') {
print '<td class="regtable" style="width: 50%; padding-left: 30px;" valign="top">' . $eol;
print '<p class="strong">Shipping Address</p>' . $eol;
$address = $this->include_namespace('core','getaddress',array('address' => $ship_addys[$ship_type], 'format' => 'XHTML'));
print '<p>' . $address . '</p>' . $eol;
// +--
// | Print delivery method.
// +--
if ($item['shipstatus'] != 'N') {
$status = $order['display']['shipstatus'][$item['shipstatus']];
print '<p>' . $this->xhtml_encode($item['shipmethod']);
// if (!(empty($status))) {print ' (' . $this->xhtml_encode($status) . ')';}
print '</p>' . $eol;
} // End of if statement.
print '</td>' . $eol;
} // End of if statement.
print '</tr>' . $eol;
} // End of if statement.
} // End of foreach statement.
print '</table>' . $eol . $eol;
// +--
// | Handle custom fields. We do this by working with the 'custom' key in
// | the order array.
// +--
if (!(empty($order['custom']))) {
// +--
// | See how many fields for which we have data to print. If we don't
// | have any we skip displaying this section.
// +--
$count = 0;
foreach ($order['custom'] as $ordfield => $name) {
if (!(empty($order['order'][$ordfield]))) {$count++;}
} // End of if statement.
if (!(empty($count))) {
print '<div class="regtablehead">Other Information</div>' . $eol . $eol;
print '<table id="OTHERINFO" class="regtable">' . $eol . $eol;
$field_count = 1;
foreach ($order['custom'] as $ordfield => $name) {
$name = $this->xhtml_encode($name);
$ordfield = $order['order'][$ordfield];
if (!(empty($ordfield))) {
if (empty($ordfield)) {$ordfield = 'Not Entered';}
if ($field_count == 1) {print '<tr class="regtable">' . $eol;}
print '<td class="regtable" style="width: 50%"><p class="strong">' . $name . '</p><p>' . $ordfield . '</p></td>' . $eol;
if ($field_count == 2) {print '</tr>' . $eol; $field_count = 1;}
else {$field_count = 2;}
} // End of if statement.
} // End of foreach statement.
if ($field_count == 2) {
print '<td class="regtable" style="width: 50%"> </td>' . $eol;
print '</tr>' . $eol;
} // End of if statement.
print '</table>' . $eol . $eol;
} // End of if statement.
} // End of if statement.
// +--
// | Handle comments.
// +--
if (!(empty($order['order']['commentsext']))) {
print '<div class="regtablehead">Order Comments</div>' . $eol . $eol;
print '<table id="ORDERCOMMENTS" class="regtable">' . $eol;
print '<tr class="regtable"><td class="regtable" style="width: 100%">' . $eol;
print '<p class="strong">Comments</p>' . $eol . $eol;
print '<p>' . $this->xhtml_encode($order['order']['commentsext']) . '</p>' . $eol;
print '</td></tr>' . $eol;
print '</table>' . $eol . $eol;
} // End of if statement.
// +--
// | Handle company registration displays for the European Union.
// +--
if ($taxcountrysys == 'EUVAT') {
$taxcountryeuhome = $this->xhtml_encode($this->globals('core_settings.core.taxcountryeuhome'));
$taxvateunumber = $this->xhtml_encode($this->globals('core_settings.core.taxvateunumber'));
$taxcompanyeunumber = $this->xhtml_encode($this->globals('core_settings.core.taxcompanyeunumber'));
$taxcompanyeuaff = $this->xhtml_encode($this->globals('core_settings.core.taxcompanyeuaff'));
$text = '';
if (!(empty($taxvateunumber))) {$text .= '<p>VAT Registration Number: ' . $taxvateunumber . '</p>';}
if (!(empty($taxcompanyeunumber))) {$text .= '<p>Company Registration Number: ' . $taxcompanyeunumber . '</p>';}
if (!(empty($taxcountryeuhome))) {$text .= '<p>Registered Company Location: ' . $taxcountryeuhome . '</p>';}
if (!(empty($taxcompanyeuaff))) {$text .= '<p>Affiliations: ' . $taxcompanyeuaff . '</p>';}
if (!(empty($text))) {
print '<div class="regtablehead">Company Registration Information</div>' . $eol . $eol;
print '<table id="COMPANYREG" class="regtable">' . $eol;
print '<tr class="regtable"><td class="regtable" style="width: 100%">' . $eol;
print '<p class="strong">Company Registration</p>' . $eol . $eol;
print $text . $eol;
print '</td></tr>' . $eol;
print '</table>' . $eol . $eol;
} // End of if statement.
} // End of if statement.
} // End of if statement.
?>
Offline
You can not just insert code used form the cart script, there is no cart data by the time you get to emails, it has long been erased and the information inserted into the order array, you will have to pull the image information from there. You will also have to build or include the full url to the image (wwwexample.com/media/imgsm/image_name.jpg) you will not find the image with the code (from your posting)
$imgurl = 'media/ecom/prodlg/' . $imgname; $imgtag = '<img src="' . $imgurl . '" '; if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';} $imgtag .= 'alt="' . $this->xhtml_encode($cartdata['name']) . '" />';
in the email include. This code will only display an image from a current viewing of a page within ccp as it is looking or using the base url for the site during the search call for the tag, an email will not know the base url of a site to pull an image form unless the full url is present.
John
Offline
Yeah, I did put the full URL path in there. But are you saying it can't look past
$imgurl = 'media/ecom/prodlg/' . $imgname;
Long enough to see where to pull the info? It won't "parse" (may not be the right word) that?
Offline
From what I see in your first post you inserted these lines from the cart diaplay script:
$cart = $this->globals('ecom.cart_contents'); $imgwidth = $this->globals('core_settings.ecom.imgsizeprodcart'); $imgpath = $this->globals('core.path_public') . '/media/ecom/prodlg/';
// +-- // | Figure out whether we need to display images or recurring // | charges. // +-- $show_recur = 0; $show_imgs = 0; foreach ($cart as $num => $cartdata) { if ($cartdata['savetype'] == $type) { if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) { if (!(file_exists($imgpath . $cartdata['imgsm']))) { $cart[$num]['imgsm'] = 'none.png'; } // End of if statement. } // End of if statement. } // End of if statement. } // End of foreach statement. foreach ($cart as $num => $cartdata) { if ($cartdata['savetype'] == $type) { if ($cartdata['subtotalrec'] > 0) {$show_recur = 1;} if ((!(empty($cartdata['imgsm']))) && ($cartdata['imgsm'] != 'none.png')) {$show_imgs = 1;} } // End of if statement. } // End of foreach statement. if (!($this->globals('core_settings.ecom.cartdispimg'))) {$show_imgs = 0;} // +-- // | Define the images tag. // +-- if ($show_imgs) { $imgname = $cartdata['imgsm']; if (empty($imgname)) {$imgname = 'none.png';} if ($imgname == 'none.png') { $imgtag = ' '; } else { $imgurl = 'media/ecom/prodlg/' . $imgname; $imgtag = '<img src="' . $imgurl . '" '; if ($imgwidth) {$imgtag .= 'width="' . $imgwidth . '" ';} $imgtag .= 'alt="' . $this->xhtml_encode($cartdata['name']) . '" />'; } // End of if statement. } // End of if statement.
Even with this code in place there is no cart contents to call, the foreach statement can not find the images or even get the right image with the correct item name and description. With no cart information the script will end in this section:
// +-- // | Define the images tag. // +-- if ($show_imgs) { $imgname = $cartdata['imgsm']; if (empty($imgname)) {$imgname = 'none.png';} if ($imgname == 'none.png') { $imgtag = ' '; } else {
Don't get confused with the call for information in the order summary calling for cartdata, there is cartdata for the items but it is deep within the order array which should look like:
$order['items']['cartdata']['imgsm']
you would also want to do your image finding in this section since it is where the item(s) display is being built:
// +-- // | Print our item information cell. // +-- if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%;" valign="top">' . $eol;} elseif ($ship_count == 0) {print '<td class="regtable" style="width: 100%" valign="top">' . $eol;} else {print '<td class="regtable" style="width: 100%" colspan="2" valign="top">' . $eol;} foreach ($ship_items as $key_num => $item_num) { foreach ($order['items'] as $num => $item) { if ($item_num == $item['id']) { // // // This would be a good place to build the image tags since it is looping thru // the order array and limited to the product id matching the item information // cell being built. // // which should look like // // $imgname = $item['cartdata']['imgsm']; // // // +-- // | Print the item name. // +-- if ($shownums) { $name = $item['itemnum'] . ' - ' . $item['itemname']; } else { $name = $item['itemname']; } // End if. $name = $this->xhtml_encode($name); $quan = $this->xhtml_encode($item['itemquan']); print '<br/>' . $imgtag . '' . $name . ' (x' . $quan . ')' . $eol;
John
Offline