Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

beta release extra questions


nana

Recommended Posts

i wanted to thank cczernia for writing and posting the documentation

also it seems that i forgotten two things these changes should resolve all outstanding issues

1-in checkout_confirmation.php i have not included the red line

//extra questions start

if (ASK_QUESTION == 'true') {

$display_answer = 1;

 

require('display_answer_after_order.php');

}

//extra questions end

 

hello, pause for a moment...i'm getting confused, in checkout_confirmation.php it was using this code is it:

//extra questions start

if (QUESTION_LOCATION == 'orders') require('display_answer_after_order.php');

//extra questions end

 

but why it become:

if (ASK_QUESTION == 'true') {

$display_answer = 1;

 

require('display_answer_after_order.php');

}

//extra questions end

 

in nana explanation...have i be missing something here?? plz help. which file must be rename?

 

when i add:

</tr><?php if (ASK_QUESTION == 'true') require('display_answer_box.php'); ?>

 

what comes up is only

FIRST_TITLE

 

any suggestion?

 

or if possible someone to explaned me step by step:

what i have done is:

add an extra question in customer create account..

 

and what i want is:

to display the value/answer from the customer in /admin/customer.php

 

thx for your support..

Link to comment
Share on other sites

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

trying to solve two seperate problems

 

i made a new file that i posted above to disply the result in the admin section just add the new file in the admin section and include it in the

admin/invoice.php or

admin/orders.php or

admin/packingslip.php

 

this will display the answers in the admin section of the shop

 

 

also to display the answers in the checkout confirmation you must change

 

 if (ASK_QUESTION == 'true') require('display_answer_box.php');

to

//extra questions start
if (ASK_QUESTION == 'true') {
$display_answer = 1;

require('display_answer_after_order.php');
}
//extra questions end

this will display the answer in checkout confirmation it adds $display_answer = 1;

this line was missing and it would not always show the answers there

i hope i made it clear

Link to comment
Share on other sites

hey...

 

i can't do it...i seem not to know where is my error...hope someone can help me with this. when i put:

//extra questions start

if (ASK_QUESTION == 'true') {

$display_answer = 1;

 

require('display_answer_after_order.php');

}

//extra questions end

 

to display the answer...what came out was only this :FIRST_TITLE

 

what i understand is is able to fetch the title from : display_answer_after_order.php

 

but i can't get it why it wont fetch the answer ... need help on this please.. can YM me at [email protected]

 

thx a lot

Link to comment
Share on other sites

I'm sure this isn't a problem with the Extra Questions contribution, since it seems to work great for everyone else, but I'm hoping you can help me with an issue I'm having.

 

I followed the installation instructions, but I'm afraid I may not have dealt with the SQL database updates correctly. On the "Create Account" page, where my first question should appear, I get this error:

 

HEADING_EXTRA_QUESTIONS

1146 - Table 'dan735_osc1.TABLE_QUESTIONS' doesn't exist

 

select sources_id, sources_name from TABLE_QUESTIONS where question_number =1 order by sources_name

 

[TEP STOP]

 

 

There is a "questions" table listed in the top level of my SQL osc1 database -- is it in the wrong place? I'm a total n00b, so any help you can give would be appreciated!

 

Thanks in advance.

Link to comment
Share on other sites

First of all, thanks for a great contribution! It's really handy. :thumbsup:

 

You can pretty much stick this line:

 

 <?php if (ASK_QUESTION == 'true')  require('display_answer_box.php'); ?>

 

in admin to display the answers. It was made for orders, invoice and packing slip but it might work for customers. I imagine this would be useful if you are asking questions in create account.

 

Unfortunatelly it's not that simple to include the answers in customers.php. I'm not a coder, so I don't know how to do that. Could any of you guys shed a light here and help with this issue? It would be very handy to have the answers showing on customers.php, since one can use that for important extra info, like drivers license, for instance.

 

Thank you in advance.

:)

Patty

Link to comment
Share on other sites

I'm also having the same problem as described below. Answers won't show on confirmation check out or after that on customer's account. The questions are there, but the answers are blank. This is only on the customer's side. Admin seems to be OK.

 

Can somebody help, please??? Thanks! :)

 

hey...

 

i can't do it...i seem not to know where is my error...hope someone can help me with this. when i put:

//extra questions start

if (ASK_QUESTION == 'true') {

$display_answer = 1;

 

require('display_answer_after_order.php');

}

//extra questions end

 

to display the answer...what came out was only this :FIRST_TITLE

 

what i understand is is able to fetch the title from : display_answer_after_order.php

 

but i can't get it why it wont fetch the answer ... need help on this please.. can YM me at [email protected]

 

thx a lot

Patty

Link to comment
Share on other sites

First of all, thanks for a great contribution! It's really handy. :thumbsup:

Unfortunatelly it's not that simple to include the answers in customers.php. I'm not a coder, so I don't know how to do that. Could any of you guys shed a light here and help with this issue? It would be very handy to have the answers showing on customers.php, since one can use that for important extra info, like drivers license, for instance.

 

Thank you in advance.

:)

 

Ok, it seems to work in certain places. I replaced this:

 

<?php
 if ($action == 'edit' || $action == 'update') {
$newsletter_array = array(array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES),
						  array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO));
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

with this and it worked in customers.php:

 

<?php
 if ($action == 'edit' || $action == 'update') {
$newsletter_array = array(array('id' => '1', 'text' => ENTRY_NEWSLETTER_YES),
						  array('id' => '0', 'text' => ENTRY_NEWSLETTER_NO));
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	 <tr>
			<td>
			<?php 
			//extra questions start 11/04/05
			if (ASK_QUESTION == 'true')  require('display_answer_box.php');
			//extra questions end 11/04/05
			?>
			</td>
		  </tr>
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

Shade and Sweet Water

Chris Czerniak

Link to comment
Share on other sites

Tks, Frank. :)

 

Like in the confirmation check out, only the questions appear, not the answers. It works fine on orders, invoices and pack lists though.

 

I think it would be a good idea to have them editable by admin on customers and also by the client on My account. Anyway, it's a great contribution. Thanks for sharing with us. :)

Edited by Patty

Patty

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

the contribution was easy to install, but I have the problem that it do not saves the answers.

 

I added the question into

 

orders.

 

The questions are shown correctly.

 

Perhaps a hint where I cn search ?

 

I get no errors.

 

Best regards

 

Niels

Link to comment
Share on other sites

I'm having weird issues upon trying to install this contribution.. this is the error I'm seeing: (when I hit checkout_process.php)

 

Fatal error: main(): Failed opening required 'email_box.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/domain.com/httpdocs/member/checkout_process.php on line 242

 

I've searched all over for an "email_box.php" .. but I don't seem to have this file.. and It wasn't included in the .ZIP ?

 

Thanks!

Link to comment
Share on other sites

this is the code for email

<?php
if (QUESTION_LOCATION == 'orders'){$locID= $insert_id;
}else{
$locID=$customers_id;
}
$extra_questions_query = tep_db_query("select first_answer,second_answer,third_answer, fourth_answer,fifth_answer from " . TABLE_ANSWERS . " where location_id = '" . $locID . "'and location='" .QUESTION_LOCATION . "'" );
$extra_questions = tep_db_fetch_array($extra_questions_query);


 if (DISPLAY_FIRST_QUESTION == 'true') {
	$email_order .= $extra_questions['first_answer'] . "\n";

}
 if (DISPLAY_SECOND_QUESTION == 'true') {
	$email_order .= $extra_questions['second_answer'] . "\n";

 }
 if (DISPLAY_THIRD_QUESTION == 'true')  {
	$email_order .= $extra_questions['third_answer'] . "\n";

 }
 if (DISPLAY_FOURTH_QUESTION == 'true') {
	$email_order .=  $extra_questions['fourth_answer'] . "\n";

 }
 if (DISPLAY_FIFTH_QUESTION == 'true')  {
	$email_order .= $extra_questions['fifth_answer'] . "\n";

}
?>

i have been very busy but i have completed the boxes for updating the answers if it is in account i will post it as soon as i do a little testing

Link to comment
Share on other sites

First of all, thanks for a great contribution! It's really handy. :thumbsup:

Unfortunatelly it's not that simple to include the answers in customers.php. I'm not a coder, so I don't know how to do that. Could any of you guys shed a light here and help with this issue? It would be very handy to have the answers showing on customers.php, since one can use that for important extra info, like drivers license, for instance.

 

Thank you in advance.

:)

Link to comment
Share on other sites

Patty,

 

In admin/customers.php find this code:

 

<?php

if ($processed == true) {

if ($cInfo->customers_newsletter == '1') {

echo ENTRY_NEWSLETTER_YES;

} else {

echo ENTRY_NEWSLETTER_NO;

}

echo tep_draw_hidden_field('customers_newsletter');

} else {

echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));

}

?></td>

</tr>

</table></td>

</tr>

 

Add this code after:

 

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>

</tr>

<tr>

<td class="formAreaTitle"><?php echo Questions; ?></td>

</tr>

<tr>

<td class="formArea"><table border="0" cellspacing="2" cellpadding="2">

<?php

//extra questions start

if (ASK_QUESTION == 'true') {$display_answer = 1; require('display_answer_box.php');}

//extra questions end

?>

</table>

</tr>

 

This should do it for you.

Link to comment
Share on other sites

  • 3 weeks later...

Having some fun and learning with this one!

 

Installed the version 1.5 of this contribution, added the following code (to line 20)as per the doccumentation to "packingslip.php" :

 

//extra questions start

if (ASK_QUESTION == 'true') require('display_answer_box.php');

//extra questions end

 

when I run thru an order< I get the following error message on the packing slip:

 

Warning: main(display_answer_box.php): failed to open stream: No such file or directory in /u/m/mymoka/www.missyoucanada.ca/admin/packingslip.php on line 120

 

Fatal error: main(): Failed opening required 'display_answer_box.php' (include_path='.:') in /u/m/mymoka/www.missyoucanada.ca/admin/packingslip.php on line 120

 

 

Any ideas as to what the problem could be?

 

Any help would be appreciated!

 

S McD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...