Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Anybody having a store with prices including tax or discount coupons with restrictions and having problems with DC/GV contribution?

 

I have found a couple of bugs in "modules/ot_coupon.php" regarding the above case and even cases for shops displaying prices excluding taxes. The thing is that discount coupons with restrictions didn't calculate the discount and tax correct. There were some fundamental bugs in this part. I also fixed some "corrections" to Credit Note, i.e some corrections before was not correct. ;)

 

I have also added a "debug" flag in the class so you can follow the calculation of deduction, tax etc. This is a very nice feature.

 

I am not sure if it's just me or others are having the same issus, so please PM me if you would like to test this modified class. Then when confirmed we can add it to this great contribution!

 

/Fred

Hi Strider,

I am in a helpless situation

I have installed Credit class Gift voucher (ccgb-510b). I am facing probelms in coupon discount calculation for coupons with category restrictions. Let me explain this with an example

 

1. suppose I have a coupon with 10% discount on products of a particular category (that is coupon is restricted to particular category).

 

2. Now for normal products (that is products without any attributes ) under that category ,the coupon works perfect. But if i try to use the coupon for product with attributes then wrong calculation of discount amount is done.

3. i debugged the code in the file (ot_coupon.php in the modules directory)

4. I found out that the problem was in the function get_product_price()

Here on the line $qty=$cart->contents[$product_id]['qty'] , the

value of $qty was getting a blank value. This means that the variable $cart-> contents[$product_id]['qty'] is null.

5. Due to this, the variable $total_price on the line given below becomes 0.

$total_price += ($products_price + tep_calculate_tax

($products_price, $products_tax)) * $qty;

 

6. For normal products(that is, products without attributes) the $qty gets proper value and everything works fine.

 

 

7. I WOULD BE GRATEFUL TO YOU IF U HELP ME IMMEDIATELY cause i cant wait for future releases for thiese bug fixes.

PLEASE....

8. infact if anybody out there can help it would be great :)

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

Anybody having a store with prices including tax or discount coupons with restrictions and having problems with DC/GV contribution?

 

I have found a couple of bugs in "modules/ot_coupon.php" regarding the above case and even cases for shops displaying prices excluding taxes. The thing is that discount coupons with restrictions didn't calculate the discount and tax correct. There were some fundamental bugs in this part. I also fixed some "corrections" to Credit Note, i.e some corrections before was not correct. ;)

 

I have also added a "debug" flag in the class so you can follow the calculation of deduction, tax etc. This is a very nice feature.

 

I am not sure if it's just me or others are having the same issus, so please PM me if you would like to test this modified class. Then when confirmed we can add it to this great contribution!

 

/Fred

It seems no one is interested in clearing my problem not even Strider.

Maybe Fred if you could send ur modified ot_coupon.php or solve my problem then that would be great :)

Link to comment
Share on other sites

I recently installed this contribution and was wondering if anybody knows how to handle this situation..

 

I create a discount coupon for products in a specific category. Let's say it was 10% off any item in category X. Now the customer buys an item from Category X but also buys an item from another category. How do you make sure that the discount only applies to the item from that category, not the entire order?

 

Do most people take the discount off the item/product only or the entire order?

Link to comment
Share on other sites

I don't think it's better if you don't want to promote sale prices on your site. The whole point to me is that you can track coupon usage and reward certain customers with a coupon instead of making a whole category a sale open to the public.

Link to comment
Share on other sites

I would really appreciate some help on this.. I recently installed this contribution and thought it was working perfect.. I created a coupon to give my customers free shipping and called the coupon FREESHIPNOW. Here is an order that recently came in:

 

Sub-Total:  $25.00

(Standard Shipping):  $5.95

Discount Coupons:FREESHIPNOW:  $5.95

Total:  $25.00

 

From the admin side it looks fine but when I received my email receipt from Authorize.net I noticed that the amount was different ($30.95) which means the free shipping/discount isn't really working..

 

Any ideas on how to fix this?

 

Thanks.

Anyone have any advise on this? I'm running into the same problem.

 

Place an order where the total is $17.98, enter a discount coupon for $10.00 giving a total of $7.98. Press submit, authorize.net charges the $17.98, yet in the admin interface it's showing total price of $7.98 and that the discount has been applied.

 

I'm running OSC Dox MS-MAX1.5.5 and this has the discount contribution.

 

This is driving ME CRAZY!! and costing lots in refunds that we need to submit to clients. Refunds is like 3.9% of the total refund that they are billing us. :((

 

I read that this is a fast fix and willing to pay someone to fix it if they can.

Link to comment
Share on other sites

I've just begun to use this contrib myself and I don't use the authorize.net one either, but it sounds like not all the order total lines are getting sent to authorize.net. Discounts and Gift Certificates have their own classes in order total (ot_gv and ot_coupon) table. I would look to see what records are being sent to authorize.net -- sounds like it isn't grabbing those...

 

don't know if that would help, but I thought I'd throw it out there just in case....

 

-Dionn

Link to comment
Share on other sites

Hello to all who are having difficulties with Credit Class and Authorize.net...this contribution will NOT work.

 

The discount isn't really being applied the way it should...if you check your database in the orders_total table, you'll see that the amount total is NOT a discounted amount. This is the number being sent to authorize.net. The problem is not with the authorize.net mod it is with the credit class mod.

 

If you continue to use the credit class mod with authorize.net, you'll end up having to contact every customer who uses a discount coupon in order to get their credit card number, delete the original order and place a new order. FRUSTRATING??!!! You bet!

 

I spent weeks investigating this, going through every forum, and it has been a problem since day one - one that has not yet been resolved. There are two workarounds that I've found, the first one was posted on the forum earlier (can't remember who, sorry! but it works).

 

Option (1) ------ Add a new item to your catalog with a negative amount that reflects the discounted total you want to apply. When placed in the shopping cart, it will be deducted from the overall order, appear correctly in the total amount in the orders_total table and go through to authorize.net at the correct amount.

.

Option (2) --Offer (2) checkout options - one using authorize.net for orders that are not discounted and the other using the basic credit card checkout, so you can capture the credit card number and submit the discounted total to authorize.net manually.

 

Since we'd already sent out hundreds of discount coupons with individual codes, I use the second option and it has worked fairly well. Just make sure you either split the cc info or delete the cc number from the db ASAP. Important security.

 

Looking forward the day when a real solution presents itself. Good luck and hope this helps! :)

Link to comment
Share on other sites

I must be missing something because when I look in the orders_total table the line item with class = ot_total contains the amount that includes the discount. Am I not reading that correctly?

 

-Dionn

Link to comment
Share on other sites

You know my motto is "festina lente" (hasten slowly) - I should have taken my own advice!!!

 

Anyway, I apologize if I managed to completely confuse anyone with my table comments. D'oh! I MEANT to say (if I'd stopped to think about it) that the total in the table displays correctly, and it displays in the admin area correctly but it is NOT the total sent to authorize.net (and other gateway processors).

 

I went nuts (obviously) trying to figure out where the actual total being sent for processing was coming from.

 

Also, I do appreciate the work put into this mod. I just wish I knew how to make it work with authorize.net and despite the many, many postings on this topic no real solution has been presented.

 

Again, apologies for the misinformation - blame it on Monday, lack of sleep and bronchitis. Mea culpa.

Link to comment
Share on other sites

I am haveing problems with the e-mail aspect after i installed the credit class & gift voucher 2.2.2 it not that i can't send mail but it send 2 of the same thing. when a new user registers it when i send out and e-mail or news letter

 

can anyone help me resolve this issue please

thanks in advance

 

Hershal T'Vaden

The world is round, It has no point!!!!

Link to comment
Share on other sites

BearHappy: I think there was a bug fix for this.

http://www.oscommerce.com/community/bugs,1629 I can't go in and fix every payment process or gateway process that isn't stock. There is a post earlier in this forum that explains it, though I think it is a little off.

 

 

indian_druid: It will be about 3 weeks at least before I have time to look at it.

 

blueheart: yes when you create a coupon you can put it explicitly for products or categories. There has been talk that there is a bug with this specific item but this was specifically tested many hours by a few different people and it seemed to work fine.

 

 

Gunshot: Please refer to post for bearhappy above.

 

dionn: thank you for the help but you are wrong. it is in checkout_process.php please refer to the post above. It can also be in the sort order, the payment procecess code that was written separately or a host of other things.

 

 

hershal: I think you need to go over your install again. You either mistyped or something

 

damn that was easy

(my knowledge is so small you would think that an ant was a genius in comparison)

Link to comment
Share on other sites

karen_l - the problem you're having has been discussed and fixed in the support thread for the authorize.net contribution. The lastest version of that contribution fixes the problem.

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Link to comment
Share on other sites

karen_l - the problem you're having has been discussed and fixed in the support thread for the authorize.net contribution.  The lastest version of that contribution fixes the problem.

the problem is not with authorize.net it is with checkout_process. it processes the payment module before_process() (which direct connection modules use to send payment info) before it processes the order_total modules (so any ot_modules besides the standard subtotal, tax, shipping, & total will not be processed prior to sending payment information).

 

ok actually the authorize.net AIM module places a call to authorize_direct.php; however that placing is based on the location of the call to before_process() (which other modules use to direct connect), which is logically incorrect.

 

And actually if you want to get right to it, the contents of authorize_direct should be inside the authorize AIM module's before_process() function. Otherwise, an attempt to send the transaction data to auth.net is made everytime checkout_process is called.

Edited by dreamscape

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

dreamscape, if its alright I have posted your fix to this issue with users using a direct connection payment method. ;)

 

 

This problem exists in all osCommerce version since at least Nov 2002.

 

There is a pretty big logic error in checkout_process.php. We discovered this the other day in our osCommerce stores (circa MS1) and I downloaded both osCommerce MS2 and the CVS, both of which also have the error.

 

The problem is encountered with payment modules who use checkout_process.php as the page they submit their form to. This is mostly used for making connections to credit card processors in the background via curl, etc (authorize.net AIM/ADC, ECHO Inc, etc). In these types of payment modules where the connection is made in the background using checkout_process.php as the payment's form URL, the order information is usually sent to the processor in the payment module using the before_process() function.

 

However, there is a logical flaw in checkout_process that prevents any 3rd party order_total modules such as discount coupons, bulk discounts, etc from being sent to the credit card processor. The discount shows on the website to the customer and also shows in the database to the admin, however, is not passed onto the processor and the customer is actually charged the full amount of the order without the discounts. I know osCommerce does not officially support discounts and other 3rd party order_total modules; however, that is completely irrelevant as the error is in checkout_process's logic.

 

Now, here is the simple logical error. When using direct connection methods to payment processors, the before_process() function can be seen as the "process payment" function, whereas in payment modules that use a 3rd party's form URL, the process_button() function can be seen as the "process payment" function. With direct connection type payment modules, the basic logical layout of checkout_process.php can be viewed as:

-> create new order

-> process payment

-> process order_total modules

-> insert order into dB

 

The middle 2 are backwards. The order_total modules should be processed before the payment is. When using 3rd party form URLs this is not a problem, and maybe why it has gone so long unreported and unfixed, because in the case of 3rd party form URLs the payment is processed before it gets to checkout_process.php, so it appears correct, though fundamentally still incorrect.

 

The processing of the order_total modules should come before the processing of the payment. That I know of, this logical error effects the authorize.net AIM/ADC module and any other current or future payment modules using direct connection methods. ECHO is technically not effected, but only because the ECHO module passes the correct $order->['total'] value already processed by the order_total modules from checkout_confirmation.php to checkout_process.php for use in the before_process() function to process the payment. However, not all direct connection method modules do this (auth.net AIM/ADC does not) and nor is it really necessary to repost all of the order and order_total data either, since with direct connection payment modules it goes straight to checkout_process for processing, instead of going to a 3rd party form URL and then checkout_process.

 

For those using direct connection method payment modules, here is a fix. In checkout_process.php, change the following lines:

 

CODE 

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

// load the before_process function from the payment modules

$payment_modules->before_process();

 

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

 

 

 

to this:

 

CODE 

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

// load the before_process function from the payment modules

$payment_modules->before_process();

 

 

 

 

 

For those using the auth.net AIM/ADC module you will also need to move the call to authorize_direct.php to after the order_total modules are processed.

 

 

This has been submitted to the bug reporter and will hopefully be fixed in CVS sometime soon, but since it affects all osCommerce versions since at least November 2002, I figured I would post it here as well with a fix for those of us using direct connection payment modules (auth.net AIM) and 3rd party order_total modules.

Link to comment
Share on other sites

Strider et al,

 

We run a high profile osCommerce shop and the one major area of missing functionality is to allow discount / coupon codes for privillaged shoppers.

 

Do you have any examples of live shops using this module? How 'stable' is it? We've just sorted out one persistant problem with Worldpay integration, so we are looking for a discount module that gets the basics right!

 

Looking forward to your reply,

 

Regards,

Dave

Link to comment
Share on other sites

OK i did a complete reinstall of everything following the instructions to a T and when in install osC it only sends on e-mail but after i install ccgv 5.10 it sends two

 

what am i doing wrong

 

www.hershaltech.com/catalog/

The world is round, It has no point!!!!

Link to comment
Share on other sites

I have been using credit class gv dc v5.05, I want to upgarde.

There seems to be a security risk I have noticed in this version v5.05, I wonder if this has been fixed in the updates.

 

The problem I found was concerning the incentive to open an account. Ie $10 gv

 

I sign up for 3 account and then gave the vouchers to 4th ,

 

the 4th account had $40 and was able to make a free purchase.

 

I have not tested the discount, maybe this is ok?

The % dc that is emailed is the same code everytime, does this apply to a new account only once?

 

Another possable security risk, If someone generated a script to grap the $10 discount codes from a site, they could then use them on a bogus account to make free purchases. do you think this is possable? its a scary thought!

Maybe they would use telnet or something, I have read there is some email risk with telnet but thats another story.

I'm a newby and using max version.

I think credit class is great mod, but am scared of using it.

I found a way to stop the email voucher incentive But does this fix all the risks

Link to comment
Share on other sites

I have been using credit class gv dc v5.05, I want to upgarde.

There seems to be a security risk I have noticed in this version v5.05, I wonder if this has been fixed in the updates.

 

The problem I found was concerning the incentive to open an account. Ie $10 gv

 

I sign up for 3 account and then gave the vouchers to 4th ,

 

the 4th account had $40 and was able to make a free purchase.

 

I have not tested the discount, maybe this is ok?

The % dc that is emailed is the same code everytime, does this apply to a new account only once?

 

Another possable security risk, If someone generated a script to grap the $10 discount codes from a site, they could then use them on a bogus account to make free purchases. do you think this is possable? its a scary thought!

Maybe they would use telnet or something, I have read there is some email risk with telnet but thats another story.

I'm a newby and using max version.

I think credit class is great mod, but am scared of using it.

I found a way to stop the email voucher incentive But does this fix all the risks

Link to comment
Share on other sites

I have been using credit class gv dc v5.05, I want to upgarde.

There seems to be a security risk I have noticed in this version v5.05, I wonder if this has been fixed in the updates.

 

The problem I found was concerning the incentive to open an account. Ie $10 gv

 

I sign up for 3 account and then gave the vouchers to 4th ,

 

the 4th account had $40 and was able to make a free purchase.

 

I have not tested the discount, maybe this is ok?

The % dc that is emailed is the same code everytime, does this apply to a new account only once?

 

Another possable security risk, If someone generated a script to grap the $10 discount codes from a site, they could then use them on a bogus account to make free purchases. do you think this is possable? its a scary thought!

Maybe they would use telnet or something, I have read there is some email risk with telnet but thats another story.

I'm a newby and using max version.

I think credit class is great mod, but am scared of using it.

I found a way to stop the email voucher incentive But does this fix all the risks

Link to comment
Share on other sites

Hello all:

 

I have install cc_gv_dc 5.05 on osc 2.2 MS2 and am having a bit of a time getting the purchase of a gift voucher to not nclude shipping. I was under the impression that if a weight of 0 was set for the item then when checking out for just a gift voucher shipping would be bypassed. Any thoughts on this. Btw I did not see any problems like this on the forums but I just did a brief look thorugh, so I apologize if this has been covered already.

Link to comment
Share on other sites

Hello all:

 

I have install cc_gv_dc 5.05 on osc 2.2 MS2 and am having a bit of a time getting the purchase of a gift voucher to not nclude shipping. I was under the impression that if a weight of 0 was set for the item then when checking out for just a gift voucher shipping would be bypassed. Any thoughts on this. Btw I did not see any problems like this on the forums but I just did a brief look thorugh, so I apologize if this has been covered already.

Why install 5.05 and not Striders 5.10b with fixes? You'll save yourself some headache =D

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