Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Which then leads to catalog\checkout_confirmation.php

 

// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
 }

 if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
 }

// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);
// ################# Added CGV Contribution ##################"

//  require(DIR_WS_CLASSES . 'order_total.php');
//  $order_total_modules = new order_total;
// ################# End Added CGV Contribution ##################"

 

So this is the final check to determine the output values from the pre_confirmation_check() function to determine if it goes to the installed payment module that was selected. This is where the final code execution needs to be validated and overruled based upon if the voucher should be used or not

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

I'm having the same problem. I'm assuming that it is a bug with the contribution. If you look a few posts above Scranmer posted some code to place in the catalog/includes/classes/cc_validation.php file to help with this. I haven't been able to get this to work for my shop yet. I may be putting the code in the wrong place or something. Anyways here is the code:

 

} elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
$this->cc_type = 'JCB';
if ( strtolower(MODULE_PAYMENT_CC_ACCEPT_ORIG_JCB) != 'true' ) return -5;
} else {

//
//**si**
//
//ensure gift voucher system installed and if we are using the balance we do not require cc info
global $credit_covers;

//check to see if gv installed
if (isset($credit_covers)) {
//check to see if credit balance>order total & no cc info entered
if ( $credit_covers
&& strlen($number.$cc_cvv.$cc_issue)==0
&& ( strlen($expiry_m)==0 || $expiry_m='mm' )
&& ( strlen($expiry_y)==0 || $expiry_y='yy' )
&& ( strlen($start_m)==0 || $start_m='mm' )
&& ( strlen($start_y)==0 || $start_y='yy' )
) {
return true;
}
}
//
//**si** end
//

return -1;
}

 

I found this on page 150, I'm guessing this is the bit which will force payment input if the voucher value is greater than the final spend by the customer. I tried to implement this but nothing seemed to happen, it just says thanks for order straight away, and doesnt enforce the entry of debit/credit card input.

 

Any updates on this or advances on how to alleviate this problem?

Link to comment
Share on other sites

Which then leads to catalog\checkout_confirmation.php

 

// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
 }

 if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
 }

// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);
// ################# Added CGV Contribution ##################"

//  require(DIR_WS_CLASSES . 'order_total.php');
//  $order_total_modules = new order_total;
// ################# End Added CGV Contribution ##################"

 

So this is the final check to determine the output values from the pre_confirmation_check() function to determine if it goes to the installed payment module that was selected. This is where the final code execution needs to be validated and overruled based upon if the voucher should be used or not

 

is this code above what needs to be put in alongside the previous post to get it going properly? thanks for your hard work - i gave up looking around a week ago because i just could not find the fault

 

i am a little surprised by the fact that you havent had much feedback at the moment... looks like many CCGV folk havent used this add-on, that is why they arent getting involved. if only they knew that it was a great add-on!

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

is this code above what needs to be put in alongside the previous post to get it going properly? thanks for your hard work - i gave up looking around a week ago because i just could not find the fault

 

i am a little surprised by the fact that you havent had much feedback at the moment... looks like many CCGV folk havent used this add-on, that is why they arent getting involved. if only they knew that it was a great add-on!

 

Well it still isn't working properly, I'm posting this for those that might have some insite now that I'm showing them were to look. By no means is it a fix, but it should help me and others get this thing figured ASAP.

 

I'm sure most have it working just haven't give or sold many vouchers where this problem would stand out. The coupons are easy because those are the most common.

 

I hope to have this solved today, but no guarantee....... B)

Link to comment
Share on other sites

I found this on page 150, I'm guessing this is the bit which will force payment input if the voucher value is greater than the final spend by the customer. I tried to implement this but nothing seemed to happen, it just says thanks for order straight away, and doesnt enforce the entry of debit/credit card input.

 

Any updates on this or advances on how to alleviate this problem?

 

The problem isn't in the CC module itself, its in the files I mentioned above. There is a part of the code that denies any module that is enabled if the voucher value is greater than the total. So it doesn't pass the data to ANY payment module that is active and just writes the order into the orders field in the database. This makes sense if the voucher is being applied at the time of purchase but if it isn't then the amount should be passed to whatever module is active for payment and that doesn't happen because of the way the JONYO code is written. Sit tight were working on it

 

Chris

Link to comment
Share on other sites

You need to add this line to the catalog/includes/language/add_ccgvdc_english.php file and you'll be good to go.

define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number.  HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***');

 

I am having the same error come up except that IT IS deducting the coupon amount from the sale.

in fact, everything goes well all the way to the end except that it brings up that erroneous message.

 

Please help.

thanks.

Link to comment
Share on other sites

I am having the same error come up except that IT IS deducting the coupon amount from the sale.

in fact, everything goes well all the way to the end except that it brings up that erroneous message.

 

Please help.

thanks.

 

If the shipping is deducted from the total amount as well it will subtract the gross total. If the total value falls below the value of the minimum that is set then it will flag that error. Try this.

 

Create a product that is say $100 and whatever shipping. Then send a $25 voucher with a $1 minimum purchase requirement. Buy the product and the message should come up as "you've redeemed a $25 voucher from a minimum of the $1 blah blah blah.

 

See if that is what happens and you'll know if it is wokring correctly. I found that if the voucher value is greater than the grand total but not inclusive to shipping that error shows up. I may look at this after I finish my current issue which I think I have a final solution that I'm testing now

 

The email should have the restriction limits added when it is purchased or sent, or mass displayed somewhere but it isn't, I may modify that to fix this issue

 

Chris

Edited by kittmaster
Link to comment
Share on other sites

If the shipping is deducted from the total amount as well it will subtract the gross total. If the total value falls below the value of the minimum that is set then it will flag that error. Try this.

 

Create a product that is say $100 and whatever shipping. Then send a $25 voucher with a $1 minimum purchase requirement. Buy the product and the message should come up as "you've redeemed a $25 voucher from a minimum of the $1 blah blah blah.

 

See if that is what happens and you'll know if it is wokring correctly. I found that if the voucher value is greater than the grand total but not inclusive to shipping that error shows up. I may look at this after I finish my current issue which I think I have a final solution that I'm testing now

 

The email should have the restriction limits added when it is purchased or sent, or mass displayed somewhere but it isn't, I may modify that to fix this issue

 

Chris

 

 

was this in reply to the coupon issue that says

 

"Congratulations, you have redeemed ERROR_REDEEMED_AMOUNT_ZERO"?

 

Cos it works, but still displays that message on top.

it must be an error where the wrong notification is called.

please help. thanks

Link to comment
Share on other sites

was this in reply to the coupon issue that says

 

"Congratulations, you have redeemed ERROR_REDEEMED_AMOUNT_ZERO"?

 

Cos it works, but still displays that message on top.

it must be an error where the wrong notification is called.

please help. thanks

 

The error is telling you what is wrong, it is looking for "ERROR_REDEEMED_AMOUNT_ZERO" which is stored in the catalog/includes/language/add_ccgvdc_english.php FILE,

 

YOU must edit the file by adding this information by copying and pasting the following:

 

define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***');

 

at the very bottom of that file just before the

 

?>

at the end of the file!!!

 

This will solve your problem of the wrong error message showing up

 

Hope this helps

 

Chris

Link to comment
Share on other sites

The error is telling you what is wrong, it is looking for "ERROR_REDEEMED_AMOUNT_ZERO" which is stored in the catalog/includes/language/add_ccgvdc_english.php FILE,

 

YOU must edit the file by adding this information by copying and pasting the following:

 

define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***');

 

at the very bottom of that file just before the

 

?>

at the end of the file!!!

 

This will solve your problem of the wrong error message showing up

 

Hope this helps

 

Chris

 

thanks Chris.

I did that before, but the error still comes up.

Again, it comes up EVEN THOUGH the coupon was applied!

it's almost as if it shoud have called up

('ERROR_REDEEMED_AMOUNT', 'The coupon has been successfully applied for ')

 

AND NOT

 

 
('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***')

 

since the discount was applied succesfully.

what do you think??

Link to comment
Share on other sites

i have another issue here.

 

does anybody know where the coupon email is being composed in the code?

 

i.e. the email that goes out when i send a customer the coupon. i want to edit the custom wording and also the link it displays.

 

is it possible to put all kinds of html in there?

 

 

thanks

Link to comment
Share on other sites

I finally found the fix for the issue with the voucher less than the value of the total order...........I'll add information to the contribution area

 

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

 

BTW

 

5.15 is not a final fix, I found the install into the database when adding and removing the module to still be in french!!!!!

 

I found this out by accident!

 

I'm glad this fix is done, let me know how you guys make out, I've tested it six ways to sunday on a heavily modified site.........70+ contribs and seems to all be in order. let me know how you make out

 

 

Chris

Link to comment
Share on other sites

thanks Chris.

I did that before, but the error still comes up.

Again, it comes up EVEN THOUGH the coupon was applied!

it's almost as if it shoud have called up

('ERROR_REDEEMED_AMOUNT', 'The coupon has been successfully applied for ')

 

AND NOT

 

 
('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***')

 

since the discount was applied succesfully.

what do you think??

 

This is just an update for anyone who installs the contrib and plans to use the COUPON functionality. Some of the commands for the COUPON and the GIFT VOUCHER are in the same files.. some are not.

 

if you encounter the problem above where you get an error EVEN THOUGH the coupon is applied (and you will if you install version 5.15), you need to include the define line

define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***');

 

in the osc/includes/languages/english/modules/order_total/ot_coupon.php file and not in the

 

osc/includes/languages/add_ccgvdc_english.php file.

 

NOTE: that in the version 5.15, the define line is ALREADY INCLUDED in the osc/includes/languages/add_ccgvdc_english.php file and this error is still encountered (because this file works for the GV alone).

 

All you do is copy the above code and paste in the ot_coupon.php file and you're on your way!

if you're using the GV alone, you don't need this step because the code is already in the file.

 

thank you guys for all your contributions.

maybe somebody who plans to put out an update on the 5.15 can include this oversight in the package.

 

Bukie

Link to comment
Share on other sites

I finally found the fix for the issue with the voucher less than the value of the total order...........I'll add information to the contribution area

 

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

 

BTW

 

5.15 is not a final fix, I found the install into the database when adding and removing the module to still be in french!!!!!

 

I found this out by accident!

 

I'm glad this fix is done, let me know how you guys make out, I've tested it six ways to sunday on a heavily modified site.........70+ contribs and seems to all be in order. let me know how you make out

Chris

 

After applying the voucher and then clicking to confirm the order - i get this error message at the top of the order summary page:

 

Warning: str_repeat(): Second argument has to be greater than or equal to 0. in /home/toptopia/public_html/catalog/includes/modules/payment/cc.php on line 229

 

I click next and it just goes through saying "Thanks for the order" and doesnt take credit card details through or anything (in this test i imposed a ?100 gift voucher, and bought something for ?60 - the voucher doesnt cover postage, but it went through and didnt take any payment info to cover postage fee).

Link to comment
Share on other sites

I finally found the fix for the issue with the voucher less than the value of the total order...........I'll add information to the contribution area

 

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

 

BTW

 

5.15 is not a final fix, I found the install into the database when adding and removing the module to still be in french!!!!!

 

I found this out by accident!

 

I'm glad this fix is done, let me know how you guys make out, I've tested it six ways to sunday on a heavily modified site.........70+ contribs and seems to all be in order. let me know how you make out

Chris

i checked it out and works fine on my site too.

 

mine doesnt have 70+ contributions like yours but has around 20+ AND it does seem to work correctly.

 

i'll try to test it more extensively and give an update here later.

 

thanks for your hard work!

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

After applying the voucher and then clicking to confirm the order - i get this error message at the top of the order summary page:

 

Warning: str_repeat(): Second argument has to be greater than or equal to 0. in /home/toptopia/public_html/catalog/includes/modules/payment/cc.php on line 229

 

I click next and it just goes through saying "Thanks for the order" and doesnt take credit card details through or anything (in this test i imposed a ?100 gift voucher, and bought something for ?60 - the voucher doesnt cover postage, but it went through and didnt take any payment info to cover postage fee).

 

Ok I'll be clear on how my site is set up so it will verify if you have the same setup as mine. My versions and fixes downloaded from the CCGV page are as follows:

 

Credit Class and Gift Voucher 5.14 Baby Boy 22 Jul 2005  

Since the last 2 upgrade haven't been added, here is an update for ya'll labeled as CCGV 5.14, no major updated, but 5.13 was getting a little outdated.

This is the FULL PACKAGE and included the PayPal fix and brettsg's 4 fixes. I don't take no credit for this, just re-packaged and included all of the replaced files for everybody to have the updated version.

Enjoy!

 

CCGV Easier to Understand Payment Addon v1.2 aarondwyer 20 Nov 2005  

Here we go again. This should nail it this time. I had missed a very small but vital piece of code in the readme.html.

This has now been tested by others and works fully.

Ignore v1.1 and v1.0 listed in this contribution area, just use this one.

Aaron

 

 Redeem message fix scranmer 9 Nov 2005  

This is a correction to the redeem message at checkout_payment.php which informs the customer when a voucher has been applied. It now also shows a warning if the voucher does not meet the criteria.

eg
order ?5 minimum order value ?20
message will show:-
The coupon has been successfully applied for
***HOWEVER:No reducion available, please see the coupon restrictions***
order ?5 minimum order value ?0 5% discount
message will show :-
The coupon has been successfully applied for ?0.25

HTH

Si.

 

 French fix + others for 5.14 shawkes 1 Aug 2005  

I have translated the ot_gv.php to english and have included a couple of admin files that I found to have a problem. If you use a shared ssl cert and you have admin setup to use ssl for all links, the link in emails is not right. In the files I changed the variable referred to was HTTP_SERVER changing that to HTTP_CATALOG_SERVER fixes it for shared ssl users and should also work for others.

Only the changed files are included in the zip file

 

There are all kinds of other "fixes" but these are the files that are on my site with all my other modifications and therefore works as designed. I don't know why they keep the other crap on the there, they should have an archive the rest for other users and only keep what really works for the current setups, but I don't run this place so............

 

I'm seeing that it works for cooch, therefore I know that what I've done should be fine. I'd have to go back and verify seeing if your setup is identical to what we used here. Or you can just revert the simple change that you made and you'll be back where you started.

 

If you revert does the site work as it should???

 

Send a link to your site so we can see what's going on

 

Chris

Edited by kittmaster
Link to comment
Share on other sites

like many other people i have the coupon redeemed info in the shopping cart box but am removing it and using it in the header instead

 

below is the text from the shopping cart box.. can anyone please tell me what it should be to make it usable in the header?

 

i have tried varying formats and cannot get anything to show up

 

thanks

=================================================

 

 

// ############ Added CCGV Contribution ##########

if (tep_session_is_registered('customer_id')) {

$gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

$gv_result = tep_db_fetch_array($gv_query);

if ($gv_result['amount'] > 0 ) {

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');

}

}

if (tep_session_is_registered('gv_id')) {

$gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");

$coupon = tep_db_fetch_array($gv_query);

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');

 

}

if (tep_session_is_registered('cc_id') && $cc_id) {

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="java script:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

}

 

// ############ End Added CCGV Contribution ##########

 

// view cart mod start

 

if ($cart->count_contents() > 0)

{

if (preg_match("/checkout/", $PHP_SELF))

{$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a>');}

else

{$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><u>Go Checkout</u></a>');}

}

else

{$info_box_contents[] = array('align' => 'left','text' => '<u>Your Basket Is Empty</u>');}

// view cart mod end

 

 

new infoBox($info_box_contents);

 

===========================================

 

 

can anyone please advise

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Maybe someone can help w/ my problem. Installed the CCGV system. I created a coupon and when I test it out, the first time I enter the coupon, I get this message:

 

The coupon has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***

 

 

The second time i enter the same coupon, it works just fine. Any ideas?

Link to comment
Share on other sites

Maybe someone can help w/ my problem. Installed the CCGV system. I created a coupon and when I test it out, the first time I enter the coupon, I get this message:

 

The coupon has been successfully applied for <BR>***HOWEVER:No reducion available, please see the coupon restrictions***

The second time i enter the same coupon, it works just fine. Any ideas?

 

yeah because the message redeem has been hacked so many times for both a non functioning module to double repeated error message with incorrect points, it keeps selecting the wrong messages for the right transaction.

 

I'm working on it as we speak, but most likely won't have a final update until late tonight or tomorrow

 

Chris

Link to comment
Share on other sites

Ok

 

I've done some serious modifications for the redeem message area of this contrib. The current redeems are not (IMO) not fixed correctly...........sooooo..

 

Here is my site:

 

http://www.gforceperformanceaudio.com/shoppingbeta/

 

the site is a beta site and you'll need to sign up for an account, the products are real, but obviously this is for testing only to see if the functionality of the redeeming system can be tested out. The more you beat it up the more we can iron out the reliability and find anything I've missed to be corrected.

 

Let me know if it works for you and as expected.

 

If it does and we are all in agreement I'll post the multiple changes to files tomorrow if I get feedback, if I hear nothing, then I'll assume its still not right and not update the contrib area. Its not just the language files, its the actual functional files that need amending.

 

So give it a whirl, give me some feedback. And we'll go from here

 

Chris

Link to comment
Share on other sites

Ok

 

I've done some serious modifications for the redeem message area of this contrib. The current redeems are not (IMO) not fixed correctly...........sooooo..

 

Here is my site:

 

http://www.gforceperformanceaudio.com/shoppingbeta/

 

the site is a beta site and you'll need to sign up for an account, the products are real, but obviously this is for testing only to see if the functionality of the redeeming system can be tested out. The more you beat it up the more we can iron out the reliability and find anything I've missed to be corrected.

 

Let me know if it works for you and as expected.

 

If it does and we are all in agreement I'll post the multiple changes to files tomorrow if I get feedback, if I hear nothing, then I'll assume its still not right and not update the contrib area. Its not just the language files, its the actual functional files that need amending.

 

So give it a whirl, give me some feedback. And we'll go from here

 

Chris

 

 

 

 

I signed up and got the email but didn't see the test coupon code.

Link to comment
Share on other sites

I have been working this awesome contribution into my development site for the last week. I have a site with about 7 contributions installed. I started with the base v5.13 and got it functional. Then I saw v5.15 was released and upgraded it and finished tuning it up today. I found the French code and was able to work around it since I was doing all file compares. Everything seems to be functional with just a couple of possible issues.

 

I did not encounter the the issue with the voucher less than the value of the total order. If my voucher is less than the total order, it seems to process to Order Confirmation without producing an error. My dev site is not connected to a merchant account so I am testing with Check/Money Order and Credit Card (4111111111111111) payment modules.

 

I have a question about basic functionality I hope someone can answer: If the voucher is greater than the total amount, why am I forced to choose a payment method? Why can't I just check the Tick box to apply the credit, click Continue and jump to Order Confirmation? Is this normal or do I have a problem?

 

I believe I have found a bug with v5.15:

 

1) Set up a Coupon to allow 10% off and configure to allow a customer to use it only once.

 

2) Login as a customer on your site, purchase something and use the Coupon code, then logout.

 

3) Login as same customer, purchase something and attempt to apply the same Coupon code. You will be denied as expected.

 

4) Immediately attempt to enter the Coupon code again. This time the coupon code is accepted and you get your discount a second time when you should not.

 

Joe

Link to comment
Share on other sites

nerditup.

 

I set up an account and also purchased a voucher. The welcome e-mail did not send me my coupon code number so I could not test. I had this problem and fixed it. I think you need to enter in the coupon code in the Admin, Configuration, Welcome Discount Coupon Code section to fix this. Also I purchased a voucher, can you release it? I am interested in testing your site.

 

Thanks,

 

Joe

Link to comment
Share on other sites

I made a change to the CCVG v5.15 code in /includes/classes/order_total.php. It is a cosmetic change that separates Redeem and the Tick box for credit application. I am posting it in case someone likes the way it looks on the page and wants to do the same thing.

 

Here is what it looks like:

 

003.jpg

 

Here is the code change in /includes/classes/order_total.php at around line 91. This replaced the "function credit_selection()" section:

 

// BEGIN >>> Contribution CCVG v5.15 - Custom Modification to separate Redeem from Tick box.

function credit_selection() {

$selection_string = '';

$close_string = '';

$credit_class_string = '';

if (MODULE_ORDER_TOTAL_INSTALLED) {

$header_string = '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$header_string .= ' <tr>' . "\n";

$header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= ' </table></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n";

$header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n";

$header_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n";

$header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$header2_string = '<tr>' . "\n";

$header2_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$header2_string .= ' <tr>' . "\n";

$header2_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT2 . '</b></td>' . "\n";

$header2_string .= ' </tr>' . "\n";

$header2_string .= ' </table></td>' . "\n";

$header2_string .= ' </tr>' . "\n";

$header2_string .= '<tr>' . "\n";

$header2_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n";

$header2_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n";

$header2_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n";

$header2_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$close_string = ' </table></td>';

$close_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$close_string .= '</tr></table></td></tr></table></td>';

$close_string .= '<tr><td width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';

reset($this->modules);

$output_string = '';

$credit_string = '';

$apply_credit_string = '';

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

$use_credit_string = $GLOBALS[$class]->use_credit_amount();

if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();

if ( ($use_credit_string != '' ) || ($selection_string != '') ) {

$output_string = ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .

' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>';

$output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$output_string .= ' </tr>' . "\n";

$output_string .= $selection_string;

if ($use_credit_string != '' ) {

$apply_credit_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .

' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .

' <td class="main"><b>' . '</b></td>' . $use_credit_string;

$apply_credit_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$apply_credit_string .= ' </tr>' . "\n";

}

}

}

}

if ($output_string != '') {

$output_string = $header_string . $output_string . $close_string;

if ($apply_credit_string != '') {

$credit_string = $header2_string . $apply_credit_string . $close_string;

}

$output_string .= $credit_string;

}

}

return $output_string;

}

// END <<< Contribution CCVG v5.15 - Custom Modification to separate Redeem from Tick box.

 

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

 

Also in /catalog/includes/languages/english.php, add this line:

 

define('TABLE_HEADING_CREDIT2', 'Certificate/Coupon Application');

 

Hope this helps out in some way....

 

Joe

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