Jump to content
Latest News: (loading..)
alenkij

Imprint Text Options

Recommended Posts

I have a small problem that came up with a client. I am using 7 Text Attributes and am able to select the ones needed for a product. Is there any way on the invoice to set the order of how they print out as well as the order of how they display on the product. I have two products with the same Text Attributes and the order of how they appear is different.

 

Dan

Share this post


Link to post
Share on other sites

I needed added fields to be required and here was my quick solution -

 

Basically for every product add-to-cart page I put in a js validation function that defaults to just submitting okay.

But for each added field from this contrib a check is done to see if it's empty and if it is you're given a warning and the form doesn't submit.

Could be done cleaner but it works and thought I'd share.

 

Starting with oscommerce-2.2ms2

I have other contribs on this page but I don't think the code is affected below except line numbers.

 

All in catalog/product_info.php

 

Somewhere around line 51 change

-----------CHANGE --------------------------------------------

<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

-----------TO-------------------------------------------------------

 

<!-- body_text //-->
<?php $strFormFunctionParams="onsubmit='return validateForm(this);'"?>
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'),"post",$strFormFunctionParams); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

------------------------------------------------------------------------------------------------------------------------------------

Somewhere around line 184

 

-----------CHANGE --------------------------------------------

<!-- denuz products text attributes -->
<?php
 $text_attributes_query = tep_db_query("select pta.*, cbta.products_text_attributes_text from products_text_attributes as pta, products_text_attributes_enabled as ptae, customers_basket_text_attributes as cbta where ptae.products_text_attributes_id = pta.products_text_attributes_id and ptae.products_id = " . tep_get_prid($HTTP_GET_VARS['products_id']) . " and cbta.products_text_attributes_id = pta.products_text_attributes_id and cbta.session_id = '" . tep_session_id() . "'");
 if (tep_db_num_rows($text_attributes_query) == 0)  
   $text_attributes_query = tep_db_query("select pta.* from products_text_attributes as pta, products_text_attributes_enabled as ptae where ptae.products_text_attributes_id = pta.products_text_attributes_id and ptae.products_id = " . tep_get_prid($HTTP_GET_VARS['products_id']));

 while ($text_attributes = tep_db_fetch_array($text_attributes_query)) {
?>
     <table border="0" cellspacing="0" cellpadding="2"><tr>
       <td>
		<?php echo $text_attributes['products_text_attributes_name'] . ': </td><td>' . tep_draw_input_field('products_text_attributes_' . $text_attributes['products_text_attributes_id'], tep_not_null($text_attributes['products_text_attributes_text']) ? $text_attributes['products_text_attributes_text'] : ''); ?>
       </td>
     </tr></table>

<?php
 }
?>
<!-- eof denuz products text attributes -->

-----------TO-------------------------------------------------------

<!-- denuz products text attributes -->
<?php $strAttribsJS=""; // 2011-04-20 AMT change - Required extra field	 ?>
<?php
 $text_attributes_query = tep_db_query("select pta.*, cbta.products_text_attributes_text from products_text_attributes as pta, products_text_attributes_enabled as ptae, customers_basket_text_attributes as cbta where ptae.products_text_attributes_id = pta.products_text_attributes_id and ptae.products_id = " . tep_get_prid($HTTP_GET_VARS['products_id']) . " and cbta.products_text_attributes_id = pta.products_text_attributes_id and cbta.session_id = '" . tep_session_id() . "'");
 if (tep_db_num_rows($text_attributes_query) == 0)  {
   $text_attributes_query = tep_db_query("select pta.* from products_text_attributes as pta, products_text_attributes_enabled as ptae where ptae.products_text_attributes_id = pta.products_text_attributes_id and ptae.products_id = " . tep_get_prid($HTTP_GET_VARS['products_id']));
	$strAttribsJS=""; // 2011-04-20 AMT change - Required extra field
   }
 while ($text_attributes = tep_db_fetch_array($text_attributes_query)) {
?>
<?php $strAttribsJS.="
	if(tf.products_text_attributes_".$text_attributes['products_text_attributes_id'].".value=='') {alert('Field \'".$text_attributes['products_text_attributes_name']."\' required'); return false;}
"; // 2011-04-20 AMT change - Required extra field ?>
     <table border="0" cellspacing="0" cellpadding="2"><tr>
       <td>
		<?php echo $text_attributes['products_text_attributes_name'] . ': </td><td>' . tep_draw_input_field('products_text_attributes_' . $text_attributes['products_text_attributes_id'], tep_not_null($text_attributes['products_text_attributes_text']) ? $text_attributes['products_text_attributes_text'] : ''); ?>
       </td>
     </tr></table>

<?php
 }
?>
<?php // BOF 2011-04-20 AMT change - Required extra field ?>
<script language="javascript">
function validateForm(tf){
	<?php print $strAttribsJS ?>
	return true;
}
</script>
<?php // EOF 2011-04-20 AMT change - Required extra field ?>

-----------END CHANGES--------------------------------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Before I make the attempt, has anyone tried to install Imprint Text Options on osCommerce 2.3.1? With the number of edits, I'm expecting some issues. Thanks for any guidance.

Share this post


Link to post
Share on other sites

Was a resolution found for this issue?

 

In my case there is nothing written to the database, and I have looked over the code several times now. I think I have found something that maybe causes this. Please correct me if I'm wrong:

 

In my checkout_confirmation.php I have this piece of code:

if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
 } else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
 }

 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

What I understand from this is that if I pay with Paypal then the first $form_action_url is used. If I dont use a payment form then checkout_process.php is executed. Am I right so far?

 

In my case a customer is sent to paypal_standard.php and NOT checkout_process.php

Since the code for denuz - Imprint for writing to the database is in checkout_process.php then nothing is written to the database.

 

My question is:

Can I implement the two pieces of Imprint code in checkout_process.php into paypal_standard.php ?

 

This is where I have implemented the code in paypal_standard.php, but not activated it:

 

First piece:

        	tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

       	$order_products_id = tep_db_insert_id();

// denuz text attr
/*
$attr_q = tep_db_query("select * from customers_basket_text_attributes where session_id = '$osCsid' and products_id = " . tep_get_prid($order->products[$i]['id']));
while ($attr = tep_db_fetch_array($attr_q)) {
  	tep_db_query("insert into orders_text_attributes values ($insert_id, " . tep_get_prid($order->products[$i]['id']) . ", " . $attr['products_text_attributes_id'] . ", '" .  $attr['products_text_attributes_text'] . "')");
}
tep_db_query("delete from customers_basket_text_attributes where products_id = " . tep_get_prid($order->products[$i]['id']) . " and session_id = '" . $osCsid . "'");
*/
// eof denuz text attr   

       	$attributes_exist = '0';
       	if (isset($order->products[$i]['attributes'])) {

 

Second piece:

      	$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
     	}
   	}

// denuz_arun text attr
/*
 	$pid_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_model LIKE '" . tep_db_input($order->products[$i]['model']) . "'");
 	$pid = tep_db_fetch_array($pid_query);

$denux_arunQry = "select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " .  $insert_id.
		//$HTTP_GET_VARS['oID'] . 
  	" and ota.products_id = " . $pid['products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id";
  //echo ;
 	$attr_q = tep_db_query($denux_arunQry); 
 	$denux_arun_ ='';
 	while ($attr = tep_db_fetch_array($attr_q)) {
   	$denux_arun_ .=  $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text'])."\n";
}
*/
// eof denuz_arun text attr   

//------insert customer choosen option eof ----
   	$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
   	$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];

 

And this litle change:

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 // denuz :
   	//$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n". $denux_arun_ . "\n";

 

Any help on this would be appreciated..

Share this post


Link to post
Share on other sites

how do I receive the text input in the form

require('includes/application_top.php');
if ($cart->count_contents() == 0) {
 tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
$produtos = $cart->get_products();
$subject = "Contact";
$message = '<HTML><HEAD><TITLE>email</TITLE></HEAD><BODY><FONT face="Tahoma, Verdana, Arial" size=2>
<br><b>Products<b/><br></font><table border=1 width=100%>';$prod_lin = '
<TR bgColor="#ffffcc"><TD width=361><FONT face="Tahoma, Arial" size=1><STRONG>Product</STRONG></FONT></TD>
<TD width=105><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Color</STRONG></FONT></TD>
<TD width=105><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Cod</STRONG></FONT></TD>
<TD width=69><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Qts</STRONG></FONT></TD>
<TD width=89><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Price</STRONG></FONT></TD>
<TD width=80><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Price Total</STRONG></FONT></TD></TR>';for($i=0;$i<sizeof($produtos);$i++) {
$prod_pric = ($produtos[$i]['price']==0?'Price':$currencies->format($produtos[$i]['price']));
$prod_tota = ($produtos[$i]['price']==0?'Price':$currencies->format($produtos[$i]['price'] * $produtos[$i]['quantity']));
$prod_lin .= '<TR><TD><FONT face="Tahoma, Verdana, Arial" size=1>'
.$produtos[$i]['name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

.$produtos[$i]['products_text_attributes_name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

.$produtos[$i]['model'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'
.$produtos[$i]['quantity'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'
.$prod_pric.' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'.$prod_tota.' </FONT></TD></TR>';
}
$prod_lin .= '<TR bgColor="#cccccc"><TD><FONT face="Tahoma, Verdana, Arial" size=2><STRONG>TOTAL</STRONG></FONT></TD><TD> </TD><TD> </TD><TD> </TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'.$currencies->format($cart->show_total()).' </FONT></TD></TR>';
$message .= $prod_lin;
$message .= '</table></body></html>';
$headers  = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: $firstname <$email_address>\n";
mail(STORE_OWNER_EMAIL_ADDRESS, $subject, $message, $headers);

$headers  = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "To: $firstname <$email_address>\n";
$headers .= "From: ".STORE_OWNER."<".STORE_OWNER_EMAIL_ADDRESS.">\n";
mail($email, $subject, $message, $headers);
$cart->reset(TRUE);
tep_session_unregister('sendto');
tep_session_unregister('comments');

 

well placed but have not received information entered in input field

.$produtos[$i]['products_text_attributes_name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

Share this post


Link to post
Share on other sites

can put a text on top of the input that appears only once.

 

  <?php if ($text_attributes['products_text_attributes_name'] == 0){ echo 'text text' ;}?>

 

did not work

Edited by dstebo

Share this post


Link to post
Share on other sites

can put a text on top of the input that appears only once.

 

  <?php if ($text_attributes['products_text_attributes_name'] == 0){ echo 'text text' ;}?>

 

did not work

how do I receive the text input in the form

require('includes/application_top.php');
if ($cart->count_contents() == 0) {
 tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
}
$produtos = $cart->get_products();
$subject = "Contact";
$message = '<HTML><HEAD><TITLE>email</TITLE></HEAD><BODY><FONT face="Tahoma, Verdana, Arial" size=2>
<br><b>Products<b/><br></font><table border=1 width=100%>';$prod_lin = '
<TR bgColor="#ffffcc"><TD width=361><FONT face="Tahoma, Arial" size=1><STRONG>Product</STRONG></FONT></TD>
<TD width=105><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Color</STRONG></FONT></TD>
<TD width=105><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Cod</STRONG></FONT></TD>
<TD width=69><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Qts</STRONG></FONT></TD>
<TD width=89><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Price</STRONG></FONT></TD>
<TD width=80><FONT face="Tahoma, Verdana, Arial" size=1><STRONG>Price Total</STRONG></FONT></TD></TR>';for($i=0;$i<sizeof($produtos);$i++) {
$prod_pric = ($produtos[$i]['price']==0?'Price':$currencies->format($produtos[$i]['price']));
$prod_tota = ($produtos[$i]['price']==0?'Price':$currencies->format($produtos[$i]['price'] * $produtos[$i]['quantity']));
$prod_lin .= '<TR><TD><FONT face="Tahoma, Verdana, Arial" size=1>'
.$produtos[$i]['name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

.$produtos[$i]['products_text_attributes_name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

.$produtos[$i]['model'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'
.$produtos[$i]['quantity'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'
.$prod_pric.' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'.$prod_tota.' </FONT></TD></TR>';
}
$prod_lin .= '<TR bgColor="#cccccc"><TD><FONT face="Tahoma, Verdana, Arial" size=2><STRONG>TOTAL</STRONG></FONT></TD><TD> </TD><TD> </TD><TD> </TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'.$currencies->format($cart->show_total()).' </FONT></TD></TR>';
$message .= $prod_lin;
$message .= '</table></body></html>';
$headers  = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: $firstname <$email_address>\n";
mail(STORE_OWNER_EMAIL_ADDRESS, $subject, $message, $headers);

$headers  = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "To: $firstname <$email_address>\n";
$headers .= "From: ".STORE_OWNER."<".STORE_OWNER_EMAIL_ADDRESS.">\n";
mail($email, $subject, $message, $headers);
$cart->reset(TRUE);
tep_session_unregister('sendto');
tep_session_unregister('comments');

 

well placed but have not received information entered in input field

.$produtos[$i]['products_text_attributes_name'].' </FONT></TD><TD><FONT face="Tahoma, Verdana, Arial" size=2>'

 

 

Use this form to receive requests filled

do not get the (products_text_attributes_name) (products_text_attributes_text) added product

 

Can someone help me

Share this post


Link to post
Share on other sites

I have downloaded it, but when I click on the text attributes I want included with the product, it does not save. What am I doing wrong?

 

Thanks

Share this post


Link to post
Share on other sites

I have written two contribs that will allow your customer to add the same product to their cart with different text names. Its a quick easy fix and it works. This program should be re-written to do a better job at this, but this fix will allow you to do the same thing.

 

Another contrib that I wrote allows you to charge a fee per text field per product. It works with the above contrib in which it if the customer has 2 or more of the same product and has custom text per product (same product but more qty then 1) it will calc the fee per qty value.

 

This contrib has two options you can install with. Either the above method which works with the first contrib I mentioned or another method if you do not wish to use the more then one text entry per product.

 

I will write up directions today for all of you.

 

I may need to add the same product in a cart with different text, could you tell me how I can accomplish this?

Thanks

 

Ashley

Share this post


Link to post
Share on other sites

Before I make the attempt, has anyone tried to install Imprint Text Options on osCommerce 2.3.1? With the number of edits, I'm expecting some issues. Thanks for any guidance.

 

I am having major issues and need help trying to install this properly. I am an extreme noob to OSC, *sigh*, I know, I know. My business is solely based off of personalized jewelry and if I cannot find a way to allow the customer to input what he/she wants customized, I'm going to go nuts. I have been looking for weeks and can't seem to find anything that works.

 

Please, anyone with suggestions?!

Share this post


Link to post
Share on other sites

Hi,

I've installed Imprint Text Options on OSC 2.3.1 with a modified template.

It seems ti work. At least there are no errors. The only issue with it is that it does not save the checkboxes status in the admin area. When I check the "name" and "date" checkbox and click on save, they just stay unchecked. Logically I can't see any text input fields on any product page.

 

Can anyone help?

 

Thanks in advance...

Share this post


Link to post
Share on other sites

Has anyone found a solution to use Paypal Payments Standard with the Imprint Text contribution?

 

 

In my case there is nothing written to the database, and I have looked over the code several times now. I think I have found something that maybe causes this. Please correct me if I'm wrong:

 

In my checkout_confirmation.php I have this piece of code:

if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
 } else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
 }

 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

What I understand from this is that if I pay with Paypal then the first $form_action_url is used. If I dont use a payment form then checkout_process.php is executed. Am I right so far?

 

In my case a customer is sent to paypal_standard.php and NOT checkout_process.php

Since the code for denuz - Imprint for writing to the database is in checkout_process.php then nothing is written to the database.

 

My question is:

Can I implement the two pieces of Imprint code in checkout_process.php into paypal_standard.php ?

 

This is where I have implemented the code in paypal_standard.php, but not activated it:

 

First piece:

			tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

		$order_products_id = tep_db_insert_id();

// denuz text attr
/*
$attr_q = tep_db_query("select * from customers_basket_text_attributes where session_id = '$osCsid' and products_id = " . tep_get_prid($order->products[$i]['id']));
while ($attr = tep_db_fetch_array($attr_q)) {
  	tep_db_query("insert into orders_text_attributes values ($insert_id, " . tep_get_prid($order->products[$i]['id']) . ", " . $attr['products_text_attributes_id'] . ", '" .  $attr['products_text_attributes_text'] . "')");
}
tep_db_query("delete from customers_basket_text_attributes where products_id = " . tep_get_prid($order->products[$i]['id']) . " and session_id = '" . $osCsid . "'");
*/
// eof denuz text attr  

		$attributes_exist = '0';
		if (isset($order->products[$i]['attributes'])) {

 

Second piece:

		  $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
	  }
	}

// denuz_arun text attr
/*
  $pid_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_model LIKE '" . tep_db_input($order->products[$i]['model']) . "'");
  $pid = tep_db_fetch_array($pid_query);

$denux_arunQry = "select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " .  $insert_id.
	//$HTTP_GET_VARS['oID'] .
  	" and ota.products_id = " . $pid['products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id";
  //echo ;
  $attr_q = tep_db_query($denux_arunQry);
  $denux_arun_ ='';
  while ($attr = tep_db_fetch_array($attr_q)) {
	$denux_arun_ .=  $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text'])."\n";
}
*/
// eof denuz_arun text attr  

//------insert customer choosen option eof ----
	$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
	$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];

 

And this litle change:

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 // denuz :
	//$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n". $denux_arun_ . "\n";

 

Any help on this would be appreciated..

 

If Paypal Payments Standard module is used then there are no text attributes written to the database on completion of an order. This is because instead of the Checkout_process.php being called at the end of a checkout, paypal_standard.php is used which does not have any code from this contribution in it.

 

I have not been able to successfully take the snippets of code from Checkout_Process.php and insert them into the paypal_standard.php file without receiving a MySql syntax error.

 

http://www.oscommerce.com/community/contributions,160/category,all/search,attributes

 

 

Could anyone assist with trying get this contribution to work in the same way as the "Option Type Feature" is used with Paypal Payments Standard?

 

Any assistance would be greatly appreciated!

Edited by BLTZKRG

Share this post


Link to post
Share on other sites

Is there a working demo of this contribution? Just so I can see how it works and what it looks like before I start diving in and editing files. :)

Share this post


Link to post
Share on other sites

hi, could somebody helpme please, ive installed the contribution as per the instructions but when customers purchase items with the text attributes the order.php file doesnt show the attributes, the only way i can view what has been written is to log in to phpmyadmin and find it via order_text_attributes, i have checked to see if there is something that ive missed but im lost, and im a bit of a noob with php, pls could some one help!!

Share this post


Link to post
Share on other sites

hi, could somebody helpme please, ive installed the contribution as per the instructions but when customers purchase items with the text attributes the order.php file doesnt show the attributes, the only way i can view what has been written is to log in to phpmyadmin and find it via order_text_attributes, i have checked to see if there is something that ive missed but im lost, and im a bit of a noob with php, pls could some one help!!

 

ok well ive sorted that(please dont ask how i have tinkerd and changed that many files im surprized the site still works) but can someone tell me how to get the text attributes to show on the order process email????

Edited by mrengland79

Share this post


Link to post
Share on other sites

I'm in the same boat as: mrengland79.

 

I have almost everything working with this addon. I am using OSC 2.3.3 and I also can't get the text attributes to come through in the order email, or the invoice. Any suggestions would be helpful. Thanks.

Share this post


Link to post
Share on other sites

Okay. So I was successful in getting it to email me the order with the text attributes. Here is the code I used around line 246 in my checkout_process.php:

 

 

// denuz_arun text attr

 

$pid = @mysql_result(tep_db_query("select products_id from products_description where products_name='" . tep_db_input($order->products[$i]['name']) . "'"), 0, "products_id");

$denux_arunQry = "select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $insert_id.

//$HTTP_GET_VARS['oID'] .

" and ota.products_id = " . $pid . " and pta.products_text_attributes_id = ota.products_text_attributes_id";

//echo ;

$attr_q = tep_db_query($denux_arunQry); $denux_arun_ ='';

while ($attr = tep_db_fetch_array($attr_q)) {

$denux_arun_ .= $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text'])."\n";

}

 

// eof denuz_arun text attr

//------insert customer choosen option eof ----

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n". $denux_arun_ . "\n";

}

 

Although next, I have to work on the orders.php and the invoice.php and get the text attribute to show there. If anyone has done this successfully, please send me your code. Thanks.

Share this post


Link to post
Share on other sites

Okay. This code is what worked for me. I used this same code in orders.php, invoice.php and packingslip.php. My text shows in all of them.

 

 

// denuz text attr

 

$pid = @mysql_result(tep_db_query("select products_id from products_description where products_name='" . tep_db_input($order->products[$i]['name']) . "'"), 0, "products_id");

$attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = " . $pid . " and pta.products_text_attributes_id = ota.products_text_attributes_id");

while ($attr = tep_db_fetch_array($attr_q)) {

echo '<br><nobr><small> <i> - ' . $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text']);

echo '</i></small></nobr>';

}

 

// eof denuz text attr

Share this post


Link to post
Share on other sites

Hi!

Can anyone tell me how I can get this add-onn to work with more than 1 language?

I am assuming that I would have to make some changes to the catalog/admin/text_attributes.php...?? Any idea what those changes should be?

Share this post


Link to post
Share on other sites

Would anyone know why I have a problem with the text attributes category appearance in the admin? It looks like this BOX_CATALOG_CATEGORIES_TEXT_ATTRIBUTES instead of Text Attributes

Share this post


Link to post
Share on other sites

Capital letters like that usually mean a definition is missing. Search the addon for BOX_CATALOG_CATEGORIES_TEXT_ATTRIBUTES and thenmake sure your files on the server have whatever changes are mentioned.

Share this post


Link to post
Share on other sites

Couldn't this register the cookie of the first session and then user login/create account/logout and login again as the session id is recreated at least could get the attributes from the cookie which was the first session?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×