Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Varible Help


mme

Recommended Posts

Posted

How would I make this into a varible?

 

 

echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />');

Posted

Could somebody please awnser this question?

Posted
$variable = tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

This still doesnt return the delivery address in admin/orders.php to be sent by email.

Posted
This still doesnt return the delivery address in admin/orders.php to be sent by email.

That's not what you asked for.

 

You asked how to get the posted code into a variable.

 

That's what I posted.

 

I saw your other post about the variables in the email in the orders.php file.

 

If you post the part of orders.php where you're trying to do this, maybe I can help.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

I am currently using Ultimate HTML Emails and it sends the email correctly however some of the varibles arnt't showing properly.

 

admin/orders.php (line 57 to 99)

//---  Beginning of addition: Ultimate HTML Emails  ---//
if (EMAIL_USE_HTML == 'true') {
require(DIR_FS_CATALOG_MODULES . 'UHtmlEmails/orders_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
require(DIR_FS_CATALOG_MODULES . 'UHtmlEmails/orders_ship_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
$email = $html_email;
$email_ship = $html_ship_email;
}else{//Send text email
//---  End of addition: Ultimate HTML Emails  ---//

		$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

		//---  Beginning of addition: Ultimate HTML Emails  ---//
}

if(ULTIMATE_HTML_EMAIL_DEVELOPMENT_MODE === 'true'){
//Save the contents of the generated html email to the harddrive in .htm file. This can be practical when developing a new layout.
$TheFileName = DIR_FS_CATALOG . 'Last_mail_from_orders.php.htm';
$TheFileHandle = fopen($TheFileName, 'w') or die("can't open error log file");
fwrite($TheFileHandle, $email);
fclose($TheFileHandle);
}
//---  End of addition: Ultimate HTML Emails  ---//

		tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

		if ($status = $ship_status) {
		// Send Extra Email To Packer
		tep_mail($email_ship_name, $email_ship_address, $email_ship_subjectT, $email_ship, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
		// End of extra email
		}

		$customer_notified = '1';
	  }
	  else {

	 if ($status = $ship_status) {
	 // Send Extra Email To Packer
		require(DIR_FS_CATALOG_MODULES . 'UHtmlEmails/orders_ship_'. ULTIMATE_HTML_EMAIL_LAYOUT .'.php');
		$email_ship = $html_ship_email;
		tep_mail($email_ship_name, $email_ship_address, $email_ship_subjectT, $email_ship, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
		// End of extra email
		}

		}

 

orders_ship_test.php

<?php
/*
================================================================================
=========
This module does one thing: It creates the contents of the html email in the variable $html_ship_email.

If you would like to customize this html email you should first make sure you know a bit about html emails.
Here are some liks that might be interesting for you: 

http://www.xavierfrenette.com/articles/css-support-in-webmail/
http://www.alistapart.com/articles/cssemail/
http://www.campaignmonitor.com/blog/archives/2006/03/a_guide_to_css_1.html
http://www.reachcustomersonline.com/content/2004/11/11/09.27.00/index.php
================================================================================
=========]

SETTINGS
*/

$email_ship_name = 'name';
$email_ship_address = '[email protected]';
$email_ship_subjectT = 'test order update';

// Include order var
include(DIR_WS_CLASSES . 'order.php');

// Set Delivery Address
$email_ship_sad=tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />');

//require(DIR_WS_LANGUAGES . $language . '/modules/UHtmlEmails/' . 'standard_checkout_process.php');
$ArrayLNTargets = array("\r\n", "\n\r", "\n", "\r", "\t"); //This will be used for taking away linefeeds with str_replace() throughout the mail. Tabs is invisible so we take them away to

for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {//walk through the order totals and create a string containing them
//The title sometimes ends with ':' and somtimes not and sometimes there is a space. Take it all away =)
$temp_title = trim(strip_tags($order_totals[$i]['title']));
if(substr($temp_title, -1) == ':'): $temp_title = substr($temp_title, 0, -1); endif;

$HTMLEmailOrderTotals .= '<em>'. $temp_title .': </em><strong>' . strip_tags($order_totals[$i]['text']) . "</strong>\n";
}

//Now we chall create an array with the attribute info for every product.
$HTML_Email_product_attributes = array();

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
if (isset($order->products[$i]['attributes'])) {//This product has attributes
	$HTML_Email_product_attributes[$i] ='';//make sure the array position is a string
	for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
		if (DOWNLOAD_ENABLED == 'true') {
		  $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
							   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
							   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
								on pa.products_attributes_id=pad.products_attributes_id
							   where pa.products_id = '" . $order->products[$i]['id'] . "' 
								and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
								and pa.options_id = popt.products_options_id 
								and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
								and pa.options_values_id = poval.products_options_values_id 
								and popt.language_id = '" . $languages_id . "' 
								and poval.language_id = '" . $languages_id . "'";
		  $attributes = tep_db_query($attributes_query);
		} else {
		  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
		}
		$attributes_values = tep_db_fetch_array($attributes);

		$HTML_Email_product_attributes[$i] .= '<br /><em style="font-size:12px;">   -'. $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] .'</em>';
	}
}else{ //This product does not have attributes
	$HTML_Email_product_attributes[$i] ='';
}
}

$y = date("Y"); // For the year


// Start the email template
$html_ship_email = '<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1">
<style type="text/css">
TD{FONT-FAMILY:Verdana,Tahoma,Arial,"Sans Serif";FONT-SIZE:10pt}
BODY{FONT-FAMILY:Verdana,Tahoma,Arial,"Sans Serif";FONT-SIZE:10pt}
.style2 {
font-size: 8pt;
font-style: italic;
}
.style3 {font-size: 8pt}
.style4 {color: #FFFFFF}
.style5 {color: #000000}
</style>
</head>
<body bgColor="#eeeeee">
<table cellSpacing="1" cellPadding="0" width="700" bgColor="#cccccc" border="0" align="center"><tr>
<td bgcolor="white">
<table cellSpacing="0" cellPadding="15" width="100%"><tr><td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0"><tr>
<td><img src="' . HTTP_SERVER . '/site/shop/includes/modules/UHtmlEmails/files/header.gif" alt="Header" border="0"></td>
<td align="center"><div align="right"><img src="' . HTTP_SERVER . '/site/shop/includes/modules/UHtmlEmails/files/logo_shop.gif" alt="Logo" border="0"></div></td>
</tr></table>
<hr size="0" color="#CCCCCC">
<table cellspacing="0" cellpadding="10" width="100%"><tr><td><table cellspacing="0" cellpadding="10" width="100%">
<tr>
 <td>
<p><span class="style2"><small>This is an automated email regarding order: '.$oID.'</small></span><br>
</p>
<p>Order Details:</p>
<p><strong>Customer Name:</strong> '. $check_status['customers_name'] .'<br>
<table width="86%" border="0">
  <tr>
	<td width="79%" bgcolor="#333333"><strong><span class="style4">Customer Address: </span><br>
	</strong></td>
	<td width="3%" rowspan="2"> </td>
	<td width="18%" rowspan="2">Print Address</td>
  </tr>
  <tr>
	<td bgcolor="#CCCCCC">' . $email_ship_sad . '</td>
  </tr>
</table>
<p> </p>
<table width="550" border="0">
  <tr bgcolor="#333333">
	<td width="43%"><div align="center" class="style1 style4"><strong>Product</strong></div></td>
	<td width="18%"><div align="center" class="style1 style4"><strong>Quantity</strong></div></td>
	</tr>';
		for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
		$html_ship_email .='
		<tr bgcolor="#CCCCCC">
	<td><div align="center" class="style1">' . $check_status[$i]["name"] . $html_ship_email_product_attributes[$i]. '</div></td>
	<td><div align="center" class="style1">' . $check_status[$i]["qty"].'</div></td>
	</tr>';
	}
	$html_ship_email .='
</table>
<p><br>
  <br>
  <br>
  </td>
</tr></table></td></tr></table>
<hr size="0" color="#CCCCCC">
<center>
 <br><small>© ' .$y. ' <a href="' . HTTP_SERVER . '" class="style5">' . STORE_NAME . '</a></small><br>
</center></td></tr></table></td></tr></table>
</body></html>';

//This erases the newlines =) if this is not done the mail sent will have adittional <br /> in it. 
//Why? Hint: look at the function tep_convert_linefeeds and where it is used.

$html_ship_email = str_replace($ArrayLNTargets, '', $html_ship_email);
?>

 

Thanks

Posted

The only place I see the code fragment you posted is in the second file you posted:

 

// Set Delivery Address
$email_ship_sad=tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br />');

I'd say you're going to need a Mysql query before that to populate the variable with the info you need.

 

I really don't know squat about Mysql so I'm afraid I won't be able to help.

 

That's kind of what I suspected all along, and that's why I didn't answer your original post on the subject....

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Do you know anybody that I can PM this question to or should I wait for somebody to reply as I do need this as soon as possible.

 

Thanks

 

MME

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...