Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Has anybody ever had a problem with disappearing orders? I have now received two orders that have disappeared out of OSCommerce. I am not sure if it is being caused by the coupon mod, or if it is a problem in OSCommerce itself. So I figured I'd ask here. The only reason I knew there were orders were the receipts I received from PayPal. I had to e-mail both people to see exactly what their order was. They both had accounts, but both showed 0 orders placed. Anybody have any ideas? Thanks a bunch!

Sean Gum

Magnificent Money Affiliate Program - www.magmoney.com

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

seangum...

 

Could it be possible the person's placing the order through paypal didn't hit the "continue" button to complete the process and come back to your site? I believe, from what I have read, that oscommerce doesn't "save" the order until the person clicks "continue" on paypal's site.

 

Someone correct me if I'm wrong.

 

I'd recommend using paypal's IPN. I installed the paypalipn_v0981_for_milestone_2 mod. I haven't used the paypalipn mod yet, so I don't know if it's any good.

 

Hope this helps,

S. Cole

Link to comment
Share on other sites

Finally!!! :)

 

I have this mod installed and working!!! I had to go through each file manually and compare the my copy to that of this mods (didn't install from scratch). There was a few minor things that was missed or done incorrectly that overall caused problems.

 

For anyone wishing to compare two files, I HIGHLY recommend this program:

 

ExamDiff (http://www.prestosoft.com/ps.asp?page=edp_examdiff)

 

It's easy to use and works extremely well.

 

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

New Problem / Question:

 

Now that I have the mod up and running, I have a problem/question! :)

 

I created a coupon named "WIN2020". I then went and deleted the coupon which placed it under the "Inactive" section. Later I tried to create a new coupon using the same name "WIN2020" which stated that a coupon by that name already existed (which it did, under inactive).

 

I tried to delete the coupon under "inactive" and it wouldn't work. Tried to edit the coupon to make it active again and was unable to find anything.

 

How do I go about either deleting the coupon completely, or enabling it again to reuse?

 

Thanks,

S. Cole

Edited by scole
Link to comment
Share on other sites

Wow has this thread gotten BIG...

 

My answer might be here but I am just reading and reading and reading...

 

I am using redit Class/Gift Voucher/Discount Coupons 5.05 and I can't purchase with just the GV. I have not been able to fix w/ I an's suggestion.

 

Any ideas? or do I have to try and install 510b??????

 

On my localhost cookies is disabled will this affect this?

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

I must be using the newest one....

 

I found that ll of the changes listed here:

-- catalog/checkout_process.php --

LOCATE this...
require(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment($payment);

REPLACE with this...
require(DIR_WS_CLASSES . 'payment.php');
if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
$payment_modules = new payment($payment);

LOCATE this...
$order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM

ADD this above it...
if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');


-- catalog/checkout_payment.php --

LOCATE this...
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
  if ($cart->cartID != $cartID) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  }
}

ADD this AFTER it...
// if we have been here before and are coming back get rid of the credit covers variable
if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  //ICW ADDED FOR CREDIT CLASS SYSTEM


-- catalog/includes/classes/order_totals.php --

LOCATE this function...    function collect_posts() {

LOCATE this line...
            $post_var = 'c' . $GLOBALS[$class]->code;

REPLACE with this line...
            $post_var = 'c_' . $GLOBALS[$class]->code;

          
LOCATE this line...
            if (!tep_session_is_registered('post_var')) tep_session_register('post_var');
          
REPLACE with this line...
            if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

                      
LOCATE this function...    function pre_confirmation_check() {

LOCATE this...
        if ($order->info['total'] - $total_deductions <= 0 ) {
          $credit_covers = true;
        }

REPLACE it with this...
        if ($order->info['total'] - $total_deductions <= 0 ) {
 if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
          $credit_covers = true;
        } else {   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
    if (tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); 
  }
          

LOCATE this function...    function clear_posts() {

LOCATE this line...
            $post_var = 'c_' . $GLOBALS[$class]->code;

REPLACE with this line...
            $post_var = 'c' . $GLOBALS[$class]->code;

          
LOCATE this function...    function get_order_total_main($class, $order_total) {

LOCATE this...
      if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
      if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];
          
REPLACE it with this...
//      if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax'];
//      if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];


-- catalog/includes/classes/payment.php --

LOCATE this function...    function pre_confirmation_check() {

ADD this ABOVE it...
//ICW CREDIT CLASS Gift Voucher System
// check credit covers was setup to test whether credit covers is set in other parts of the code
  function check_credit_covers() {
 global $credit_covers;

 return $credit_covers;
  }

were already done....?

 

So any ideas why I cant order with just the GV???

osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Link to comment
Share on other sites

Strider...

 

Well, deleting them it not necessary, however I would like to be able to reuse them. For example, if I had a coupon named "CHRISTMAS" for a christmas special coupon (free shipping, discount, whatever).

 

I would like to be able to use the same coupon again next year, I wouldn't want to have to think of names like "XMAS2003", "XMAS2004". I would like to be able to just edit the old coupon, update the dates, values, etc. and reactivate it. - or - I would like to be able to delete it completly and next year, just create a new coupon with the same name. either way would be fine.

 

If you think, I shouldn't delete the coupon (I guess for tracking purposes), then a way to edit, update, and reactivate would be excellent.

 

Any suggestions?

 

S. Cole

Link to comment
Share on other sites

Hello,

I have browsed through most of this forum but have not found any request for the following modification:

 

Basically I need to modify both the discount coupon and credit voucher to subract from the sub-total rather then the total.

 

REASON: When using Linkpoint API the sub-total, shipping, tax, and total must match for the order to be processed.

 

I need some expert help on this to be able to update my Linkpoint Cardservice contribution at:

 

http://www.oscommerce.com/community/contributions,596

 

There was a member who submitted a hack to me that I included in the contribution. However, now I started using the GV contribution myself and I noticed some flaws in this hack.

 

First of all. This member's hack seems to work fine when using only one of the g.voucher or dicount coupon. But if the customer tries to use both with the same purchase the amounts don't add up properly.

 

This was the solution that the other member sent me and that I included in the Linkpoint contribution:

 

Simple really, just had to figure out the "PHP" way to do it.  Just a couple of edits so I won't include full files.

In /catalog/includes/modules/order_total/ot_coupon.php:

  Find lines:

     if ($od_amount > 0) {
     $order->info['total'] = $order->info['total'] - $od_amount;
  
  Add this line right after:

     $_SESSION['od_amount'] = $od_amount;

In /catalog/includes/modules/ot_subtotal.php:

   Find lines:

     function process() {
     global $order, $currencies;

   Add right after:

     $od_amount = $_SESSION['od_amount'];
     $subtotal = $order->info['subtotal'] - $od_amount;
     $order->info['subtotal'] = $order->info['subtotal'] - $od_amount;

Then, make sure the sort order of the payment lines (via OSCommerce admin
site) puts discount before subtotal.

Essentially, I just used the global PHP session to make the discount amount available in the standard subtotal routine.  There may be 
more correct ways to do it but it works.

 

The reason why this doesn't work is that when you add the same session function:

 

$_SESSION['od_amount'] = $od_amount;

to the ot_gv.php only the first is beeing picked up for use.

 

I have now tried various ways, but nothing seems to work. This was one thing I tried:

 

   //ONE WAY TO DO IT added hack to put cv and discount before sub-total TN
  //$od_amount_coupon = $_SESSION['od_amount_coupon'];
  //$od_amount_gv = $_SESSION['od_amount_gv'];
     //$subtotal = $order->info['subtotal'] - $od_amount_coupon - $od_amount_gv;
     //$order->info['subtotal'] = $order->info['subtotal'] - $od_amount_coupon - $od_amount_gv;
  //EOF hack

 

and the codes I added to the ot_gv.php and ot_discount.php were:

 

$_SESSION['od_amount_coupon'] = $od_amount;

 

and

 

$_SESSION['od_amount_gv'] = $od_amount;

 

Now this actually worked but then I realized that for some reason when dealing with the session function. The discounts would try to register when I came back (without me even choosing the (ticking the box)).

 

Another thing I tried was to change where the GV's were subtracting from the total:

 

from:

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

 

to

$order->info['subtotal'] = $order->info['subtotal'] - $od_amount;

 

and this put the proper sun in the subtotal each time. However now the total didn't add up right.

 

So what to do? How is the total added up? Could I not change the total to calculate itself according to the discounted sub-total?

 

I would GREATLY appreciate any advice!

 

Thanks,

 

Thomas

Link to comment
Share on other sites

Hmmm...

 

It's strange but I did do this to the two files (ot_coupon.php and ot_gv.php) and I managed to get everything to work! It's probably a VERY bad way of doing it but strangely enough it seems to work.

 

I just added:

 

        $order->info['total'] = $order->info['total'] - $od_amount;
                 //added hack for putting contingency before sub-total TN
  [COLOR=red]$order->info['subtotal'] = $order->info['subtotal'] - $od_amount;[/COLOR]
  //EOF hack

 

into both files and it seems to work.

 

I am running MS1. Now the only problem I have is with the rounding of sums.

 

I ended up using the following fuzz solution to get the sums to round properly.

 

The round() function may indeed work properly with half-values (eg. 1.5), but this little method will give you peace of mind. Add some "fuzz" to your function with a miniscule delta value.

$delta = 0.00001;
$x = round($x+$delta);

 

Found on: http://www.php.net/round

 

Any thoughs on this?

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.

Link to comment
Share on other sites

strider...

 

This works for reactiving a coupon, however what if the coupon was a one-time use coupon. If I just change the dates, the coupon will still be used one-time. If I wished to reuse this coupon again using the same code as another one-time coupon, it wouldn't work. I would have to increment the "Uses Per Coupon" and "Uses Per Customer" each time I would like to use again.

 

S. Cole

 

ps. thanks for all your help so far. it's appreciated!

Link to comment
Share on other sites

I have just joined this forum.

 

I am stuck up with a problem

 

I am using oscommerce-2.2ms2 and have installed Linda's DownloadController v5.3 MS2.2 and Credit Class/Gift Voucher (ccgb-510b) and everything is working fine except for a small problem.

Suppose I have 50$ as gift voucher amount balance and I purchase a downloadable product of 20$. Now if I use my Gift Voucher amount.

to make the purchase then the download link doesnt appear at the end ... Instead the download message appears (downloads will not happen unless payments are confirmed ). Now in this case since the customer is using his gift voucher amount to pay for that product it should allow him to download instantly.

Note : If the customer has 10$ as gift voucher amount balance and if he is purchasing a downloadable product of 20$ and using his Gift Voucher for partial payment then the download link appears.

 

The conclusion is that if a purchased product is paid entirely with the Gift Voucher amount then the download link doesnt show up whereas if I make part of the payment through my Gift Voucher balance and remaining through other payment method then the download link shows up

 

I am sorry if this question has been asked previously.

Maybe someone else might have had a similar problem

 

Please help......

Link to comment
Share on other sites

I installed the credit class contribution (zip:ccgv-510b) and everything went well. No errors or anything, however did discover a problem.

 

The Shipping Page (checkout_shipping.php) no longer loads. When accessed, it automatically forwards me to the Payment Page (checkout_payment.php).

 

I've tried to debug the problem and can't seem to resolve it.

 

I believe I have narrowed it down to the following code:

 

 

CODE 

 

// if the order contains only virtual products, forward the customer to the billing page as

// a shipping address is not needed

// ICW CREDIT CLASS GV AMENDE LINE BELOW

//if ($order->content_type == 'virtual') {

if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {

  if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

  $shipping = false;

  $sendto = false;

  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

 

 

 

 

If I comment out the tep_redirect line it no longer automatically forwards me to the payment page (blank page displays). If I comment out the entire section the shipping works fine again. Suspect there's a problem with the content_type.

 

I backup my system prior to any contribution install. I checked the backup prior to installing this contrib and it works fine.

 

I have no idea why this is happening. I suspect that the problem actually lies within another file before it reaches this script, however I cannot find it.

 

scole : place a weight in your products unless they are virtual

 

DesertDogs: yes it is 5.03

Hi strider,

In continuation with the SCole problem I too have a problem.

I have installed CreditClass/Gift Voucher (ccgb-510b) and made changes to the files.Alongwith this I have also installed Linda's Download Controller v5.3 and free shipping and free payment modules.

 

I have a free shiiping product and obviously its weight has been set to 0.

So if a user purchases this product he has to be shown the Shipping Page where the Shipping method shown will be Free Shipping Only. I want to let he user know that this product is shipped free.

 

If I comment the changed code on the line for CC/Gift Voucher in the file checkout_shipping.php

if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {

 

and restore the original code on the line which was:

 

[B]if ($order->content_type == 'virtual') {[/b]

 

then the Shipping Page (checkout_shipping.php) is not bypassed and the user gets to see the Free Shipping Only message in the Shipping method.

 

But then if soemone buys a gift voucher (whose weight is also obviously 0) then he too goes to the Shipping page where he gets to see the the Free Shipping Only message in the Shipping method. Now this is something i dont want for a gift voucher to happen cause shipping doesnt makes any sense in case of Gift Vouchers.

 

My question is how to modify that if condition line on checkout_shipping so that if the user has purchased a gift voucher then the Shipping page must be bypassed but if any other free shipping product has been selected then the user should be shown the Shipping page with FREE SHIPPING message

 

Please help me as i am a newbie

Link to comment
Share on other sites

hello,

 

i just finished installing and trouble shooting cc-gb-510b and so far so good. A couple little tricks that seemed to be "unique" for me that I thought I'd post in case anyone else needs them (admittedly, i have not read through every page of this thread ... it could already be here!).

 

To get the "check here to apply your gift voucher" to show up on the check out page I had to set the sort order for BOTH coupons and gv to 740. When I tried either one with a higher or lower sort priority, it didn't work, but both at 740 did. well, it sounds weird, but it works so i'm just going with it!

 

also, to keep from adding shipping to a gift voucher purchase i had to enable downloads, give a weight to all of my physical products, give gv a weight of 0.0 AND i also had to go into catalog > product attributes and set up the "download" parameters there for the gift voucher. I gave it a dummy file name (like "gift_certificate") and download days of 90 and one download allowed ... i have no idea if these parameters will actually affect redeeming vouchers or not ... i guess to be safe I may extend that to 365 days or something unless someone here can tell me that it won't matter.

 

also, instead of *deleting* vouchers, how about expiring them? i know it is illegal in some states/countries/areas to expire gift vouchers, but for the most part in the U.S. (where we are) it is possible to put an expiration on gift certificates and we would like to limit the liability they represent. We don't want someone coming back in 10 years trying to claim a 2004 gv!! I know we can set an expiration date for coupons ... anything for vouchers??

 

thanks a bunch for this contribution and any info on the expiring g.v.!!

 

~Bonnie

Link to comment
Share on other sites

hi guys, I am getting the following error, some one please tell me how to fix this?

 

Warning: Cannot modify header information - headers already sent by (output started at /home/newserver/public_html/catalog/admin/includes/boxes/gv_admin.php:20) in /home/newserver/public_html/catalog/admin/includes/functions/general.php on line 18

 

thanks in advance

Link to comment
Share on other sites

Strider,

 

I love this mod and I like the new Coupon Info link in shopping cart but I am seeing page loaded with errors when I click on the coupon: more info

 

Has anyone else seen this??

 

 

Thanks

 

Eric

Edited by Johnson
Link to comment
Share on other sites

I have a problem with the computation of sales tax when using a dollar amount discount on the coupon (the % computation works fine).

 

The tax amount should be 2.94 (using 7.75% rate).

 

Sub-Total: $47.98USD

Discount Coupons:TST3: -$10.00USD

California Sales Tax: $2.88USD

UPS Shipping (Ground Shipping): $6.95USD

Total: $47.81USD

 

I have installed the 510b version.

 

Thanks for any assistance.

 

garyt

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