Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

Great contribution, thanks.

 

Although I have one problem.

 

All payment options I have are by cards thus gathering card info. When an order is 0, that shouldn't be needed.

 

So how can I override this so that when order total is 0 the site redirects directly to checkout_success and processes the order normally?

 

Hi,

 

I have this error in my admin :

 

Parse error: parse error, expecting `')'' in c:\program files\easyphp1-8\www\catalog\admin\includes\boxes\catalog.php on line 31

 

 

I don't understand how to fix it.

 

Here is my code :

 

								   '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .
							   '<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .
							   //kgt - discount coupons
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' .					  BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.
							   '<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );
							   /***************
							   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' );
							   ***************/
							   //end kgt - discount coupons

 

Can someone help me?

 

Thank you very much. :blush:

Share this post


Link to post
Share on other sites
Hi,

 

I have this error in my admin :

 

Parse error: parse error, expecting `')'' in c:\program files\easyphp1-8\www\catalog\admin\includes\boxes\catalog.php on line 31

I don't understand how to fix it.

 

Here is my code :

 

'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' .					  BOX_CATALOG_PRODUCTS_EXPECTED

 

Can someone help me?

 

Thank you very much. :blush:

 

Might just be the tabs you have on that line that cause that error. Otherwise I can't see nothing else wrong with it. Although I might be blind as well.

Share this post


Link to post
Share on other sites
Might just be the tabs you have on that line that cause that error. Otherwise I can't see nothing else wrong with it. Although I might be blind as well.

 

Solved ;)

Share this post


Link to post
Share on other sites

I have a new problem :

 

Now, the price is multiplied by two for each item :o .

 

Check this :blink: :

 

discount.jpg

 

 

What happened?!! :'(

Share this post


Link to post
Share on other sites
I have a new problem :

 

Now, the price is multiplied by two for each item :o .

 

Check this :blink: :

 

discount.jpg

What happened?!! :'(

 

Had that same problem, then I just got my backup file and did all the modfications from 3.3 manually again and removed /**** old code part***/ just to be safe. Problem solved.

Share this post


Link to post
Share on other sites
Had that same problem, then I just got my backup file and did all the modfications from 3.3 manually again and removed /**** old code part***/ just to be safe. Problem solved.

 

OK other problem :

 

When I try to exclude some product from the discount coupon, it doesn't work. Excluding return to default everytime.

 

What is the problem?

 

Thanks :thumbsup:

Share this post


Link to post
Share on other sites

Can anyone tell me if the contrib "Discount coupon Codes" is working good with the 2.2 RC1 version of OsCommerce ?

 

thanks !

Share this post


Link to post
Share on other sites

When I get to checkout_shipping.php I get the following error.

 

 

1146 - Table 'nmatese_test.TABLE_DISCOUNT_COUPONS' doesn't exist

 

SELECT dc.* FROM TABLE_DISCOUNT_COUPONS dc WHERE coupons_id = 'firstorder' AND ( coupons_date_start <= CURDATE() OR coupons_date_start IS NULL ) AND ( coupons_date_end >= CURDATE() OR coupons_date_end IS NULL )

 

[TEP STOP]

 

 

 

But when I go into my PHPMyAdmin the table is there?

 

Any ideas?

Share this post


Link to post
Share on other sites
When I get to checkout_shipping.php I get the following error.

1146 - Table 'nmatese_test.TABLE_DISCOUNT_COUPONS' doesn't exist

 

SELECT dc.* FROM TABLE_DISCOUNT_COUPONS dc WHERE coupons_id = 'firstorder' AND ( coupons_date_start <= CURDATE() OR coupons_date_start IS NULL ) AND ( coupons_date_end >= CURDATE() OR coupons_date_end IS NULL )

 

[TEP STOP]

But when I go into my PHPMyAdmin the table is there?

 

Any ideas?

Figured It Out Sorry Guys

Share this post


Link to post
Share on other sites

Offbeat problem

 

Whenever I go to edit in a percentage or fixed rate or anything to the coupon and hit "update" it kicks this error back at me:

 

1054 - Unknown column 'coupons_min_order_type' in 'field list'

 

update discount_coupons set coupons_discount_amount = '10.0000000', coupons_discount_type = 'fixed', coupons_description = '', coupons_date_start = null, coupons_date_end = null, coupons_max_use = 0, coupons_min_order = 20.00, coupons_min_order_type = 'price', coupons_number_available = 100 where coupons_id = 'Gaun0807'

 

Obviously those are all the variables, but does this mean that it's not posting to the database? When I create the coupon, it makes it no problem.

Share this post


Link to post
Share on other sites

I have installed version 3.3.

 

Everything is working fine in the admin section but not on the live customer area.

 

I have enabled the coupons via admin and created a coupon, checked in php myadmin and all tables are there.

 

When going to the checkout_payment.php I do not have the text box to insert the coupon code although it is within the code on the php page.

If I remove the code below it does however show up although even if I do remove the code I still get the errors on the checkout page.

 

 

<?php
/* kgt - discount coupons */
if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ) {
?>

 

 

 

My next error is on checkout_confirmation.php

 

1146 - Table 'latori_osc1.TABLE_COUPONS' doesn't exist

select coupon_code from TABLE_COUPONS where coupon_id=''

[TEP STOP]

 

This site is due to go live in a couple of days so any help is much appreciated.

Share this post


Link to post
Share on other sites
If you followed the installation instructions, you should have some code in checkout_payment.php similar to this :

if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ) {
echo TABLE_HEADING_COUPON;
echo ENTRY_DISCOUNT_COUPON;
echo tep_draw_input_field('coupon', '', 'size="32"');
}

 

Of course, you have to activate the module in "admin -> modules -> order total" first, or the field won't show up.

 

 

I am having the same problem. The Discount Coupons are showing up under Catalog in the Admin section. A have added new coupons but there is no place to enter the coupon code when checking out. This is the store www.lillabellostore.com.

 

Any help would be appriciated.

Share this post


Link to post
Share on other sites
I am having the same problem. The Discount Coupons are showing up under Catalog in the Admin section. A have added new coupons but there is no place to enter the coupon code when checking out. This is the store www.lillabellostore.com.

 

Any help would be appriciated.

 

Do you have the code I quoted in the checkout_payment.php file ? It does the following :

1. check if the CC module is activated (it checks if the table exist in the database)

2. Displays the heading (TABLE_HEADING_COUPON) and a bit of text (ENTRY_DISCOUNT_COUPON)

3. Displays an input field

 

First, you should check in the admin section if the module is activated. If it is, try to deactivate then reactivate it. If activated, you can check your database with PHPMyAdmin to see if the related tables exist.

Share this post


Link to post
Share on other sites

It's a great contribution! However, I could not get it working. I got the following error messenge after I finished installation step by step. Anybody's help is greatly appreciated!

 

Thanks

 

Parse error: syntax error, unexpected $end in /mnt/w0402/d33/s32/b02bbe1b/www/vistatech.ca/onlinestore/catalog/admin/includes/boxes/catalog.php on line 42

Share this post


Link to post
Share on other sites
It's a great contribution! However, I could not get it working. I got the following error messenge after I finished installation step by step. Anybody's help is greatly appreciated!

 

Thanks

 

Parse error: syntax error, unexpected $end in /mnt/w0402/d33/s32/b02bbe1b/www/vistatech.ca/onlinestore/catalog/admin/includes/boxes/catalog.php on line 42

 

Well, for a start you should quote the code in your catalog.php file around line 42.

Share this post


Link to post
Share on other sites
Do you have the code I quoted in the checkout_payment.php file ? It does the following :

1. check if the CC module is activated (it checks if the table exist in the database)

2. Displays the heading (TABLE_HEADING_COUPON) and a bit of text (ENTRY_DISCOUNT_COUPON)

3. Displays an input field

 

First, you should check in the admin section if the module is activated. If it is, try to deactivate then reactivate it. If activated, you can check your database with PHPMyAdmin to see if the related tables exist.

 

 

I dont have the option to deactivate. For some reason my Discount Coiupons show up in the Catalog section just under product expected. I am not sure why they are not in the Modules section under Oder Totals.

Share this post


Link to post
Share on other sites
Do you have the code I quoted in the checkout_payment.php file ? It does the following :

1. check if the CC module is activated (it checks if the table exist in the database)

2. Displays the heading (TABLE_HEADING_COUPON) and a bit of text (ENTRY_DISCOUNT_COUPON)

3. Displays an input field

 

First, you should check in the admin section if the module is activated. If it is, try to deactivate then reactivate it. If activated, you can check your database with PHPMyAdmin to see if the related tables exist.

 

 

Thanks I Got it working. I was missing the file includes\modules\order_total\ot_discount_coupon.php. Nothing to major. When I added it back in and the corresponding language file verything worked perfectly.

Share this post


Link to post
Share on other sites

I get this 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 'or z2g.zone_id = 0 or z2g.zone_id IS NULL )

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]

 

 

None of the fixes mentioned have solved it... It started when I entered the coupon code on the catalog side as a customer and clicked to check out. After the error popped up it now comes every time you click to check out of your cart.

Share this post


Link to post
Share on other sites
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"

 

There seems to be a problem in the tests used in the SQL query (testing against nothing). I guess you'll have to check the PHP code to see how the query is contructed and what variables are used in it.

Share this post


Link to post
Share on other sites

I am getting this error on checkout_confirmation.php

 

Any ideas where I may have gone wrong?

 

Everything else works perfectly.

 

 

1146 - Table 'latori_osc1.TABLE_COUPONS' doesn't exist

select coupon_code from TABLE_COUPONS where coupon_id=''

[TEP STOP]

Share this post


Link to post
Share on other sites

Here is a screen shot.

 

For some reason the coupon stuff is now working, not sure what I did appart from changing the sort order.

Is the error code relevant to this particular module? Im thinking it may be part of the vouchers and coupon module (CONTRIBUTION] CCGV (trad) ) that I installed but never got to work.

This error code has never shown up previously though until now.

 

1146 - Table 'latori_osc1.TABLE_COUPON_GV_CUSTOMER' doesn't exist

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

[TEP STOP]

 

 

disabled.jpg

Share this post


Link to post
Share on other sites

Thanks for this great contribution.

 

Installed today with many other contributions and all looks good!

 

However, I wasn't receving error messages when I would input the same coupon twice (when I set max use as 1) - the page was just refreshing.

 

So I consulted the helpfile and the fix was indeed there.

 

HOWEVER, athough it works, it copmpletely messes up my STS templated. The error box is way off to the right of the screen and all by right column boxes ae now put below my let coum boxes. The centre text is also below left (ie continuing with the order).

 

Ay ideas?

 

Thanks.

Share this post


Link to post
Share on other sites
Here is a screen shot.

 

For some reason the coupon stuff is now working, not sure what I did appart from changing the sort order.

Is the error code relevant to this particular module? Im thinking it may be part of the vouchers and coupon module (CONTRIBUTION] CCGV (trad) ) that I installed but never got to work.

This error code has never shown up previously though until now.

 

1146 - Table 'latori_osc1.TABLE_COUPON_GV_CUSTOMER' doesn't exist

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'

[TEP STOP]

disabled.jpg

 

If you read a couple post before yours you will see that I am having a similar problem myself so I can not offer any advise as to how to fix it other than what has been mentioned in this thread but has not worked.. First time I seen someone mention a 1146 error though.. However I did have a question for you. You said that the coupons started working after you changed the sort order? What sort order did you change it to? My coupons do not even work but instead blank out the whole page with the error message I mentioned a few post ago. A 1064 error message I believe mine was. I was having the same problem in the admin sections as well but the fix mentioned here fixed that but the actual store/catalog side is still messed up and the few different fixes mentioned here do not fix that part.. Starting to grow weary on whether or not I am ever going to get this figured out.. OScommerce claimed the 1064 error was a bug in their own code so they released a bug fix.. Again it fixes the admin panel but not the catalog portion.. So back to the question of what sort order did you change to?

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

×