Latest News: (loading..)
alenkij

Imprint Text Options

332 posts in this topic

Hi Jack and ecommers,

 

I have a unique situation with this contrib.

 

(On an existing Invoice with a items "products_model" over 12 characters) ps. the db is set for 20 chars

Product XYZ model_XYZ123456

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and pta.products_text_attributes_id = ota.products_text_attributes_id' at line 1

 

select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = 12370 and ota.products_id = and pta.products_text_attributes_id = ota.products_text_attributes_id

 

[TEP STOP]

 

All other functions work great, all invoices, packing lists load except on long(er) than 12 model numbered items.

 

Hope there's an answer, I like the contrib :)

Many Pre-Thanks, KJ

 

-------

UPDATE

-------

 

It's something in the admin/orders.php i believe?

I backed up the copy and went back to it and i don't get the error.

Edited by Top_Speed

Share this post


Link to post
Share on other sites

I have a unique situation with this contrib.

 

(On an existing Invoice with a items "products_model" over 12 characters) ps. the db is set for 20 chars

Product XYZ model_XYZ123456

 

All other functions work great, all invoices, packing lists load except on long(er) than 12 model numbered items.

Hi KJ. Hadn't seen you around for awhile - glad to see you're still here. :)

 

As for that problem, there's nothing in the code that limits the size and there isn't a field for it in the database changes. Are you sure you changed the model number size in the orders_products table? This is often missed when the model number size is changed.

Share this post


Link to post
Share on other sites

Hi Jack, yep been a long time... still going strong, i try to keep the airwaves clear for those in need of yours and others excellent help & responses. Good to see your still here!!

 

Your spot on (as usual). The orders_products wasn't updated (been this way for years! lol). I guess this contrib changed how it reads from the db on orders model#. THe long sku's were chopped off and this is what caused the 1064's. I now can go back and edit the invoice to add on the longer sku and the old invoices are fine. The new invoices are already correct thanks to YOU!!

 

Great work, hope things r going well w/ you and you family!

TC,

 

-KJ

Share this post


Link to post
Share on other sites

Hey Jack

 

I have not asked you questions for awhile lol hehe...hope you are doing well.

 

Your posts are always very helpful, the inputting fields on product info page were not showing and I followed suggestion you gave to other ppl that use contribution's stock product_info.php to check if its the problem in this file or application_top.php.....then I found I mistakenly (heavy modded store, guide for product_info page is not precise against my store) put the additional code of this contribution within <table> that is for product attributes in product_info.php ;) Now I have moved it out of that table and everything is working fine.

 

Also you mentioned there is no database entry to limit number of characters in the field, and you would not be able to advice on it. The thing is, this contribution said all inputted texts are store in database, there must be a table to contain those info so can I find those database tables and insert different value into each table to limit the number of characters been entered? Or say DROP those info table and CREATE same tables again but with extra value that will limit how many characters can be inputted?

 

 

Thanks

Share this post


Link to post
Share on other sites

Also you mentioned there is no database entry to limit number of characters in the field, and you would not be able to advice on it. The thing is, this contribution said all inputted texts are store in database, there must be a table to contain those info so can I find those database tables and insert different value into each table to limit the number of characters been entered? Or say DROP those info table and CREATE same tables again but with extra value that will limit how many characters can be inputted?

I don't recall that conversation but I'm guessing I was talking about in the code. You can change the size of the fields in the database to limit the input but that would no stop someone from entering a longer string unless the code was changed too. The longer text entered would just be truncated so the customer would be confused since what they entered didn't match what is shown. So the correct way to do it would be to change the code to limit the input.

Share this post


Link to post
Share on other sites

Hello,

The customer input attributes are not appearing in the shopping cart. Could there be something causing a problem with this section of code(shopping_cart.php)?

	  // denuz text attr
    $b = strpos($products[$i]['id'], '{');
    if ($b === false) {
      $pid = $products[$i]['id'];
    } else {
      $pid = substr($products[$i]['id'], 0, $B);
    }
    $attr_q = tep_db_query("select cbta.*, pta.products_text_attributes_name from customers_basket_text_attributes as cbta, products_text_attributes as pta where cbta.products_text_attributes_id = pta.products_text_attributes_id and cbta.products_id = " . $pid . " and cbta.session_id = '" . $osCsid . "'");
    while ($attr = tep_db_fetch_array($attr_q)) {
         $products_name .= '<br><small><i> - ' . $attr['products_text_attributes_name'] . ' ' . stripslashes($attr['products_text_attributes_text'])  . '</i></small>';       
    }
// eof denuz text attr

Share this post


Link to post
Share on other sites

Nevermind, I had the second part of the manual install in the wrong place in application_top.php

Share this post


Link to post
Share on other sites

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

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