Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Is that fixed in the latest version, or should I apply this fix manually.

 

You can make the one change I posted (http://www.oscommerce.com/forums/index.php?showtopic=213019&st=80&gopid=879248) for immediate results. I will add the change to an update along with the global max use others have suggested.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

hello kgt,

 

do you know where in msql i can increase packet in msql client!

 

the instruction is:

 

If you are using the mysql client program, its default max_allowed_packet variable is 16MB. To set a larger value, start mysql like this:

 

shell> mysql --max_allowed_packet=32M

 

my knowledge of phpmyadmin is ONLY run sql LOL!

 

cheers

Link to comment
Share on other sites

hello kgt,

 

do you know where in msql i can increase packet in msql client!

 

my knowledge of phpmyadmin is ONLY run sql LOL!

 

cheers

 

In phpMyAdmin run the SQL

 

SET GLOBAL max_allowed_packet=100000000;

 

or whatever. However you probably don't have permissions to do that. Nor is this a good solution, since everytime the server is restarted it will default back to the lower value. Nor is this necessarily going to fix the problem, since there are other possible causes for the error message.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

congratulations for his/her contribution for osc2

 

test of me of personnel a versions of all and the problem continuous amounts

 

the customer can use the discount code at once

limiting of you of even the discount for one

 

does he/she have of anybody a solution?test of me of personnel a versions of all and the problem continuous amounts

 

the customer can use the discount code at once

limiting of you of even the discount for one

 

does he/she have of anybody a solution?

thank you

Link to comment
Share on other sites

I found this can happen if you display the subtotal with the discount applied. If the discount brings your order subtotal below this limit, then you'll still get the message. In checkout_confirmation.php line 90

 

replace

			if( $row['min_order'] != 0 && $row['min_order'] > $order->info['subtotal'] ) { 
			$error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, $currencies->format( $row['min_order'], true, $order->info['currency'], $order->info['currency_value'] ) );
		}

with

			if( $row['min_order'] != 0 ) {
	if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'false' && $row['min_order'] > $order->info['subtotal'] ) {
				$error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, $currencies->format( $row['min_order'], true, $order->info['currency'], $order->info['currency_value'] ) );
			} else if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_DISPLAY_SUBTOTAL == 'true' ) {
	  $subtotal = $order->info['subtotal'];
		  foreach( $order->info['applied_discount'] as $discount ) {
			  $subtotal += $discount;
			}
			if( $row['min_order'] > $subtotal ) {
				$error_message[] = sprintf( ENTRY_DISCOUNT_COUPON_MIN_ERROR, $currencies->format( $row['min_order'], true, $order->info['currency'], $order->info['currency_value'] ) );
				}
			}
		}

 

See if that works for your order.

 

thank you for your time all is correct now, :) a great contrib with outstanding support

 

Regards

RT

Link to comment
Share on other sites

I there any way to take a dollar ammount off the order insted of a percent?

 

Nope, not yet. A LOT of people have asked this, so I'll explain the holdup:

 

The discount specifically happens before tax. Due to the way OSC handles tax, that means the discount must actually be applied to each line item, rather than to a subtotal. Most people don't have more than one tax class, so just applying a dollar discount to the entire order subtotal would work for them and produce the same, correct results. However, suppose you have two tax classes in one order: taxable and non-taxable. In order to calculate the correct tax, you must apply the discount proportionately to each subtotal for each tax class.

 

Say I have an order:

 

3 x Item 1 (taxable at 5%) $5.00

2 x Item 2 (non-taxable) $6.00

--------------------------------------

subtotal: $27.00

discount: -$5.00

tax: ?

 

Here's where it gets tricky. Since I have a discount of $5.00, I need to apply 60% of that discount to the taxable class subtotal (since 60% of the items in the cart are taxable). Or, I need to apply 45.5% of the discount to the taxable subtotal (since 45.5% of the order amount is taxable). Which do I choose? The first problem.

 

The second problem is, I have no easy way of knowing the quantity of items for the whole order or for each tax group without counting them beforehand. The same goes for a subtotal for each tax class. A solution that tallys beforehand is doable, but awkward and wasteful and I'd much prefer a better solution. I haven't thought of one yet, and no one has come forward with an answer. ;)

 

I know from looking at this order that I need to apply the 5% tax to the taxable subtotal of $3.00 (assuming I apply 60% of the discount to the taxable items), but there's no easy way to know that when the tax is actually being calculated in includes/classes/order.php. Tax is calculated incrementally, which means the code loops through each line item, calculates it's tax, and then adds that value to the running total.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

I found this:

 

This module is activated as an order total module. The way I setup this module is so that it is calculated after tax, shipping, low order fees have been added. The account balance is subtracted from this subtotal to determine a billable total. After the sale, the customer's account balance is adjusted accordingly.

 

Would that work?

Link to comment
Share on other sites

I keep getting this error no matter how I type in the coupon code...

"The coupon code you have entered is not valid"

 

I checked my database tables and the coupon is entered correctly..the date format is all correct as well.

 

suggestions?

Link to comment
Share on other sites

I keep getting this error no matter how I type in the coupon code...

"The coupon code you have entered is not valid"

 

I checked my database tables and the coupon is entered correctly..the date format is all correct as well.

 

suggestions?

 

 

I figured it out...thx for a great contrib!

Link to comment
Share on other sites

I found this:

 

This module is activated as an order total module. The way I setup this module is so that it is calculated after tax, shipping, low order fees have been added. The account balance is subtracted from this subtotal to determine a billable total. After the sale, the customer's account balance is adjusted accordingly.

 

Would that work?

 

No, because this discount happens before tax. If it happened after tax, then there wouldn't be this issue. (If it happens after tax, then it's more of a gift certificate.)

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

test of me of personnel a versions of all and the problem continuous amounts

 

the customer can use the discount code at once

limiting of you of even the discount for one

 

does he/she have of anybody a solution?

 

I'm sorry, I cannot understand what your problem is. Perhaps you can show an example?

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Ok, I dont know if I feel dumb or what, but it has already been a long day if I missed something really obvious. I am not getting an option for installing the discount coupon in Modules>Order Total because I have not been able to do step 2 of the installation where it tells you to 'run these statements via the SQL tab in phpMyAdmin.' I am using NetFirms and their Commerce Pro store. I cannot seem to find anywhere that I looked the SQL tab or a phpMyAdmin. If I could seriously be babystepped into where I could find this I would be most grateful. I see others have found this, but dont know if everyone is running the same thing. By the way, this is a great module to have...so a big thanks!

Link to comment
Share on other sites

Ok, I dont know if I feel dumb or what, but it has already been a long day if I missed something really obvious. I am not getting an option for installing the discount coupon in Modules>Order Total because I have not been able to do step 2 of the installation where it tells you to 'run these statements via the SQL tab in phpMyAdmin.' I am using NetFirms and their Commerce Pro store. I cannot seem to find anywhere that I looked the SQL tab or a phpMyAdmin. If I could seriously be babystepped into where I could find this I would be most grateful. I see others have found this, but dont know if everyone is running the same thing. By the way, this is a great module to have...so a big thanks!

 

 

Hi,

I have just had a nosey on netfirms website, according to their sign-up page both personal and business hosting gets access to CONTROL PANEL XL6

 

How ever it doesnt state how you gain access to your control panel :(

 

However on my website its www.youdomainname.com(co.uk,org ect):port number/frontend/x/index.html

 

I would suggest you get in touch with netfirms and ask them for the url you need to access your cpanel

Link to comment
Share on other sites

I cannot seem to find anywhere that I looked the SQL tab or a phpMyAdmin.

 

I cannot tell you how to get to phpMyAdmin on your server. That is a question for your host. Often, you can get to it via:

 

yourdomain.com/cpanel

 

but this is just a common way some hosts allow access. They may not have phpMyAdmin installed, but they certainly will have some other tool available. You will have to ask them for support on this issue.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Nice contribution, thanks. Easy to setup.

 

I am having one problem, however, that I can't seem to crack.

 

My discount codes seem to be working fine until you go to checkout, at which point I get the following error. It seems that there is a missing table in the database, but I can't figure out what I might be doing wrong. The sql database update seemed to work fine, loading all the new tables as expected. Below is the page error that I get when I hit the checkout button after using a coupon code.

 

 

1146 - Table 'charron1_p_os1.TABLE_DISCOUNT_COUPONS_USE_COUNT' doesn't exist

 

insert into TABLE_DISCOUNT_COUPONS_USE_COUNT (coupons_id, orders_id) values ('C10', '13')

 

 

Any help is appreciated.

 

Thanks,

Michael

Link to comment
Share on other sites

Nice contribution, thanks. Easy to setup.

 

I am having one problem, however, that I can't seem to crack.

 

My discount codes seem to be working fine until you go to checkout, at which point I get the following error. It seems that there is a missing table in the database, but I can't figure out what I might be doing wrong. The sql database update seemed to work fine, loading all the new tables as expected. Below is the page error that I get when I hit the checkout button after using a coupon code.

1146 - Table 'charron1_p_os1.TABLE_DISCOUNT_COUPONS_USE_COUNT' doesn't exist

 

insert into TABLE_DISCOUNT_COUPONS_USE_COUNT (coupons_id, orders_id) values ('C10', '13')

Any help is appreciated.

 

Thanks,

Michael

 

 

Have youactually looked in phpmyadmin to see if that database does actually exist?

 

 

Also which version of the module did u install?

Link to comment
Share on other sites

Great contribution!...So far everything is working great in testing except the Max use by customer. I will await your fix on this forum for that as you seem to be working on the fix currently.

 

One issue I am noticing with the install of version 1.3 is that when a customer keys in the Coupon code on checkout_payment, then clicks continue to checkout_confirmation the discount is correctly applied. However, if customer goes back to checkout_payment and changes to another coupon code or even to take out the existing one, upon clicking continue and being taken to checkout_confirmation, the old discount still is visible. There appears to be no way to change or take out the coupon code that was initially keyed.

 

I have tried this on multiple computers as I was thinking it was a cache issue, but same issue occurs there also. The only way to get the coupon code out or to change to a new code and have calcuted in total, is if you delete cache for the browser or close all browsers and re-open.

 

Any ideas what could be causing this?

Link to comment
Share on other sites

Great contribution!...So far everything is working great in testing except the Max use by customer. I will await your fix on this forum for that as you seem to be working on the fix currently.

 

One issue I am noticing with the install of version 1.3 is that when a customer keys in the Coupon code on checkout_payment, then clicks continue to checkout_confirmation the discount is correctly applied. However, if customer goes back to checkout_payment and changes to another coupon code or even to take out the existing one, upon clicking continue and being taken to checkout_confirmation, the old discount still is visible. There appears to be no way to change or take out the coupon code that was initially keyed.

 

I have tried this on multiple computers as I was thinking it was a cache issue, but same issue occurs there also. The only way to get the coupon code out or to change to a new code and have calcuted in total, is if you delete cache for the browser or close all browsers and re-open.

 

Any ideas what could be causing this?

 

Session problem. Actually another way to clear it would be click continue on payment page with no entry in the coupon field.

 

I'll look into it.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

Nice contribution, thanks. Easy to setup.

 

I am having one problem, however, that I can't seem to crack.

 

My discount codes seem to be working fine until you go to checkout, at which point I get the following error. It seems that there is a missing table in the database, but I can't figure out what I might be doing wrong. The sql database update seemed to work fine, loading all the new tables as expected. Below is the page error that I get when I hit the checkout button after using a coupon code.

1146 - Table 'charron1_p_os1.TABLE_DISCOUNT_COUPONS_USE_COUNT' doesn't exist

 

insert into TABLE_DISCOUNT_COUPONS_USE_COUNT (coupons_id, orders_id) values ('C10', '13')

Any help is appreciated.

 

Thanks,

Michael

 

 

You need to download

 

Discount Coupon Codes 1.3 fix for checkout_process.php

 

uploaded on Jun 13.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

I'm trying to install this contrib but get this error from phpMyAdmin:

 

SQL query:

 

INSERT INTO `admin_files` ( `admin_files_id` , `admin_files_name` , `admin_files_is_boxes` , `admin_files_to_boxes` , `admin_groups_id` )

VALUES (

 

NULL , 'coupons.php', '0', '3', '1'

)

 

MySQL said:

 

#1146 - Table 'drewca_osc1.admin_files' doesn't exist

 

Any suggestions?

 

Thank you

Edited by mschwarz
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...