Jump to content
Latest News: (loading..)
Sign in to follow this  
burt

Support for Discount Coupons by Burt

Recommended Posts

It's getting too unwieldy to continue support of my discount coupon contribution on my blog. Henceforth, this thread will be used for Support.

 

Download Link: http://www.oscommerce.com/community/contributions,5743


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

Great contrib.. I have a prob and searched but couldn't find anything.

 

I am having trouble with trasactions that are less than the coupon amount.

IE. Order total is 33.50, coupon is for $50

 

I tried ordering the coupon after the shipping, before the shipping, same thing...

It wants to give a credit, and fails saying "this transaction cannot be processed. The amount to be charged is zero".

 

Sub-Total: $33.50

Coupon (xxxx) -$50.00

5-7 day Standard Shipping (Standard Shipping (FREE shipping on orders over $75 in the continental US!)): $12.00

FL TAX 6.0%: $2.01

Total: $-2.49

 

 

Anyone having the same problem? Any fix?

 

Do we just have to add a check when adding up Total:

(in pseudocode)

if subtotal - coupon is less than 0, set subtotal == 0

Is this proper/safe??

where would i need to add this?

Edited by mastro97

Share this post


Link to post
Share on other sites

In the version that you are using, you would need to add an extra check as you say. An idea would be to set the coupon discount to be the SAME amount as the subtotal, if the coupon discount is greater than the subtotal.

 

Add this in includes/modules/order_total/ot_coupon.php

 

Pseudo Code:

if (X > Y) X = Y

 

X = coupon_discount amount

Y = subtotal


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

I would like to be able to stop discounts on products which are designated as not permitted for discount, maybe using a custom field or something from the database, or failing that listed in the specials section of osc.

 

I'm a complete novice so I'm not really sure where to start with this - any ideas would be welcome.

 

Many thanks in advance.

Share this post


Link to post
Share on other sites

There is a different coupon system which might suit you, have a hunt in the contributions section.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites
There is a different coupon system which might suit you, have a hunt in the contributions section.

 

Thanks,

 

I have tried to install a couple of these already but this is the only one I can get to work!!

 

The contribution which looks as though it woule be perfect seems to be corrupt as i cannot unzip it!

Share this post


Link to post
Share on other sites

My contribution is certainly the easiest to install of all the discount coupon mods.

I don't have any plans to enable product based discounts though, sorry.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

I've downloaded and installed this contribution and it all seems to function fine. I've watched the YouTube vid and it looks very straightforward from the purchasing side of things. Only there's one thing that's puzzling me, and maybe it's a really stupid question, but how does the customer get the gift voucher/discount code in the first place?

 

I want to have gift vouchers to purchase online so they can be given as a gift to someone else to use in the store. How do I do that?

Share this post


Link to post
Share on other sites

The GV purchasing is a fuure addition to this, which I am working on as time/cash permits. You have to manually send the code to your buyer.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites
The GV purchasing is a fuure addition to this, which I am working on as time/cash permits. You have to manually send the code to your buyer.

 

Ah OK. Thanks for clarifying that. I'll look forward to the purchasing addition.

Share this post


Link to post
Share on other sites

This fix avoid that customer who have coupon amount 100$ and order 50$ don't see -50$ as total:

 

in catalog/includes/modules/order_total/ot_coupon.php find

$order->info['total'] -= $coupon_discount;

 

and change to

 

if($coupon_discount>$order->info['total']) $coupon_discount=$order->info['total'];
	$order->info['total'] -= $coupon_discount;

Share this post


Link to post
Share on other sites
This fix avoid that customer who have coupon amount 100$ and order 50$ don't see -50$ as total:

 

in catalog/includes/modules/order_total/ot_coupon.php find

$order->info['total'] -= $coupon_discount;

 

and change to

 

if($coupon_discount>$order->info['total']) $coupon_discount=$order->info['total'];
	$order->info['total'] -= $coupon_discount;

 

That would work fine.

 

The proper fix is included in the latest version, which allows users to insert a minimum spend per coupon.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

Hi

in catalog/includes/modules/order_total/ot_coupon.php, Could this be wrong:

39		$this->output[] = array('title' => TEXT_COUPON . ' (' . $_SESSION['coupon_code'] . ')',
40								'text' =>  '-' . $currencies->format($coupon_discount, true, $order->info['currency'], $order->info['currency_value']),
41								'value' => '');

I suspect it should be like this:

39		$this->output[] = array('title' => TEXT_COUPON . ' (' . $_SESSION['coupon_code'] . ')',
40								'text' =>  '-' . $currencies->format($coupon_discount, true, $order->info['currency'], $order->info['currency_value']),
41								'value' => $coupon_discount);

 

Eveline

Share this post


Link to post
Share on other sites

Covered already in the old support thread.


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

hey burt. Interested in getting the Gft Voucher part of this up and working.. I just realized that there is NO contribution for PRINTABLE gift vouchers. Soemthign with a voucher ID that you can have printed and sent out to the customer..

 

and interest?? I'm happy to "sponsor" it


A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Share this post


Link to post
Share on other sites

Hi there,

 

I'm getting the following error when I press the confirmation button on the confirmation page in the checkout. I don't know what I did wrong? Everything is working fine until I want to complete the order. Thanks

 

 

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 'to customer (coupon_id, customer_id, order_id, redeem_date) values ('4', '2', '6' at line 1

 

insert into coupons to customer (coupon_id, customer_id, order_id, redeem_date) values ('4', '2', '64', now())

 

[TEP STOP]

Share this post


Link to post
Share on other sites

oh by the way I also have a bunch of contriubtions added such as SPPC and QTPRO as the main ones..I also have this other contribution where it has a price break for shipping discount...so orders over $300 gets free shipping.

 

 

Hi there,

 

I'm getting the following error when I press the confirmation button on the confirmation page in the checkout. I don't know what I did wrong? Everything is working fine until I want to complete the order. Thanks

 

 

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 'to customer (coupon_id, customer_id, order_id, redeem_date) values ('4', '2', '6' at line 1

 

insert into coupons to customer (coupon_id, customer_id, order_id, redeem_date) values ('4', '2', '64', now())

 

[TEP STOP]

Share this post


Link to post
Share on other sites

Could be any number of things causing issues on a highly modified shop. You'll need to investigate further.

 

Probable: "coupons to customer" should read "coupons_to_customer" - so look in includes/database_tables to make sure that all is correct.

 

Linds - interesting. My thought would be to have a "print" button on the coupon page, which opens up a graphic on which the details of the coupon are added (coupon code, coupon amount, coupon expiry date, coupon usage). That would work well, I think and is (in theory) quite an easy addition. Would that be suitable?


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

actually, the PRINTABLE coupon page is a GREAT idea, but not what i was thinking.. Although it would be awesome for other people's websites.

 

I am talking about the gift vouchers. I dont THINK your code right now even HAS gift vouchers yet, correct?? Just the coupon codes.. I was just saying, the other big coupon and gify voucher contibute (CCGV) does not allow for printable, REAL vouchers. This is a HUGE fault. The vouchers arent given an id that can be printed and are automatically put into an "account" of sorts.. I dont know. I am just looking for an option that allows me to print really nice gift cards because we do wedding gifts, and people like nice cutesy things like that


A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Share this post


Link to post
Share on other sites

Ah - ok. No, I don't have the GV part coded up yet.

 

My idea for that is to allow the shop owner to make new product(s) of varying amounts, eg: $25, $50 etc etc. And to have the "model" as GIFT on all Gift Voucher products.

 

Now, somewhere in the logic, I will pick up the model of each product in the cart and if it is "GIFT", will create a coupon code of the right amount, expiry date, minimum purchase etc.

 

Next up would be to use PDF to create a visual voucher which can be printed off at the end of the checkout procedure, or from within the buyers account.

 

Of course, all that is fine in theory, but in practice, well you know exactly how busy I am! And each extra idea brings into play more problems. Eg, I'd need to update the PDF visual image with a "USED" banner once it's used - we don't want them printing it off again.

 

Lots to think about...


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

actually, if you had a specific ID for each gift voucher purchased, they can print off as many times as they want, but they will ONLY be allowed to use it once.. Like it the grocery store, there are LOADS of giftcards on racks for sale.. someone COULD steal them, but they wouldnt work because the gift vouch ID number is not associated with an amount yet.. And with this, the ID is associated with an amount, and once the amount is used up, they acnt use it.. not matter HOW many tmes they print it.

 

Does this make sense? I hope it does..

 

The PDF idea is great, but if you can get the IDs working similar to that of a coupon, but instead of the coupon only working on the one single purchase, if the value of the "coupon" (in this case the gift vouch) is not met, there is a balance for them to come back and use the same code or ID to finish off the balance on their next purchase. THIS is the way my logic tells me it should be done.. similar to a coupon code.. BUT it would need to maintain a balance if it wasnt used all in one shot.

 

I hope this all makes sense.


A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Share this post


Link to post
Share on other sites

Are there any known issues of this not working with paypal? We have a customer who we switched over from CCGV to this and when using paypal express checkout (her only processor) the discount is not reflected in the total.


-Rebecca

 

If at first you don't succeed, try, try again.

Share this post


Link to post
Share on other sites

No known issues with Paypal Express.

Is that the one that doesn't need to go through the checkout procedure?


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
Share on other sites

No this is the one that goes from checkout_payment to paypal then back the checkout_success... The one that Brian Burton wrote up.

 

Do you have time to do an install on this site for us? By the way, how are you?

 

-Rebecca

 

No known issues with Paypal Express.

Is that the one that doesn't need to go through the checkout procedure?


-Rebecca

 

If at first you don't succeed, try, try again.

Share this post


Link to post
Share on other sites

Yeah, good thanks...how you guys?

 

You probably need to include the coupon class in the express.php file, and mess about with the IPN file in /ext/ as well. basically, you need to add in the coupon bits from checkout_process to the IPN. And be sure the coupon class is in the other file so the order_totals are updated.

 

I'm not familiar with Brians version...


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest current code (community-supported responsive 2.3.4.1BS Edge) here

 

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
Sign in to follow this  

×