Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

KGT -

My header.php doesn't have any of this code, so the people that built it for me must have modified and removed it - would it be possible for you to send me the header.php file you have so I can compare? Or if I can pass mine to you to check it OR if you have a different way I could display the error that doesn't have anything to do with the header.php file.... whatever would be easiest for you!

 

Thanks so much for your time and effort with this contribution and the help on the message board!

 

 

checkout_payment.php should have it's own method of handling errors. You might be okay just changing:

 

if( count( $error_message ) > 0 ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode( implode( ' ', $error_message ) ), 'SSL' ) ); //if there was an error, redirect to the payment page

 

in checkout_confirmation.php around line 114 to:

 

if( count( $error_message ) > 0 ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . urlencode( implode( ' ', $error_message ) ), 'SSL' ) ); //if there was an error, redirect to the payment page

(change 'error_message=' to 'payment_error=')

 

 

Otherwise, you could simply insert the code from the header file right after the payment_error block in checkout_payment.php:

 

<?php
 if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
	  <tr class="infoBoxNoticeContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>


//INSERT CODE FROM HEADER FILE HERE

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

checkout_payment.php should have it's own method of handling errors. You might be okay just changing:

 

if( count( $error_message ) > 0 ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode( implode( ' ', $error_message ) ), 'SSL' ) ); //if there was an error, redirect to the payment page

 

in checkout_confirmation.php around line 114 to:

 

if( count( $error_message ) > 0 ) tep_redirect( tep_href_link( FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . urlencode( implode( ' ', $error_message ) ), 'SSL' ) ); //if there was an error, redirect to the payment page

(change 'error_message=' to 'payment_error=')

Otherwise, you could simply insert the code from the header file right after the payment_error block in checkout_payment.php:

 

<?php
 if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
	  <tr class="infoBoxNoticeContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
//INSERT CODE FROM HEADER FILE HERE

I entered the code from the header file into checkout_payment.php and it worked like a charm! Thanks so much for your help with this - it's a great contribution!!!!

Link to comment
Share on other sites

I installed the discount coupons module and when I go to Catalog > Discount Coupons to enter my coupons I get the following error.

 

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 '-20, 20' at line 1

 

select * from discount_coupons cd order by cd.date_end, date_start limit -20, 20

 

 

Any ideas where I went wrong?

 

Thanks,

Dustin

Link to comment
Share on other sites

I installed the discount coupons module and when I go to Catalog > Discount Coupons to enter my coupons I get the following error.

 

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 '-20, 20' at line 1

 

select * from discount_coupons cd order by cd.date_end, date_start limit -20, 20

 

http://www.oscommerce.com/forums/index.php?sho...3019&st=40#

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

This is the support thread for the Order Total contribution Discount Coupon Codes found here:

 

http://www.oscommerce.com/community/contributions,4269

 

 

I've installed discount coupon, but when I tried to creat a coupon for customers it gave me this error:

 

1136 - Column count doesn't match value count at row 1

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, date_start, date_end, max_use, min_order) values ('30JMM6', 'discount10', '10%', "2006-08-04", "2006-08-30", 1, 0, 10)

 

[TEP STOP]

 

any help is greatly appreciated

Link to comment
Share on other sites

I've installed discount coupon, but when I tried to creat a coupon for customers it gave me this error:

 

1136 - Column count doesn't match value count at row 1

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, date_start, date_end, max_use, min_order) values ('30JMM6', 'discount10', '10%', "2006-08-04", "2006-08-30", 1, 0, 10)

 

[TEP STOP]

 

any help is greatly appreciated

 

Please see the fix posted by crash3903 on June 28. Just make the change he describes.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

This there an easy way to add the % applied for the coupon to the checkout_confirmation.php page?

 

For example, my current checkout page looks like this:

 

Discount Coupon sync806 applied: -$5.36

Sub-Total: $30.39

Federal Express (1 x 3lbs) (Ground Service (1 days)): $4.05

Total: $34.44

 

Is there any way to add the %(in red below) of the coupon to this page like this:

 

Discount Coupon sync806 applied 15%: -$5.36

Sub-Total: $30.39

Federal Express (1 x 3lbs) (Ground Service (1 days)): $4.05

Total: $34.44

 

Thanks,

Dustin

Link to comment
Share on other sites

Is there any way to add the %(in red below) of the coupon to this page like this:

 

Discount Coupon sync806 applied 15%: -$5.36

Sub-Total: $30.39

Federal Express (1 x 3lbs) (Ground Service (1 days)): $4.05

Total: $34.44

 

There's not an easy way to do this right now. It would be nice to be able to configure how you want the line to be displayed though. I will add this for the next version (which will include the ability to use fixed discount amounts).

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

There's not an easy way to do this right now. It would be nice to be able to configure how you want the line to be displayed though. I will add this for the next version (which will include the ability to use fixed discount amounts).

 

Thanks. Love the module.

Link to comment
Share on other sites

I've managed to install this but the option to add a voucher code doesn't appear anywhere in the checkout process. I then get this error when completing a test purchase

 

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/sessions.php on line 67

 

Warning: Cannot modify header information - headers already sent by (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/general.php on line 29

 

Any ideas?

Link to comment
Share on other sites

I'm also getting this error when I go to the Orders section, which I did not get before:

 

 

Parse error: syntax error, unexpected T_IF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/harrison/public_html/admin/includes/classes/order.php on line 298

Link to comment
Share on other sites

I'm desperate for help now. I've sorted the 2nd problem but the first is driving me crazy.

 

There is no option to enter a code anwhere in the checkout process.

 

I don't know whether it is linked but the Discount Coupons section comes in 'Catalog' rather than 'Modules'.

Link to comment
Share on other sites

I've managed to install this but the option to add a voucher code doesn't appear anywhere in the checkout process. I then get this error when completing a test purchase

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/sessions.php on line 67

 

Warning: Cannot modify header information - headers already sent by (output started at /home/harrison/public_html/checkout_process.php:1) in /home/harrison/public_html/includes/functions/general.php on line 29

 

Any ideas?

 

You've probably got a space or a line break before you're openning <?php tag in checkout_process.php.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

I'm also getting this error when I go to the Orders section, which I did not get before:

Parse error: syntax error, unexpected T_IF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/harrison/public_html/admin/includes/classes/order.php on line 298

 

 

We can't tell what the problem is unless you post the code you have.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

I'm desperate for help now. I've sorted the 2nd problem but the first is driving me crazy.

 

There is no option to enter a code anwhere in the checkout process.

 

I don't know whether it is linked but the Discount Coupons section comes in 'Catalog' rather than 'Modules'.

 

Revisit the install instructions, specifically the part that instructs you to edit checkout_payment.php.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Would the fact that I dont have any tax on my items cause a problem with this contrib?

 

I am looking for something that will let me do the following.

 

- Set a discount code that I can give to people that will give them 10% off the final price (before shipping) indeffinately (or for given period of time) (This is not set to a certain person and can be used as many times as they want and by as many people that want to use it.)

 

- Create gift vouchers that can be given to people (2 differnent types if possible)

- for a specific person

- NOT for a specific person

These can either have a time limit on them or not.

 

Will this contrib be able to do the above?

Edited by DeadDingo
Link to comment
Share on other sites

This is going be great if I can get it working. I am having a problem with generation of the coupon.

 

I am getting this code.

 

1136 - Column count doesn't match value count at row 1

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, date_start, date_end, max_use, min_order) values ('WET0L', 'testing', '.10', "0010-06-08", "0020-06-08", 0, 0, 0)

 

[TEP STOP]

 

And I do not know what to do with this now.

 

Any help would great.

Thanks Troy

Link to comment
Share on other sites

Dear,

 

I have installed this contribution, but still there is one thing that doesn't go right in my eyes.

 

I give free shipping to my customers if they buy for 75? or more. When they order something from 75.10? for example, they will only be able to choose the free shipping at checkout.

Only after that, they will have to enter their code to benefit from the discount. So the total of the order will be under 75?, but still they will receive the free shipping.

 

Does anyone know how this can be solved?

Thank you so much for helping me out!

 

Regards,

Vicky

Link to comment
Share on other sites

This is going be great if I can get it working. I am having a problem with generation of the coupon.

 

I am getting this code.

 

1136 - Column count doesn't match value count at row 1

 

insert into discount_coupons ( coupons_id, coupons_description, coupons_discount_percent, date_start, date_end, max_use, min_order) values ('WET0L', 'testing', '.10', "0010-06-08", "0020-06-08", 0, 0, 0)

 

[TEP STOP]

 

 

http://www.oscommerce.com/forums/index.php?sho...mp;st=200

Contributions

 

Discount Coupon Codes

Donations

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...