Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Discount Coupon Codes


kgt

Recommended Posts

Hello everyone,

 

After browsing I didnt see a similar issue so I will post.

 

I currently have a website bavender.com with osc ms 2.2 with numerous contribs installed including Discount Coupon Codes. It works fantastic, however it does not apply to the order total, just the subtotal. I want to have a customer to be able to use the coupon code to be able to purchase an item entirely free. How is it I can apply the coupon to the complete order?

 

Also, I saw someone ask previously in the forum, has anyone developed a system to use 2 codes at once? Say they have a 10% off and a $5.00 coupon, is that possible?

Jesse Rooney

Link to comment
Share on other sites

installed and everything works except the discount is not subtracted in checkout

 

shows:

 

United States Postal Service (1 x 5lbs) (Priority Mail): $6.30

Sub-Total: $45.51

CA TAX 7.75%: $3.53

Discount Coupon coupon1 applied: -$2.40

Total: $55.33

 

as you can see discount shows, but discount not being applied

 

its weird because this was working before, not sure why its not now.

 

how do i fix ?

 

thanks

Link to comment
Share on other sites

installed and everything works except the discount is not subtracted in checkout

 

shows:

 

United States Postal Service (1 x 5lbs) (Priority Mail): $6.30

Sub-Total: $45.51

CA TAX 7.75%: $3.53

Discount Coupon coupon1 applied: -$2.40

Total: $55.33

 

as you can see discount shows, but discount not being applied

 

its weird because this was working before, not sure why its not now.

 

how do i fix ?

 

thanks

 

edited... nevermind the above!!

 

it does work, its just confusing thats why i thought the discount wasnt being applied

 

see here:

 

1 x FX The Video $19.97

1 x Graffit'Instincts vol.1 (DVD) $24.94

1 x Pilot Permanent Ink - Color: Red $2.99

 

 

United States Postal Service (1 x 5lbs) (Priority Mail): $6.30

Sub-Total: $45.51

CA TAX 7.75%: $3.53

Discount Coupon pureg applied: -$2.40

Total: $55.33

 

copy and pasted

 

as you can see, its not showing the correct SUB TOTAL because the sub total should read: $54.02 with shipping included

but its just showing: $45.51 (ITS APPLYING THE DISCOUNT ALREADY)

 

so then this is very confusing, how do i change the discount to show before United States Postal Service line is showed?

 

and the TAX shown after the discount

 

thanks

Link to comment
Share on other sites

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

 

How do you get it to calculate after tax & shipping have been totaled? So it does act similar to a gift cert...

Jesse Rooney

Link to comment
Share on other sites

How do you get it to calculate after tax & shipping have been totaled? So it does act similar to a gift cert...

 

resoman,

 

check out a contribution called CCGV(trad)...i haven't tried it myself, but it sounds more like what you're looking for. as far as i know, DCC won't discount after calculating shipping (i could be wrong though), and whether or not you can legally discount after tax depends on where you are doing business from. for example, in california, we can't do that because it goes against our business laws, so we have to apply tax after the discount. anyway, i'm not sure how or if you can do it anyway, even if it is legal where you are.

 

good luck,

agra

Link to comment
Share on other sites

resoman,

 

check out a contribution called CCGV(trad)...i haven't tried it myself, but it sounds more like what you're looking for. as far as i know, DCC won't discount after calculating shipping (i could be wrong though), and whether or not you can legally discount after tax depends on where you are doing business from. for example, in california, we can't do that because it goes against our business laws, so we have to apply tax after the discount. anyway, i'm not sure how or if you can do it anyway, even if it is legal where you are.

 

good luck,

agra

 

 

Thanks for the response, I dont believe its illegal to pay for tax with a paid for gift card (which is what I am trying to do). But thanks for letting me know, I will consult my client on that. I had this contrib installed for coupons but tried to extend it to gift cards (yeah, im lazy....)

 

Hopefully CCGV traditional will work in tandem with discount coupons, wish meh luck!

Jesse Rooney

Link to comment
Share on other sites

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

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

 

[TEP STOP]

 

I am still getting the above error. I have redone the sql query (both tables already existed). below is the sql statements I am using - so maybe there is an error in there?

 

CREATE TABLE discount_coupons (

coupons_id varchar(32) NOT NULL default '',

coupons_description varchar(64) NOT NULL default '',

coupons_discount_percent decimal(7,4) default NULL,

date_start datetime default NULL,

date_end datetime default NULL,

max_use int(3) NOT NULL default 0,

min_order decimal(15,4) NOT NULL default '0.0000',

PRIMARY KEY (coupons_id)

);

 

CREATE TABLE discount_coupons_to_orders (

discount_coupons_to_orders_id int(11) NOT NULL auto_increment,

coupons_id varchar(32) default NULL,

orders_id int(11) default 0,

PRIMARY KEY (discount_coupons_to_orders_id)

);

 

 

I really need to get this sorted as I have now got discount vouchers waiting to be used by customers.

Link to comment
Share on other sites

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

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

 

[TEP STOP]

 

In my install the field is not date_start but rather coupons_date start so this query works

 

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit 0, 20

Link to comment
Share on other sites

If you are using the PWA - Proceed without an Account contribution you will need to be aware of a couple of things with this contribution.

 

PWA doesnt by default store a seperate shipping to billing address so you need to modify catalog/includes/classes/discount_coupons.php where it checks the shipping zone to use the billto value ie:

 

//shipping zone exclusions

//MB: modified for PWA which only uses billto

if ($customer_id>0) {

$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 ).'"' );

} else {

if (! $billto['country_id']) {

$billto['country_id'] = 0;

}

$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 = 0 or z2g.zone_id IS NULL )

AND ( z2g.zone_country_id='.$billto['country_id'].' or z2g.zone_country_id = 0 )

AND dc2z.coupons_id="'.tep_db_input( $code ).'"' );

} //MB: end PWA modify

 

I couldnt find the zone_id in billto attributes so for now i default to 0.

That should get your store working for people that select to PWA.

 

What you also need to be aware of though, is you cannot use One coupon per customer with PWA, because all customer_ids for PWA accounts are created as customer_id=0.

There will need to be another fix made to DCC that basically skips checking if customer_id=0 or even excludes the coupon if a person did not register, but I didn't have time to get that updated yet. When I do I will make a proper update to the contribution for it - but for now I wanted to add this to the forum in case anyone else was having issues.

Link to comment
Share on other sites

In my install the field is not date_start but rather coupons_date start so this query works

 

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit 0, 20

 

 

How do I change it? I tried changing the query to say coupons_date start and end but it is still giving me this error

Link to comment
Share on other sites

How do I change it? I tried changing the query to say coupons_date start and end but it is still giving me this error

 

 

coupons_date start = coupons_date_start (the sql query I did included was correct though)

 

can you do a

 

describe discount_coupons;

 

in sql and let me know the results

Link to comment
Share on other sites

coupons_date start = coupons_date_start (the sql query I did included was correct though)

 

can you do a

 

describe discount_coupons;

 

in sql and let me know the results

 

 

 

Field Type Null Key Default Extra

coupons_id varchar(32) PRI

coupons_description varchar(64)

coupons_discount_percent decimal(7,4) YES NULL

coupons_date_start datetime YES NULL

coupons_date_end datetime YES NULL

max_use int(3) 0

min_order decimal(15,4) 0.0000

 

 

Is that what you are meaning?

Link to comment
Share on other sites

Field Type Null Key Default Extra

coupons_id varchar(32) PRI

coupons_description varchar(64)

coupons_discount_percent decimal(7,4) YES NULL

coupons_date_start datetime YES NULL

coupons_date_end datetime YES NULL

max_use int(3) 0

min_order decimal(15,4) 0.0000

Is that what you are meaning?

 

Yes so your date_start is definately called coupons_date_start, I bolded it above in your quote.

 

Just try the query

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit 0, 20

that should work

Link to comment
Share on other sites

Yes so your date_start is definately called coupons_date_start, I bolded it above in your quote.

 

Just try the query

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit 0, 20

that should work

 

 

Still get this error

 

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

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

 

[TEP STOP]

 

I think I am doing something wrong but have no idea what.

Link to comment
Share on other sites

Hi

 

Is there a way to get this contribution to work with the PayPal IPN module when using the 'Per Item' option in PayPal?

 

Currently the discount is only applied if I choose to send the items to PayPal using the 'Aggregate' mode. I would much rather use the per item option although this means the discount that was applied by Discount Coupon Codes is not passed onto PayPal.

 

I see in the contribution history someone may have managed to do this although that was back in December 2006 and using PayPal IPN version 1.4. Currently the module is on version 2.3 So I doubt it would work now.

 

Does anyone have a solution to this?

 

Thanks,

 

Ben

Link to comment
Share on other sites

I installed Discount Coupon codes last night, I got most of it up and running including the admin panel and setting up coupons, but when I actually go to open the catalog I get the following error:

 

Warning: main(includes/filenames.php): failed to open stream: No such file or directory in /home/code72ne/public_html/osCommerce/catalog/includes/application_top.php on line 53

 

Warning: main(includes/filenames.php): failed to open stream: No such file or directory in /home/code72ne/public_html/osCommerce/catalog/includes/application_top.php on line 53

 

Fatal error: main(): Failed opening required 'includes/filenames.php' (include_path='.:/usr/local/lib/php') in /home/code72ne/public_html/osCommerce/catalog/includes/application_top.php on line 53

 

 

can anyone help me?

 

Thanks

Erik

Link to comment
Share on other sites

Works Great... One problem though....

 

When I have two items in the cart (one from my 'exclusions' list, and one that I can use a coupon with), my coupon code box does not show up.

 

I get a coupon code option if ALL of the items in the cart are eligible for the coupon. But one non-eligible item makes the coupon option disappear completely.

 

Any thoughts on this problem?

 

Thanks

Link to comment
Share on other sites

just a small update - all is working fine. just for future reference to anyone who encounters the same issue. This is NOT an issue with SQL simply a case of missing admin files.

 

basically as a last resort before removing it, I went through and made sure all the files were copied over and refresh my admin page to check things were working or not working. I have no idea which file was causing the problem as it asked to overwrite each one but whatever happened it is now working!!!!!

 

it feels good having it working and I know NOTHING about coding!!!

Link to comment
Share on other sites

Hi,

 

All seems to be working good except EXCLUSIONS.

 

None seem to be working.

 

I created a discounted shipping code for 1 product. I excluded all other manufacturers, categories and products.

 

But I can apply the code to all products.

 

Thanks.

Link to comment
Share on other sites

Still get this error

 

Discount Coupons

1054 - Unknown column 'cd.date_end' in 'order clause'

 

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

 

[TEP STOP]

 

I think I am doing something wrong but have no idea what.

 

 

date_end and date_start are not the names of the fields so anywhere you see that you will get an error

it needs to be coupons_date_start and coupons_date_end

 

where are you getting these incorrect queries from?

Link to comment
Share on other sites

date_end and date_start are not the names of the fields so anywhere you see that you will get an error

it needs to be coupons_date_start and coupons_date_end

 

where are you getting these incorrect queries from?

 

 

Thought I had posted but I have fixed this problem and the problem was NOT with SQL but a file hadn't uploaded correctly and was coursing the problem.

Link to comment
Share on other sites

This is a wonderful contribution. You did an awesome job!!! =)

 

I was wondering if there is a chance that somehow there will one day be an addition to this contribution, such as an automatic discount after a certain minimum price is achieved at checkout? And not having it entered manually by a customer.

 

I'm currently looking for this right now, such as 15% off any order $35.00 and over. However, I'm not having any luck.

 

Any help would be greatly appreciated!!!

 

Have a wonderful day!

Link to comment
Share on other sites

Hi all, kgt this is a fantastic contribution, nice work.

 

I'm having a slight problem with it though, the codes work fine, everything works brilliant throughout the shop, BUT when looking at the orders in admin, all orders that have had the discount code applied do not show the order confirmation, comments etc. boxes. The order cannot be edited from pending to delivered, which is a problem.

 

Have I missed soemthing from the install, or is this a common thing. Is there a way I can get the order edit selection back, as it is fine with all orders not placed with a discount, only with orders placed with a discount do I lose the comments table

 

Any help would be great

 

Sorry to have to post this again, but it's driving me nuts. I just can't figure out why anything that has had a discount applied to it cannot be edited afterwards... Please Help me Guys

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