Latest News: (loading..)
NimaP

One Page Checkout Support

2,293 posts in this topic

Sophia you can also try bottom method in checkout.php and alter a bit to your discount coupons

 

or try this in catalog/includes/boxes/coupon_payment.php

find

 tep_hide_session_id() . '<br>');

change to

 tep_hide_session_id() . '<br></form>');

 

now in checkout.php find line that begins with

<td width="100%" valign="top">

change to

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

				   <tr>

			<td class="main"><b><?php echo TEXT_COUPON_HEADING; ?></b></td>

			  </tr>

		<tr>

			<td><?php require(DIR_WS_INCLUDES . 'boxes/coupon_payment.php'); ?></td>

			  </tr>

		</table>

 

That will have the coupon box at the top of the checkout page before the products in cart, layout should remain the same if not play around abit

 

Thanks for the help you are giving. I already have coupons working without the one page checkout. The coupon field is located in my checkout_payment.php file after the comment section. I copied and pasted it to the chekout.php file as you instructed but it did not work. Here is the code that was placed into the file for the coupon:

<?php

/* kgt - discount coupons */

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_COUPON; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><?php echo ENTRY_DISCOUNT_COUPON.' '.tep_draw_input_field('coupon', '', 'size="32"'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<?php

}

/* end kgt - discount coupons */

?>

Share this post


Link to post
Share on other sites

Having another issue: My chekout.php page is not secured. Any idea why it is not sent to the secure page as login.php or checkout_payment.php?

Share this post


Link to post
Share on other sites

I think I need to make some changes to this code in checkout.php and I tried but the discount was not applied to the total nor was the discount info shown in the total. How do I modify this code to include my coupon? This code is about line 1362 of catalog/checkout.php

 

<td class="main" width="50%" align="left"><?php

if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true'){

echo '<b>Have A Coupon?</b> ' .

tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' .

tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');

}

?></td>

 

 

I need to add the coupon code I mentioned in the post above.

 

Thanks.

Share this post


Link to post
Share on other sites
I think I need to make some changes to this code in checkout.php and I tried but the discount was not applied to the total nor was the discount info shown in the total. How do I modify this code to include my coupon? This code is about line 1362 of catalog/checkout.php

 

<td class="main" width="50%" align="left"><?php

if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true'){

echo '<b>Have A Coupon?</b> ' .

tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' .

tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');

}

?></td>

 

 

I need to add the coupon code I mentioned in the post above.

 

Thanks.

post your coupon code here

 

or in includes/coulmn_right.php find

  require(DIR_WS_BOXES . 'shopping_cart.php');

add after it

 require(DIR_WS_BOXES . 'discount_coupon.php');

now create a file in includes/boxes/ folder named discount_coupon.php, can simply copy an existing box and rename it

now place code below into discount_coupon.php changing the coupon part with your coupon code

<?php

/*
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
*/
 if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true'){
?>
<!-- coupons -->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Coupon');
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();

  $info_box_contents[] = array('align' => 'center', 'text' => 'Have a Coupon');
  $info_box_contents[] = array( 'form' => tep_draw_form('coupon', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'post'),
							   'align' => 'center',
								'text' => tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"' . '</form>'));

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- coupons  eof //-->
<?php
 }
?>

 

code to change to add your coupon code in above is

tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"'

Edited by steve_s

Share this post


Link to post
Share on other sites
code to change to add your coupon code in above is

tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"'

 

I thought I already posted this but dont see it here. My apologies if the server delayed and two post are shown.

 

Thanks for all your help so far Steve!

 

I do not know what to put on the second line because there was no reference to a submit button that I can find. As mentioned before the coupon code was inputted on the checkout_payment.php page then when the customer clicks continue the amounts were adjusted on the next page.

 

At the moment I am unable to submit the coupon and there is also the character ">" showing right after the redeem button/gif image.

 

Her is the code for my discount_coupon.php file in includes/boxes

 

<?php

/*
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
*/
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
?>
<!-- coupons -->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Coupon');
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();

  $info_box_contents[] = array('align' => 'center', 'text' => 'Have a Coupon');
  $info_box_contents[] = array( 'form' => tep_draw_form('coupon', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'post'),

							   'align' => 'center',
								'text' => tep_draw_input_field('coupon', '', 'size="12"') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"' . '</form>'));

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- coupons  eof //-->
<?php
 }
?>

Share this post


Link to post
Share on other sites
I thought I already posted this but dont see it here. My apologies if the server delayed and two post are shown.

 

Thanks for all your help so far Steve!

 

I do not know what to put on the second line because there was no reference to a submit button that I can find. As mentioned before the coupon code was inputted on the checkout_payment.php page then when the customer clicks continue the amounts were adjusted on the next page.

 

At the moment I am unable to submit the coupon and there is also the character ">" showing right after the redeem button/gif image.

 

Her is the code for my discount_coupon.php file in includes/boxes

 

<?php

/*
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
*/
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
?>
<!-- coupons -->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Coupon');
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();

  $info_box_contents[] = array('align' => 'center', 'text' => 'Have a Coupon');
  $info_box_contents[] = array( 'form' => tep_draw_form('coupon', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'post'),

							   'align' => 'center',
								'text' => tep_draw_input_field('coupon', '', 'size="12"') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"' . '</form>'));

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- coupons  eof //-->
<?php
 }
?>

can you paste link here to contribution and what version you are using so i can look into this more for you

Share this post


Link to post
Share on other sites
I thought I already posted this but dont see it here. My apologies if the server delayed and two post are shown.

 

Thanks for all your help so far Steve!

 

I do not know what to put on the second line because there was no reference to a submit button that I can find. As mentioned before the coupon code was inputted on the checkout_payment.php page then when the customer clicks continue the amounts were adjusted on the next page.

 

At the moment I am unable to submit the coupon and there is also the character ">" showing right after the redeem button/gif image.

 

Her is the code for my discount_coupon.php file in includes/boxes

 

<?php

/*
 Copyright (c) 2006 osCommerce
 Released under the GNU General Public License
*/
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
?>
<!-- coupons -->
	  <tr>
		<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Coupon');
new infoBoxHeading($info_box_contents, false, false);
$info_box_contents = array();

  $info_box_contents[] = array('align' => 'center', 'text' => 'Have a Coupon');
  $info_box_contents[] = array( 'form' => tep_draw_form('coupon', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'post'),

							   'align' => 'center',
								'text' => tep_draw_input_field('coupon', '', 'size="12"') . ' ' .
				tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"' . '</form>'));

new infoBox($info_box_contents);
?>
		</td>
	  </tr>
<!-- coupons  eof //-->
<?php
 }
?>

having looked at your code in another post, i cant see why its not working what version of one page checkout are you using, cause im sure i saw in one version you had to uncomment some code out

Share this post


Link to post
Share on other sites
can you paste link here to contribution and what version you are using so i can look into this more for you

 

Thanks again Steve.

 

I am using one page checkout v 1.03 and version 3.33 of Discount Coupon Code I just reinstalled onepage checkout v 1.03 and added this code to checkout.php to insert the coupon field:

 

<?php
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<b>Have A Coupon?</b> ' .
			 tep_draw_input_field('coupon', '', 'size="12"', 'redeem code') . ' ' .
			 tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');
	}
   ?>

 

Again I am unsure how to change the line that reads tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"')

 

When I hit submit I now get this error:

 

Fatal error: Call to a member function on a non-object in /.../database/www/public/catalog/includes/classes/onepage_checkout.php on line 550

 

Here is what's on line 550 in the file mentioned:

$GLOBALS[$_SESSION['payment']]->pre_confirmation_check();

 

 

having looked at your code in another post, i cant see why its not working what version of one page checkout are you using, cause im sure i saw in one version you had to uncomment some code out

 

Sorry, I dont remember uncommenting out anything.

Share this post


Link to post
Share on other sites
Sorry, I dont remember uncommenting out anything.

 

Perhaps you are referring to the first version of onepagecheckout where we had to comment out the code for CCGV if we didn't have it as it was causing an error. Other than that I have no recollection of anything else.

Share this post


Link to post
Share on other sites

I get this Fatal error: Call to a member function pre_confirmation_check() on a non-object in /home/d23038/public_html/includes/classes/onepage_checkout.php on line 611

What can I do?

Share this post


Link to post
Share on other sites
I get this Fatal error: Call to a member function pre_confirmation_check() on a non-object in /home/d23038/public_html/includes/classes/onepage_checkout.php on line 611

What can I do?

 

Are you using sts, cause it seems some java has not been called, or your passing something it doesnt recognise

Share this post


Link to post
Share on other sites
Thanks again Steve.

 

I am using one page checkout v 1.03 and version 3.33 of Discount Coupon Code I just reinstalled onepage checkout v 1.03 and added this code to checkout.php to insert the coupon field:

 

<?php
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<b>Have A Coupon?</b> ' .
			 tep_draw_input_field('coupon', '', 'size="12"', 'redeem code') . ' ' .
			 tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');
	}
   ?>

 

Again I am unsure how to change the line that reads tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"')

 

When I hit submit I now get this error:

 

Fatal error: Call to a member function on a non-object in /.../database/www/public/catalog/includes/classes/onepage_checkout.php on line 550

 

Here is what's on line 550 in the file mentioned:

$GLOBALS[$_SESSION['payment']]->pre_confirmation_check();

 

 

 

 

Sorry, I dont remember uncommenting out anything.

code is very similiar code in one page checkout

	   if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true'){
		echo '<b>Have A Coupon?</b> ' . 
			 tep_draw_input_field('gv_redeem_code', 'redeem code') . ' ' . 
			 tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');
	}

 

your code

<?php
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<b>Have A Coupon?</b> ' .
			 tep_draw_input_field('coupon', '', 'size="12"', 'redeem code') . ' ' .
			 tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');
	}
   ?>

try using one page checkout code and remove this

   if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true'){

}

 

i will look at contribution later and see if you add any code else where like checkout_confirmation.php

Edited by steve_s

Share this post


Link to post
Share on other sites
Thanks again Steve.

 

I am using one page checkout v 1.03 and version 3.33 of Discount Coupon Code I just reinstalled onepage checkout v 1.03 and added this code to checkout.php to insert the coupon field:

 

<?php
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<b>Have A Coupon?</b> ' .
			 tep_draw_input_field('coupon', '', 'size="12"', 'redeem code') . ' ' .
			 tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"');
	}
   ?>

 

Again I am unsure how to change the line that reads tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeem"')

 

When I hit submit I now get this error:

 

Fatal error: Call to a member function on a non-object in /.../database/www/public/catalog/includes/classes/onepage_checkout.php on line 550

 

Here is what's on line 550 in the file mentioned:

$GLOBALS[$_SESSION['payment']]->pre_confirmation_check();

 

 

 

 

Sorry, I dont remember uncommenting out anything.

 

Having looked at your discount code it seems fairly straight forward in /includes/classes/onepage_checkout.php is code for coupons

 function redeemCoupon($code){
	  $error = false;
	  if ($code) {
		  // get some info from the coupon table
		  $coupon_query = tep_db_query("select coupon_id, coupon_amount, coupon_type, coupon_minimum_order,uses_per_coupon, uses_per_user, restrict_to_products,restrict_to_categories from " . TABLE_COUPONS . " where coupon_code='".$code."' and coupon_active='Y'");
		  $coupon_result = tep_db_fetch_array($coupon_query);

		  if ($coupon_result['coupon_type'] != 'G') {
			  if (tep_db_num_rows($coupon_query) == 0) {
				  $error = true;
				  $errMsg = ERROR_NO_INVALID_REDEEM_COUPON;
			  }

			  $date_query = tep_db_query("select coupon_start_date from " . TABLE_COUPONS . " where coupon_start_date <= now() and coupon_code='".$code."'");
			  if (tep_db_num_rows($date_query) == 0) {
				  $error = true;
				  $errMsg = ERROR_INVALID_STARTDATE_COUPON;
			  }

			  $date_query = tep_db_query("select coupon_expire_date from " . TABLE_COUPONS . " where coupon_expire_date >= now() and coupon_code='".$code."'");
			  if (tep_db_num_rows($date_query) == 0) {
				  $error = true;
				  $errMsg = ERROR_INVALID_FINISDATE_COUPON;
			  }

			  $coupon_count = tep_db_query("select coupon_id from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon_result['coupon_id']."'");
			  $coupon_count_customer = tep_db_query("select coupon_id from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon_result['coupon_id']."' and customer_id = '" . $_SESSION['customer_id'] . "'");
			  if (tep_db_num_rows($coupon_count) >= $coupon_result['uses_per_coupon'] && $coupon_result['uses_per_coupon'] > 0) {
				  $error = true;
				  $errMsg = ERROR_INVALID_USES_COUPON . $coupon_result['uses_per_coupon'] . TIMES;
			  }

			  if (tep_db_num_rows($coupon_count_customer) >= $coupon_result['uses_per_user'] && $coupon_result['uses_per_user'] > 0) {
				  $error = true;
				  $errMsg = ERROR_INVALID_USES_USER_COUPON . $coupon_result['uses_per_user'] . TIMES;
			  }

			  if ($error === false){
				  global $order_total_modules;
				  $_SESSION['cc_id'] = $coupon_result['coupon_id'];
				  $order_total_modules->pre_confirmation_check();

				  return '{
					  success: true
				  }';
			  }
		  }
	  }
	  return '{
		  success: false
	  }';
  }

I think this will be need to be replaced with your code from includes/classes/discount_coupon.php or at least some of it

 

I would suggest contacting a freelance php coder to do this for you should cost no more than $40 i can give you an email of one if you would like

Edited by steve_s

Share this post


Link to post
Share on other sites
I am getting this error when using IE7 also, Firefox has no errors.

 

Fatal error: Call to a member function pre_confirmation_check()

 

Also noted, on IE7 javascript does not work at all for this page. IE7 indicates a JS error at line 0 in file /includes/checkout/checkout.js file. Researching.

 

Otherwise, awesome contribution.

 

-------------UPDATE-----------------

Problem located in /includes/checkout/checkout.js file

I commented out the following section at the beginning of the file (why is there php work in a js file?)

 

<?php // Start - CREDIT CLASS Gift Voucher Contribution ?>

 

var submitter = null;

 

function submitFunction() {

 

submitter = 1;

 

}

 

<?php // End - CREDIT CLASS Gift Voucher Contribution ?>

 

IE7 now fully functional!

 

thank you. that fixed it. will continue to test the contribution.

Share this post


Link to post
Share on other sites
I would suggest contacting a freelance php coder to do this for you should cost no more than $40 i can give you an email of one if you would like

 

Hi Steve, Thanks again for the help. I will play around with the code next week and if it doesnt work then will use the freelancer but need to solve another problem where my update button does not work when I attempt to change quantity amount of a product in the shopping cart section of the onepage (on top).

Please send me the email address re the discount problem.

 

Thanks again,

Sophia

Share this post


Link to post
Share on other sites
Hi Steve, Thanks again for the help. I will play around with the code next week and if it doesnt work then will use the freelancer but need to solve another problem where my update button does not work when I attempt to change quantity amount of a product in the shopping cart section of the onepage (on top).

Please send me the email address re the discount problem.

 

Thanks again,

Sophia

email sent to you use firefox to alter qty and check in tools error console to see if you are getting any error

Share this post


Link to post
Share on other sites
I get this Fatal error: Call to a member function pre_confirmation_check() on a non-object in /home/d23038/public_html/includes/classes/onepage_checkout.php on line 611

What can I do?

 

got this solved. please see recent posts above.

Share this post


Link to post
Share on other sites

1 - If I quantities of product that the price is 1.00 in 1700 left him.

2 - Do not see the choice of shipping.

3 - Not cool selection to select the sending state.

4 - When the log tells me that the cart is empty.

 

Buy the One Page Checkout Dynamo, is doing well but has some flaws, I think perhaps merging the two would be a prefect.

 

If the creator of this module you want to upload it anywhere.

 

Sorry for my English.

Share this post


Link to post
Share on other sites

Almost all fixed.

 

Only thing that I put the module sppc and does not work either because the user does not register.

 

Please put as it should.

 

Thank you very much.

Share this post


Link to post
Share on other sites

Hi all,

 

I've got some fantastic news for those of you using STS (Simple Template System contribution - I'm using v4.5.8) ...

 

I was desperate to get this contribution working due to a number of bailed carts at login.php and I spent a couple of days scratching my head, but eventually gave up. Instead, I hired a PHP/Javascript developer to look at the issue. The community has given me all the contributions I've ever needed, so I thought it was time to give something back. Here's the fix:

 

  • Firstly, I created an includes/sts_templates/xxxxx/checkout.php.html template file (obviously xxxxx is your template folder). I simply used a copy of my sts_default.html file and renamed it. I then added the following within the <head> tag as recommended by tokyoguy :

<link rel="stylesheet" type="text/css" href="ext/jQuery/themes/smoothness/ui.all.css">

 

  • Then the developer stepped in and found that in the shopping cart Javscript file (includes/checkout/checkout.js) there were php tags, which were simply comments like <?php //this is a comment?> and so entirely unnecessary. IE was bombing out at this point, whereas other browsers ignored them. However, they can simply be removed.

  • For those who are using the "Pay by check (or cheque in English)/cash" payment method, the tep_validate() function was being declared twice. It was being declared in checkout_success.php and in application_top.php. To get around this, within checkout_success.php, find and modify the declaration around line 24 as follows:

require_once('includes/functions/password_funcs.php');

 

  • UK shops may also have a problem with the £ (UK pound) symbol. To correct this, change the encoding within english.php to UTF-8, then within the admin panel, change the £ (UK pound) and Euro symbols to their UTF-8 decimal equivalents (Google this if needed).

 

Enjoy guys. I've already had several successful sales go through the new checkout and nobody has bailed at this screen so far.

 

Cheers

Share this post


Link to post
Share on other sites

the only thing i am missing to make it perfect is an "if statement" for users who have javascript disabled, so they can checkout out "old-style"

 

anyone know how to fix that?

Share this post


Link to post
Share on other sites
the only thing i am missing to make it perfect is an "if statement" for users who have javascript disabled, so they can checkout out "old-style"

 

anyone know how to fix that?

you could try this it seems to work

in

catalog/checkout_shipping.php

catalog/checkout_payment.php

catalog/checkout_confirmation.php

 

find

require('includes/application_top.php');

 

add after it

?>
<noscript><?php define(NO_JAVA, 'True'); ?> </noscript>
<?php

 

change

if (ONEPAGE_CHECKOUT_ENABLED == 'True') {

 

to

  if ((ONEPAGE_CHECKOUT_ENABLED == 'True') && (NO_JAVA !='True')) {

Edited by steve_s

Share this post


Link to post
Share on other sites

After testing it throughly it doesnt work sorry but something along them lines

Share this post


Link to post
Share on other sites

If your using 1.04 version and get an error on create account with one page checkout if your not using CCGV

in includes/classes/onepage_checkout.php

 

find

			 //Start - CREDIT CLASS Gift Voucher Contribution
		  if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
			  $coupon_code = create_coupon_code();
			  tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
			  $insert_id = tep_db_insert_id();
			  tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $customer['customers_email_address'] . "', now() )");

			  $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "\n\n" .
							 sprintf(EMAIL_GV_REDEEM, $coupon_code) . "\n\n" .
							 EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code,'NONSSL', false) . "\n\n";
		  }

		  if (NEW_SIGNUP_DISCOUNT_COUPON != '') {
			  $coupon_code = NEW_SIGNUP_DISCOUNT_COUPON;
			  $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_code . "'");
			  $coupon = tep_db_fetch_array($coupon_query);
			  $coupon_id = $coupon['coupon_id'];		
			  $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . (int)$languages_id . "'");
			  $coupon_desc = tep_db_fetch_array($coupon_desc_query);
			  $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $customer['customers_email_address'] . "', now() )");
			  $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .  "\n" .
							 sprintf("%s", $coupon_desc['coupon_description']) ."\n\n" .
							 sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "\n\n" . "\n\n";
		  }
		 // End - CREDIT CLASS Gift Voucher Contribution

 

replace with

			  /* Start - CREDIT CLASS Gift Voucher Contribution
		  if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {
			  $coupon_code = create_coupon_code();
			  tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");
			  $insert_id = tep_db_insert_id();
			  tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $customer['customers_email_address'] . "', now() )");

			  $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "\n\n" .
							 sprintf(EMAIL_GV_REDEEM, $coupon_code) . "\n\n" .
							 EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code,'NONSSL', false) . "\n\n";
		  }

		  if (NEW_SIGNUP_DISCOUNT_COUPON != '') {
			  $coupon_code = NEW_SIGNUP_DISCOUNT_COUPON;
			  $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_code . "'");
			  $coupon = tep_db_fetch_array($coupon_query);
			  $coupon_id = $coupon['coupon_id'];		
			  $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . (int)$languages_id . "'");
			  $coupon_desc = tep_db_fetch_array($coupon_desc_query);
			  $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $customer['customers_email_address'] . "', now() )");
			  $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .  "\n" .
							 sprintf("%s", $coupon_desc['coupon_description']) ."\n\n" .
							 sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "\n\n" . "\n\n";
		  }
		  End - CREDIT CLASS Gift Voucher Contribution */

Share this post


Link to post
Share on other sites

For all you guys who are getting the "function pre_confirmation_check()" error, see my previous post in this thread. I too was getting this error until the developer stepped in and sorted it out.

 

Cheers

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