Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

is there a package for this contributions with a search/replace install instructions with all fixes included?

Share this post


Link to post
Share on other sites

I don't know if this problem has come up before. I don't know if my host updated the svr or what, but my coupon code seems to be causing an infinite login loop. I tried to add another coupon to the functioning coupon code contrib and when i tried to test it out, the problem started to show up, when i click to confirm, it asks to relogin and when you attempt to relogin, it brings you back to the login in an infinite loop. I tried to uninstall the conrtib but it brought down the whole checkout but when i reinstalled it to backtrack the foul up, i saw some success that if you don't input a coupon, it will carry you onto the confirmation page. Before i did the reinstall, no matter what was in the code box, the issue came up. SO at least the site functions but if someone tries to use a promotional offer, the loop happens.

 

has anyone seen this before and is there a quick fix to it? \

 

THANKS!

Edited by blakepetersen

Share this post


Link to post
Share on other sites

Just a quick note on a problem I have solved - other people have reported the same problem, but I can't figure how to include thier posts in my reply.

 

When I installed this contrib (version 3.3) my sub-total started showing double what it should be - even if the discount is not applied.

 

I tracked it down to catalog/includes/classes/order.php.

 

In the instructions it says to add and replace various pieces of code. The second step -is around line 224 to REPLACE

$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];

$this->info['subtotal'] += $shown_price;

 

..with the new code - but I misread it as 'ADD' the new code. So it ended up doing the '$this->info['subtotal'] += $shown_price;' twice - hence the double value!!

Hope this helps someone.

Share this post


Link to post
Share on other sites

I installed the contrib and now every time a user tries to pay with a credit card, they get an error saying "credit card error" and a blank reddish space that's supposed to describe the error but has no error explanation.

 

I had a cookies problem that resulted in returning users being sent into a constant login loop. fixed that problem by uninstalling the discount coupons and editing my cookie settings... and now this issue has come up after i got eveyrthing back to normal and decided to try the DCC contrib again. The contribution works when i click money orders but when i type in a CC#, i can't move past the payment information page.

 

has anyone seen this before?

Share this post


Link to post
Share on other sites
Hi,

 

Like others above I've got a problem when using Paypal Express Checkout - if you click on the paypal icon it skips the input field coupon completely because it goes straight to payment_confirmation.php.

And if you use the regular checkout button, you see the normal checkout_shipping.php, checkout_payment.php etc so you can enter the code - but then it whisks you off to paypal and when it comes back to checkout_confirmation.php it's forgotten the voucher code (and the shipping for that matter).

 

Anyone got any ideas? I haven't installed Paypal IPN or whatever it's called, just use the PayPal Express Checkout and PayPal Website Payments Pro (UK) Direct Payments modules that came in oscommerce 2.2 RC2.

I have added in an extra shipping module that might be getting screwed up with discounts and coupons, as I noticed I had to edit some of the same pages to install coupons today.

 

Any ideas very gratefully received!!

 

Lisa x

 

Have any luck fixing this Lisa?

 

I have the same problem...am using Paypal Express Checkout and PayPal Website Payments Pro (UK) .

 

What we could do with is an "apply" button next to the coupon code to reset the total before going to PayPal.

 

it does work if you put the code in and select say pay by cheque...go to the confirmation screen and then click back on your browser to the payment selection screen. Then when you select express the amount is correct...hence my thoughts that an apply button would work by calling the confirmation order totals.

 

Anyone got any ideas how to implement ?

 

Mike

Share this post


Link to post
Share on other sites
Have any luck fixing this Lisa?

 

I have the same problem...am using Paypal Express Checkout and PayPal Website Payments Pro (UK) .

 

What we could do with is an "apply" button next to the coupon code to reset the total before going to PayPal.

 

it does work if you put the code in and select say pay by cheque...go to the confirmation screen and then click back on your browser to the payment selection screen. Then when you select express the amount is correct...hence my thoughts that an apply button would work by calling the confirmation order totals.

 

Anyone got any ideas how to implement ?

 

Mike

 

I am having the same problem, can any kind soul to help here!

Share this post


Link to post
Share on other sites
I am having the same problem, can any kind soul to help here!

 

I have coded a solution for this but given I am not a web guy it is a bit sloppy.

 

Basically I have made up and added a new module in payments call PayPal Account (which is based on moneyorder.php with some words changed)

 

They user can then select this as a payment method on the checkout_payment.php screen ( i have removed the Paypal checkout express link altogether) which then takes us to checkout_confirmation.php.

 

Here i check if the user is paying by payal account I replace the confirm order button with the Check out with paypal link.

 

At this point the coupon discount has been applied and the amount is correct.

 

All seems to be working perfect.

 

Mike

Share this post


Link to post
Share on other sites

Oh thank you so much for this fix! You don't understand - I want to marry you and have your children you've helped so much!

 

Change lines 72-78 in includes/classes/discount_coupon.php from this:

 

		$check_user_query = tep_db_query($sql = 'SELECT dc2z.geo_zone_id
											  FROM '.TABLE_DISCOUNT_COUPONS_TO_ZONES.' dc2z
											  LEFT JOIN '.TABLE_ZONES_TO_GEO_ZONES.' z2g
												USING( geo_zone_id )
											  WHERE ( z2g.zone_id='.$delivery['zone_id'].' or z2g.zone_id = 0 or z2g.zone_id IS NULL )
												AND ( z2g.zone_country_id='.$delivery['country_id'].' or z2g.zone_country_id = 0 )
												AND dc2z.coupons_id="'.tep_db_input( $code ).'"' );

 

to this:

 

		$check_user_query = tep_db_query($sql = 'SELECT dc2z.geo_zone_id
											  FROM '.TABLE_DISCOUNT_COUPONS_TO_ZONES.' dc2z
											  LEFT JOIN '.TABLE_ZONES_TO_GEO_ZONES.' z2g
												USING( geo_zone_id )
											  WHERE ( z2g.zone_id = '.(int)$delivery['zone_id'].' or z2g.zone_id = 0 or z2g.zone_id IS NULL )
												AND ( z2g.zone_country_id='.(int)$delivery['country_id'].' or z2g.zone_country_id = 0 )
												AND dc2z.coupons_id="'.tep_db_input( $code ).'"' );

Share this post


Link to post
Share on other sites

Hi, i am suddently having issues with my coupons system

 

 

lately a few orders (not all of them) for a strange reason, when the user applies a coupon

 

for example a coupon that is supposed to take off 0.01 penny from order total above 1.00

 

the coupon is taking off a ridiculous amount of money such as $24 dollars!

 

i dont know why this is happening all of a sudden, i dont recall making any changes to the coupons code, can someone please help why is this happening , where could i look to find bugs or check to see if somethign is wrong so i can fix this?

 

 

i had to disable the coupons system because of this

 

thanks for your help

Share this post


Link to post
Share on other sites
Hi, i am suddently having issues with my coupons system

 

 

lately a few orders (not all of them) for a strange reason, when the user applies a coupon

 

for example a coupon that is supposed to take off 0.01 penny from order total above 1.00

 

the coupon is taking off a ridiculous amount of money such as $24 dollars!

 

i dont know why this is happening all of a sudden, i dont recall making any changes to the coupons code, can someone please help why is this happening , where could i look to find bugs or check to see if somethign is wrong so i can fix this?

 

 

i had to disable the coupons system because of this

 

thanks for your help

 

 

I am receiving this error sometimes also, just received it now AFTER ADDING ITEM TO CART::

 

 

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 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) ' at line 5

 

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"

 

[TEP STOP]

 

 

 

 

 

 

 

I also noticed in the admin panel, for the discount Amount: i typed in 10.00

 

and saved it

 

and then re-open and it shows it like this : 10.0000000

 

with a bunch of zeros after, could this be the problem? how do i fix?

 

 

see problem below, coupon is supposed to subtract $10.00 fixed amount, but it is not doing that!

 

 

products (Edit) Tax Total

1 x ************* 0% $0.00

1 x ************* 7.75% $5.48

1 x ************* 7.75% $6.25

1 x ************* 7.75% $11.95

 

Billing Information

Billing Address (Edit)

********

 

Payment Method (Edit)

Check/Money Order

 

Sub-Total: $1.69

Discount Coupon C002 applied: -$21.99

CA TAX 7.75%: $0.10

United States Postal Service (PRIORITY (2 - 3 Days)): $5.20

Total: $6.99

Edited by 123543

Share this post


Link to post
Share on other sites

The value to be used in the sql don't appear to be populated. I have added xxxxxxxxxxx where there should be a value.

 

WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"

 

WHERE ( z2g.zone_id= xxxxxxxxxxxxxx or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= xxxxxxxxxxxxxxx or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites
The value to be used in the sql don't appear to be populated. I have added xxxxxxxxxxx where there should be a value.

 

WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"

 

WHERE ( z2g.zone_id= xxxxxxxxxxxxxx or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= xxxxxxxxxxxxxxx or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"

 

 

so how do i fix this , im not sure what to do? can you please elaborate for me im not a programmer but i have access to phpmyadmin and dedicated server

Share this post


Link to post
Share on other sites
so how do i fix this , im not sure what to do? can you please elaborate for me im not a programmer but i have access to phpmyadmin and dedicated server

 

 

update:

The percentage discount works perfect, its just the fixed amount that is doing this.

Share this post


Link to post
Share on other sites

Hi

 

I've installed the contrib and after adding the sub-total fix, all is OK apart from a few little probs. The first is probaby easy, after the coupon expires I get the standard "Not valid" message and not the "No longer valid" message.

 

For the second I have excluded 1 product as a test and no error or warning message show. The debug info is below. Product [0] with id 383 is the excluded one.

 

The last prob is the way that error messages are displayed. The ones included in this contrib don't match the design of my site so I have changed them. The error messages are now in the main body of my page and are based on a table layout similar to Amazon. Exclaimation mark, colored background etc. Will this cause any probs or is it the reason prob 2 is happening.

 

Sorry to lump them all into 1 post

 

Hope someone can help

 

Ian

 

<!-- Discount Coupons DEBUG
order Object
(
[info] => Array
	(
		[order_status] => 1
		[currency] => GBP
		[currency_value] => 1.00000000
		[payment_method] => Pay by Cheque
		[cc_type] => 
		[cc_owner] => 
		[cc_number] => 
		[cc_expires] => 
		[shipping_method] => Royal Mail International Airmail   (Ships normally within 5 to 7 days)
		[shipping_cost] => 5.95
		[subtotal] => 44.0025
		[tax] => 0
		[tax_groups] => Array
			(
				[Unknown tax rate] => 0
			)

		[comments] => 
		[total] => 46.285
	)

[totals] => Array
	(
	)

[products] => Array
	(
		[0] => Array
			(
				[qty] => 1
				[name] => Franke Pharoah
				[title] => Understand This Groove
				[media] => 12"
				[label] => Cheeky Records
				[catno] => CHEEKY 01
				[model] => ICR28098
				[tax] => 0
				[tax_description] => Unknown tax rate
				[price] => 33.00
				[final_price] => 33
				[weight] => 0.190
				[id] => 383
			)

		[1] => Array
			(
				[qty] => 1
				[name] => DJ Alan X
				[title] => Lost
				[media] => 12"
				[label] => Xtrax
				[catno] => XTRAX 010
				[model] => ICR27543
				[tax] => 0
				[tax_description] => Unknown tax rate
				[price] => 3.67
				[final_price] => 3.67
				[weight] => 0.190
				[id] => 322
			)

		[2] => Array
			(
				[qty] => 1
				[name] => Gina Go Go
				[title] => I Can't Face The Fact
				[media] => 12"
				[label] => Capitol Records
				[catno] => V 15396
				[model] => ICR27803
				[tax] => 0
				[tax_description] => Unknown tax rate
				[price] => 11.00
				[final_price] => 11
				[weight] => 0.190
				[id] => 387
			)

	)

[customer] => Array
	(
		[firstname] => 1st Name
		[lastname] => 2nd name
		[company] => 
		[street_address] => 28 Billing Road
		[suburb] => Manchester
		[city] => tertee
		[postcode] => M12 9DJ
		[state] => Adana
		[zone_id] => 3380
		[country] => Array
			(
				[id] => 215
				[title] => Turkey
				[iso_code_2] => TR
				[iso_code_3] => TUR
			)

		[format_id] => 1
		[telephone] => 
		[email_address] => email@email.com
	)

[delivery] => Array
	(
		[firstname] => 1st Name
		[lastname] => 2nd name
		[company] => 
		[street_address] => 28 Billing Road
		[suburb] => Manchester
		[city] => tertee
		[postcode] => M12 9DJ
		[state] => Adana
		[zone_id] => 3380
		[country] => Array
			(
				[id] => 215
				[title] => Turkey
				[iso_code_2] => TR
				[iso_code_3] => TUR
			)

		[country_id] => 215
		[format_id] => 1
	)

[content_type] => physical
[coupon] => discount_coupon Object
	(
		[messages] => Array
			(
				[debug] => Array
					(
						[0] => INFO: DISPLAY_PRICE_WITH_TAX = false
						[1] => INFO: MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING = false
						[2] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS = true
						[3] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_SORT_ORDER = 5
						[4] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TYPE = true
						[5] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL = false
						[6] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_TAX = None
						[7] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_EXCLUDE_SPECIALS = true
						[8] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_RANDOM_CODE_LENGTH = 6
						[9] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_LINES = false
						[10] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_ALLOW_NEGATIVE = false
						[11] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_USE_LANGUAGE_FILE = false
						[12] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_CONFIG = Discount Coupon [code] applied
						[13] => INFO: MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DEBUG = true
						[14] => INFO: Product 383 failed product exclusion check
						[15] => INFO: Product 383 failed product exclusion check
						[16] => INFO: Excluded product 383. Discount of 0 not applied.
						[17] => INFO: Discount of 0 applied to product 383 ($33).
						[18] => INFO: Calculating tax on 33.  Displayed price 33.
						[19] => INFO: Product 322 passed exclusion check.  Discount 0.9175 applied. (percent)
						[20] => INFO: Discount of 0.9175 applied to product 322 ($3.67).
						[21] => INFO: Calculating tax on 2.7525.  Displayed price 2.7525.
						[22] => INFO: Product 387 passed exclusion check.  Discount 2.75 applied. (percent)
						[23] => INFO: Discount of 2.75 applied to product 387 ($11).
						[24] => INFO: Calculating tax on 8.25.  Displayed price 8.25.
						[25] => INFO: Discount of 3.6675 applied to order total.
					)

			)

		[coupon] => Array
			(
				[coupons_id] => test123
				[coupons_description] => Sale now on
				[coupons_discount_amount] => 0.250000000000
				[coupons_discount_type] => percent
				[coupons_date_start] => 2008-07-26 00:00:00
				[coupons_date_end] => 2008-08-01 00:00:00
				[coupons_max_use] => 0
				[coupons_min_order] => 5.0000
				[coupons_min_order_type] => price
				[coupons_number_available] => 0
			)

		[applied_discount] => Array
			(
				[Unknown tax rate] => 3.6675
			)

		[cart_info] => Array
			(
				[valid_products] => Array
					(
						[count] => 2
						[line_items] => 2
						[total] => 14.67
					)

				[total_products] => Array
					(
						[count] => 3
						[line_items] => 3
						[total] => 47.67
					)

				[exclusions] => Array
					(
						[categories] => Array
							(
							)

						[products] => Array
							(
								[0] => 28
								[1] => 383
							)

						[manufacturers] => Array
							(
								[0] => 13
							)

					)

			)

		[discount_tax] => Array
			(
				[Unknown tax rate] => 0
			)

	)

[billing] => Array
	(
		[firstname] => 1st Name
		[lastname] => 2nd name
		[company] => 
		[street_address] => 28 Billing Road
		[suburb] => Manchester
		[city] => tertee
		[postcode] => M12 9DJ
		[state] => Adana
		[zone_id] => 3380
		[country] => Array
			(
				[id] => 215
				[title] => Turkey
				[iso_code_2] => TR
				[iso_code_3] => TUR
			)

		[country_id] => 215
		[format_id] => 1
	)

)

End Discount Coupons DEBUG-->

Share this post


Link to post
Share on other sites

Got this installed this morning and when I go to create a coupon, I get a 404 page not found error. I searched the forums, but didn't find a fix for this. Has anyone else run into this before and if so, how did you fix it? I thought it could be something in htaccess as I had a similiar issue with another script doing this before.

 

Either way, I need some advice or a fix. Thank you.

Share this post


Link to post
Share on other sites
Got this installed this morning and when I go to create a coupon, I get a 404 page not found error. I searched the forums, but didn't find a fix for this. Has anyone else run into this before and if so, how did you fix it? I thought it could be something in htaccess as I had a similiar issue with another script doing this before.

 

Either way, I need some advice or a fix. Thank you.

 

Oh, here is the error page I get:

 

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Could this be a file permission issue?

Share this post


Link to post
Share on other sites

I'm looking into install this on our shopping cart but have a few questions before hand - if someone doesn't mind taking a minute to answer, I'd appreciate it.

 

 

How much of a pain in this to install? I am pretty knowledgeable but there are a ton of packs and I'm not too familiar with oscommerce just yet. The only mod I have installed so far is an ajax image script.

 

 

On - http://addons.oscommerce.com/info/4269 which pack do I download to begin?

"Discount Coupon Codes 3.31"? and just move up the list with the bug fixes as I see fit?

 

 

Does anyone have any screen shots of this in the admin and cart? I'd like to see it before taking the time to install.

 

Can I create % as well as $ off coupons? (i.e 10% off or $10 off)

 

thanks in advance!

Share this post


Link to post
Share on other sites

Have you setup your zone id's ? I had to set them up through Admin and then I didn't have any problems anymore.

 

You have to go to Admin->Locations/Taxes->Tax Zones

 

I have two zones created - US and All Others. Click Insert to create a zone and name it. Then highlight the zone and click "details".

 

From here you can add the countries you want in that particular zone. You do have to place all of the countries into a zone, which is why I have two folders. The zones are used for shipping, so in my case, all of our shipping is either within the U.S. or not. My US zone is for shipping charges within the U.S. and my All Others zone is for all other parts of the world.

 

Hope that helps.

 

The value to be used in the sql don't appear to be populated. I have added xxxxxxxxxxx where there should be a value.

 

WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"

 

WHERE ( z2g.zone_id= xxxxxxxxxxxxxx or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= xxxxxxxxxxxxxxx or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="GR775"


~Tracy
 

Share this post


Link to post
Share on other sites

This is functioning great.

 

I have one small thing i would like changed.

 

I am selling digital products and i use paypal ipn.

 

After paypal ipn is received the status is set to "preparing paypal ipn" The person can then download the item, and they receive a email receipt with the total cost and they see the coupon code being subtracted in the receipt.

 

 

When i change the paypal ipn to set status to "delivered", they receive a receipt but the receipt does not mention the coupon at all. The discount is applied to checkout, but the coupon does not mention it shows the regular price for the email, even though they payed the discount price.

 

How can i fix it so that when the status is set to delivered, the email receipt will show the coupon discount amount.?

Share this post


Link to post
Share on other sites

Ok, I went back through and made sure I followed the directions and re-uploaded all the files and still getting a page not found error when I go to make the coupon, or if i try to view the coupon stats. I did notice in checkout that the place for the coupon code is there, so I am thinking I may have messed up in the admin section, but the links for the coupon code are in the admin section.

 

Was there something else that is often overlooked? I am not getting any errors at all other than page not found. I am at a loss, and I am betting it is something simple. Is there anything that was supposed to be configured?

Share this post


Link to post
Share on other sites

I found the problem, as i didn't upload the correct filenames.php. Now it works!!!!

Edited by xecutech

Share this post


Link to post
Share on other sites

HI,

 

I get this error after installing and testing on the checkout_shipping.php page:

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 'or z2g.zone_id = 0 or z2g.zone_id IS NULL ) ' at line 5

 

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id="test"

 

[TEP STOP]

 

I tried a fix earlier in this thread and still get:

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 'or z2g.zone_country_id = 0 ) ' at line 6

 

SELECT dc2z.geo_zone_id FROM discount_coupons_to_zones dc2z LEFT JOIN zones_to_geo_zones z2g USING( geo_zone_id ) WHERE ( z2g.zone_id= xxxxxxxxxxxxxx or z2g.zone_id = 0 or z2g.zone_id IS NULL ) AND ( z2g.zone_country_id= or z2g.zone_country_id = 0 ) AND dc2z.coupons_id= xxxxxxxxxxxxxx"test"

 

[TEP STOP]

 

Can you please explain how to fix this?

 

Thank you.

Share this post


Link to post
Share on other sites

I am getting this error in the admin page:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/maplehun/public_html/shop/admin/includes/boxes/reports.php on line 28

 

This is my reports.php page:

<?php

/*

$Id: reports.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- reports //-->

<tr>

<td>

<?php

$heading = array();

$contents = array();

 

$heading[] = array('text' => BOX_HEADING_REPORTS,

'link' => tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED, 'selected_box=reports'));

 

if ($selected_box == 'reports') {

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_VIEWED . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_PURCHASED . '</a><br>' .

//kgt - discount coupons report

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>'

'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');

/*************

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>'); *************/

//end kgt - discount coupons report

}

 

$box = new box;

echo $box->menuBox($heading, $contents);

?>

</td>

</tr>

<!-- reports_eof //-->

Share this post


Link to post
Share on other sites

I apologize if this has already been addressed. I skimmed through 100+ pages and may have missed something.

 

Initially, I thought the coupon was working OK since I did a test order. I have it set to take $10 off an order of $25 or more. However, I found out that it was giving the discount to anyone who used the coupon, no matter what their order total. I fixed that by changing the admin settings. I had it displaying the subtotal with discount applied. When I changed that, it no longer could be used for orders under $25. But if someone still puts in the coupon code when their order is below $25 it just takes them back to the same page where the coupon code is entered. There is no error message telling them they can't use the coupon.

 

I realize customers shouldn't be entering the coupon code if their order doesn't qualify, but I found out about the problem when a customer placed a $20 order and was given the $10 off. Is there a way to have an error show if they try to do this? Like...'Hey, you doofus...you can't use the coupon!' Just kidding on that one.

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

×