Jump to content
Strider

Credit Class/Gift Vouchers/Discount Coupons 5.10

Recommended Posts

Need Help Badly Please.

 

2 problems: The coupon amount is NOT deducted from the the amount when using PalPal.

Also the coupon dedeuction code shows under the total.

Example:

Please help, I really need to get this working for her.

see if you have paypal module set to AGGREGATE...if not do it.

you cant "per item" using a coupon. maybe look in your pp account too. aggregate.

Share this post


Link to post
Share on other sites
Thank you so much it now deducts the amount of the coupon.

Any idea about the coupon dedeuction code shows under the total ?

 

You have to change the sort order in the admin panel under modules>order total

Share this post


Link to post
Share on other sites

Sorry Such a NOOB at this. But you people have been so wonderful and Thank You for all your help. This worked by the way.

 

I am going to look at some more of the forums and see what help I can be to others. I have learned som things and will see if I can lend other a hand. Thanks Again.

 

Richard

Share this post


Link to post
Share on other sites
Sorry Such a NOOB at this. But you people have been so wonderful and Thank You for all your help. This worked by the way.

 

I am going to look at some more of the forums and see what help I can be to others. I have learned som things and will see if I can lend other a hand. Thanks Again.

 

Richard

 

Dont be sorry, we all start somewhere. We're glad to help, afterall thats what the forum is for ;) so you're welcome and keep the questions coming.

Share this post


Link to post
Share on other sites

Thanks. I have OCS installed for 2 of my stores and still learning, but this was for a friend who wanted me to install it. Her store is already live. The problem was I installed quite a few other mods. So had to do it all manually. Now I have to figure out why 2 other mods I installed do not work correctly.

Share this post


Link to post
Share on other sites
Got everything installed (not easy with all of the purchase-without-account mods and such), and it seems to work so far, but the coupon redemption box is formatted weird. It's the one titled 'Credits Available' and has the text about 'Enter code below'. That text is on the right side, entry blank is on the left below it, and the Redeem button is below that. Works OK, looks ugly. What am I doing wrong?

Anybody found out how to format this correctly? Any help would be appreciated. This is what it looks like:

 

Untitled-2.gif

 

Michael

Edited by mvigil514

Share this post


Link to post
Share on other sites
Q: I'm having two (related) problem with how my CC/GV box displays.

 

ccgv_problems.jpg

 

1. As you can see, the "Redeem" button does not line up on the same level as the input box. :(

 

2. There is an EMPTY blue roll over at the top. I know (well I think...) this is related to the defualt moduleRow class in the style sheet (see below), but i'm not sure how to edit it out. :blush:

If anyone can point me in the right direction on how to do either/both theses things it would be great. :D

 

Thanks,

 

Nate

 

Nate, the row over effect is in catalog/includes/classes/order_total.php at around line 132:

 

 

// #################### Begin Added CGV JONYO ######################
	   //$use_credit_string = $GLOBALS[$class]->use_credit_amount();
// #################### End Added CGV JONYO ######################




		if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();
		if ( ($use_credit_string !='' ) || ($selection_string != '') ) {
		  $output_string .=  '<tr colspan="4"><td colspan="4" width="100%">' .  tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';
		  $output_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>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;
		  $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';
		  $output_string .= '  </tr>' . "\n";
		  $output_string .= $selection_string;
		}

	  }
	}
	if ($output_string != '') {
	 $output_string = $header_string . $output_string;
	 $output_string .= $close_string;
   }
 }
 return $output_string;
  }
// #################### Begin Added CGV JONYO ######################

 

I removed the class="xxx" to get rid of the highlight. How did you get rid of the text, and if you figure out how to align the button and the text box, let me know.

 

This is what mine looks like:

 

Untitled-2.gif

 

Michael

Edited by mvigil514

Share this post


Link to post
Share on other sites
i rechecked the code an detected that the

 

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

$cc_id = $coupon_result['coupon_id'];

 

exits 2 times. you must enter the the changes behind the first one.

 

i hope it will help and sorry again for the english ;).

 

so long

 

Meesta

 

Because of a heavily modified store, I wasn't willing to try the full upgrade to v5.16. But using 5.13 I was able to find a fix that worked for me.

 

In ot_coupon.php, collect_posts() is looking for $_POST vars to find the coupon code set by $cc_id = $coupon_result['coupon_id'];. These aren't sent from checkout_confirmation.php to checkout_process.php as they are in checkout_payment.php.

 

So add the post field after the form creation in checkout_confirmation.php:

echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');
echo tep_draw_hidden_field('gv_redeem_code', $_POST['gv_redeem_code']);

 

And make sure that in checkout_process.php, that $order_totals = $order_total_modules->process(); appears BEFORE $payment_modules->before_process();. Otherwise the order in oscommerce will have different totals than the order in your payment processor.

 

Hope this works for others

Share this post


Link to post
Share on other sites
Q: I'm having two (related) problem with how my CC/GV box displays.

 

ccgv_problems.jpg

 

1. As you can see, the "Redeem" button does not line up on the same level as the input box. :(

 

2. There is an EMPTY blue roll over at the top. I know (well I think...) this is related to the defualt moduleRow class in the style sheet (see below), but i'm not sure how to edit it out. :blush:

If anyone can point me in the right direction on how to do either/both theses things it would be great. :D

 

Thanks,

 

Nate

 

The EMPTY blue roll over, is a simple fix go to Admin>modules>ordertotal and press remove then install so it resets your default values, then do the same for your payment method.

You will notice that your gift voucher order total needs to be higher than your credit total otherwise this error occures.

 

Also Somebody was asking about the COD Cash on Delivery being disabled. Look at it logically if a gift voucher is purchased and gets sent to the client automatically then how are you going to collect payment from them when it is a digital delivery. COD being disabled for digital delivery (download) is not a bug.

 

Also this modules seems to stuff up the default pay pal module that comes with osCommerce2.2 as well as it includes a pay pal module which has shipping/tax errors, everybody realise that you need to check the paypal IPN contribution for updates (hint there is something there now which fix's these shipping issues). however you need to merge it correctly not just overwrite.

 

my recomendations about pay pal issues, install a new payment module yourself over the CCGV5.16 and when installing CCGV5.16 don't waste your time trying to install it manually, get it working on a fresh copy of osCommerce2.2 first.

 

sorry if this sounds sharp i'm in a rush also i'm not a developer, i just spent a week getting CCGV to work so i've come across alot of these problems aready. wish i knew how to fix these issues properly otherwise i would.

Share this post


Link to post
Share on other sites

insomniac2,

 

The code I changed in coupon_admin.php for number_format() and decimal precision seems the way it outght to be. If a dollar amount or percent has no post decimal data ($10.00 or 10.00%), then only display $10 or 10%.

 

What you did was override the logic of the ternary operators I inserted. Basically, each ternary IF statement is now asking "Is the amount an integer? If so, then display to 2 decimals. If not, then display to 2 decimals."

 

The code I wrote was intended to do this:

"Is the amount an integer? If so, then display with 0 decimals. If not, then display to 2 decimals."

 

If you want to always display decimals, why not replace all the ternary instances with just the number_format() call? It would clean up your code...

Edited by molafish

Share this post


Link to post
Share on other sites

Coupon Admin rollup 3 posted today.

 

This release only adds one new feature to the coupon admin page (without having to click on report):

- number of redemptions

 

- date of last redemption

 

- redeemed coupons view filter

 

This rollup is comprehensive, in that it includes all the changes from the coupon admin bug rollup packages 1 and 2 that I posted earlier.

 

I've included a screenshot in the package for your viewing pleasure.

Edited by molafish

Share this post


Link to post
Share on other sites

Hi. I recently had v5.13a of CCGV installed on my store and it works quite well! My only question is this:

 

On checkout_payment.php when I enter CC info, and then a coupon code and hit 'Redeem', it refreshes the checkout_payment.php page and correctly applies the coupon, but the cc info is gone. The customer then has to enter it again and Continue to go checkout_confirmation.php Not a great customer experience and it feels like an 'error' occurred.

 

What I want to happen is either:

 

1. customer goes directly to checkout_confirmation.php when they hit 'Redeem'

 

2. if checkout_payment.php has to refresh when they hit 'Redeem' they should NOT have to enter a cc # before hitting 'Redeem'. Can the 'Redeem' button be pressed w/o checking for cc info but properly applying the coupon? Then, once it refreshes and applies the coupon they can enter cc info and continue.

 

I have what I think is version 5.10b on another site of mine (this came preinstalled via a template that I bought), and when I enter a coupon code and cc info and hit redeem it goes directly to checkout_confirmation which I like better.

 

Thank you for any help!

 

Regards,

 

-- Josh

Share this post


Link to post
Share on other sites

Josh.

 

If you read this post, http://forums.oscommerce.com/index.php?s=&...ndpost&p=797876 and other posts in this thread you will see this is a problem that several people have.

 

In the same problem, is the solution... just move the redeem box above the credit card box:

ccgv_problems.jpg

 

If you have any questions... just post and I can tell you what I did to get it the way it shows up in the screen shot... while this is not a "FIX" it is a solution.

 

Good Luck,

 

Nate

Share this post


Link to post
Share on other sites
In the same problem, is the solution... just move the redeem box above the credit card box:

Thanks Nate! I was actually about to type another response when I saw your message. I did what you said and moved the coupon box and that did work! However, i also found another solution:

 

I just noticed that v5.13a (compared to v5.13 which I have) is where the change occured making checkout_payment.php refresh instead of redirecting to checkout_confirmation.

 

So I downloaded v5.13 and uploaded the following two files to see what happens, and it worked!(checkout_payment goes directly to checkout_confirmation after hitting redeem, which I like better than the refresh)

 

catalog/includes/modules/order_total/ot_gv.php

catalog/includes/modules/order_total/ot_coupon.php

 

My question though is does anyone know if any of the other fixes done in 5.13a are very important? Or, can someone figure out how to backout only the refresh/redirect change from the v5.13 files so that the other fixes are still intact?

 

I did a file compare on the ot_coupon.php between 5.13 and 5.13a and could'nt figure out exactly where the refresh/redirect change occured. that's why i just uploated the whole 5.13 file. But i don't want to miss out on the other fixes that were done in 5.13a.

Share this post


Link to post
Share on other sites

Quick update: the fix of moving the coupon box above the cc box worked the first time, but now when trying again it wants me to enter cc info when i hit the Redeem button....

Share this post


Link to post
Share on other sites
Anybody found out how to format this correctly? Any help would be appreciated. This is what it looks like:

 

Untitled-2.gif

 

Michael

 

 

I am having the same problem, can you tell me if you have found a way to fix it?

 

Mike

Share this post


Link to post
Share on other sites
Quick update: the fix of moving the coupon box above the cc box worked the first time, but now when trying again it wants me to enter cc info when i hit the Redeem button....

 

in includes/modules/order_total/ot_coupon.php line 82

just remove the JavaScript function that checks the credit card from the redeem image, i.e. remove "check_form(),"

 

$image_submit = '<input type="image" name="submit_redeem" onClick="return check_form(), submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" class="contbutton" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';


-avi

 

http://otn.com complete web site design, specializing in custom programming (php/perl/mysql/postgress/javascript/ajax/c/c++/python/ruby) databases, shopping carts, integration of web site with existing business systems (point of sales, accounting systems, etc.)

 

web site hosting, maintenance, promotion, marketing, search engine optimization (seo) and more.

Share this post


Link to post
Share on other sites
I am having the same problem, can you tell me if you have found a way to fix it?

 

Mike

 

I have tried quite a few things to fix this and this is what I came up with. Let me know if it works. Don't forget to back up.

 

In catalog/includes/classes/order_total.php

 

Around Line 132 Replace

 

$output_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>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;

 

With

 

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

 

Michael

Share this post


Link to post
Share on other sites
Anybody found out how to format this correctly? Any help would be appreciated. This is what it looks like:

 

Untitled-2.gif

 

Michael

 

took me a long while to figure this out... did it few days ago, so this might not be the only changes...

 

in /catalog/includes/modules/order_total/ot_coupon.php lines 78-87

 

change from:

 

		$selection_string = '';
	$selection_string .= '' . "\n";
	$selection_string .= ' </tr><tr><td class="main">' . "\n";
	$selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . ' and click ';
	$image_submit = '<input type="image" name="submit_redeem" onClick="return check_form(), submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" class="contbutton" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
	$selection_string .= '';
	$selection_string .= '' . $image_submit . '</td>';
	$selection_string .= '';
	$selection_string .= '' . "\n";
	return $selection_string;

 

to:

 

		$selection_string = '';
	$selection_string .= '' . "\n";
	$selection_string .= ' <tr><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td><td class="main">' . "\n";
	$selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . ' and click ';
	$image_submit = '<input type="image" name="submit_redeem" onClick="return check_form(), submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" class="contbutton" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
	$selection_string .= '';
	$selection_string .= '' . $image_submit . '</td><td width="10"><img src="images/pixel_trans.gif" border="0" alt="" width="10" height="1"></td></tr>';
	$selection_string .= '';
	$selection_string .= '' . "\n";
	return $selection_string;

 

i.e. add two td with spacer image, before and after the existing td, and move the /tr from beginning to the end


-avi

 

http://otn.com complete web site design, specializing in custom programming (php/perl/mysql/postgress/javascript/ajax/c/c++/python/ruby) databases, shopping carts, integration of web site with existing business systems (point of sales, accounting systems, etc.)

 

web site hosting, maintenance, promotion, marketing, search engine optimization (seo) and more.

Share this post


Link to post
Share on other sites

When a coupon is redeemed, but cannot be applied to the item being bought I get this message

 

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

 

I assume the <BR> should be the item name. Does this happen for anyone else? Any ideas where to fix this?

Share this post


Link to post
Share on other sites
When a coupon is redeemed, but cannot be applied to the item being bought I get this message

I assume the <BR> should be the item name. Does this happen for anyone else? Any ideas where to fix this?

The <BR> is probably an html line break. Look at your code to make sure the <br> falls at the right place. It could be in the language file also.

 

Michael

Share this post


Link to post
Share on other sites
Hi. I recently had v5.13a of CCGV installed on my store and it works quite well! My only question is this:

 

On checkout_payment.php when I enter CC info, and then a coupon code and hit 'Redeem', it refreshes the checkout_payment.php page and correctly applies the coupon, but the cc info is gone. The customer then has to enter it again and Continue to go checkout_confirmation.php Not a great customer experience and it feels like an 'error' occurred.

 

What I want to happen is either:

 

1. customer goes directly to checkout_confirmation.php when they hit 'Redeem'

 

2. if checkout_payment.php has to refresh when they hit 'Redeem' they should NOT have to enter a cc # before hitting 'Redeem'. Can the 'Redeem' button be pressed w/o checking for cc info but properly applying the coupon? Then, once it refreshes and applies the coupon they can enter cc info and continue.

 

I have what I think is version 5.10b on another site of mine (this came preinstalled via a template that I bought), and when I enter a coupon code and cc info and hit redeem it goes directly to checkout_confirmation which I like better.

 

Thank you for any help!

 

Regards,

 

-- Josh

 

I believe that the cc info is "gone" for security reasons, it is not kept anywhere in osCommerce, which I think is good (if annoying...)

 

for #1 I'll have to research, as I personally like #2, (especially after moving the ccgv above the credit card) but I bet it has to do with the JavaScript below, so you might want to compare the JavaScript on the "Redeem" button from 5.10 to the current version, and modify accordingly.

 

for #2 (this is for CCGV5.16 might be slightly different for earlier versions)

 

in includes/modules/order_total/ot_coupon.php line 82

just remove the JavaScript function that checks the credit card from the redeem image, i.e. remove "check_form(),"

 

$image_submit = '<input type="image" name="submit_redeem" onClick="return check_form(), submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" class="contbutton" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';


-avi

 

http://otn.com complete web site design, specializing in custom programming (php/perl/mysql/postgress/javascript/ajax/c/c++/python/ruby) databases, shopping carts, integration of web site with existing business systems (point of sales, accounting systems, etc.)

 

web site hosting, maintenance, promotion, marketing, search engine optimization (seo) and more.

Share this post


Link to post
Share on other sites

Hi all,

 

just posted my first contribution (v1 and v1.1) to the contribution page:

 

 

bunch of fixes v1.1 (table/roundoff/etc.)

 

v1.1 of my fixes instructions

 

This is for CCGV5.16, and is NOT the entire package, just a text file with revised instructions. (this instruction file replaces the original one)

 

NEW: add missing define in language file

NEW: align redeem button to input text field

 

0) add define for IMAGE_REDEEM_VOUCHER

 

1) fix the misalignment of the gift voucher/coupon code redeem table. including alignment of input field to redeem button image.

 

2) eliminate the checking of credit card info when the redeem button is pressed. i.e. redeem without entering credit card info, which is anyway erased after redeeming the coupon code.

 

3) move the gift voucher/coupon code table above the credit card table

 

4) fix round off errors in subtracting coupon value

 

5) checkout_confirmation.php does not pass coupon code to checkout_process.php

 

 

Hope this helps someone. this was not an easy contribution to install on a very highly customized/modified version of osCommerce...


-avi

 

http://otn.com complete web site design, specializing in custom programming (php/perl/mysql/postgress/javascript/ajax/c/c++/python/ruby) databases, shopping carts, integration of web site with existing business systems (point of sales, accounting systems, etc.)

 

web site hosting, maintenance, promotion, marketing, search engine optimization (seo) and more.

Share this post


Link to post
Share on other sites

Hi

 

Just installed this yesterday and had a problem when I create a coupon, the coupon amount does not transfer to the preview page?! :blink:

 

Must be something really small to fix and wondered if I can some help please, been sitting here for while now trying to see whats wrong. :mellow:

 

Which file is the most likely one to need checking?

 

 

 

Many thanks in advance

 

 

Diaz

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

×