Jump to content
Sign in to follow this  
aarondwyer

Credit Class / Gift Voucher "Easier to Understand" Payment Addon

Recommended Posts

Hi All

 

I've finally pulled finger and after a couple of months have brought together a bunch of code that began in the middle of the main Credit Class and Gift Voucher support thread here

 

http://forums.oscommerce.com/index.php?sho...=158518&st=2037

 

It was originally coded by Jonyo and it is a very nice addon that makes the payment screen for customers that wish to use their gift vouchers easier to understand.

 

I've taken the code and massaged it into shape and made the contribution installer for it. The code is spread over many pages of the main support thread, and was almost impossible to get working.

 

This installer should now make it easier for everyone to have this in their shop.

 

I've separated this thread from the main one, because it is really an addon to main contribution.

 

The contribution itself will go into the normal Credit Class and Gift Voucher contribution.

 

I will be posting the contribution shortly, but needed to make this thread first, so that I could reference it in the readme file.

 

Regards

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites

Hi,

I was so happy finding this solution and installed it. But when I go to checkout_payment I get a blank screen.

Any idea?

 

Devon

 

Hi All

 

I've finally pulled finger and after a couple of months have brought together a bunch of code that began in the middle of the main Credit Class and Gift Voucher support thread here

 

http://forums.oscommerce.com/index.php?sho...=158518&st=2037

 

It was originally coded by Jonyo and it is a very nice addon that makes the payment screen for customers that wish to use their gift vouchers easier to understand.

 

I've taken the code and massaged it into shape and made the contribution installer for it. The code is spread over many pages of the main support thread, and was almost impossible to get working.

 

This installer should now make it easier for everyone to have this in their shop.

 

I've separated this thread from the main one, because it is really an addon to main contribution.

 

The contribution itself will go into the normal Credit Class and Gift Voucher contribution.

 

I will be posting the contribution shortly, but needed to make this thread first, so that I could reference it in the readme file.

 

Regards

Aaron

Share this post


Link to post
Share on other sites
Hi,

I was so happy finding this solution and installed it. But when I go to checkout_payment I get a blank screen.

Any idea?

 

Devon

 

Not sure what that could be. There was quite a bit to change. We'll wait to see if others have problems as well, because it's working for me.

 

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites
Hi,

I was so happy finding this solution and installed it. But when I go to checkout_payment I get a blank screen.

Any idea?

 

Devon

 

 

Hi Devon,

Yeah, I've had the same problem on a working install of CCGV 5.14. checked all my entries against the install text but there doesn't seem to be any errors. One interesting point - the install file says that the checkout_process file will be altered, but it doesn't give any instructions for adding to it.

 

Maybe there is a PHP version problem or something similar - since some people are installing no probs.

 

Jono

 

 

:blink:

Share this post


Link to post
Share on other sites
Hi Devon,

Yeah, I've had the same problem on a working install of CCGV 5.14. checked all my entries against the install text but there doesn't seem to be any errors. One interesting point - the install file says that the checkout_process file will be altered, but it doesn't give any instructions for adding to it.

 

Maybe there is a PHP version problem or something similar - since some people are installing no probs.

 

Jono

:blink:

 

Jono,

 

I'm having similar problems after this install....

 

I searched the support thread for Jonyo's original stuff, and there is a function called mod_process that Jonyo added to catalog/includes/modules/order_total/ot_gv.php. The function, which was modified a few times, is as follows:

 

//-------------------------------------------------------------
function mod_process() {
 global $currencies;
   $my_order_total = $this->get_order_total();
   $my_od_amount = $this->calculate_credit($my_order_total);
   if ($this->calculate_tax != "None") {
	 $tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);
	 $my_od_amount = $this->calculate_credit($my_order_total);
   }
   $this->deduction = $my_od_amount;
   //$order->info['total'] = $order->info['total'] - $my_od_amount;
   if ($my_od_amount > 0) {
	 $this->my_output[] = array('title' => $this->title . ':',
					  'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',
					  'value' => $my_od_amount);
   }
  } 
//----------------------------------------------------------------------

 

This function needs to be added into catalog/includes/modules/order_total/ot_gv.php as indicated below:

  
	$output_string .= '<b>' . $this->checkbox . '</b>' . '</td>' . "\n";
  }
  return $output_string;
}


//-------------------------------------------------------------
function mod_process() {
 global $currencies;
   $my_order_total = $this->get_order_total();
   $my_od_amount = $this->calculate_credit($my_order_total);
   if ($this->calculate_tax != "None") {
	 $tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);
	 $my_od_amount = $this->calculate_credit($my_order_total);
   }
   $this->deduction = $my_od_amount;
   //$order->info['total'] = $order->info['total'] - $my_od_amount;
   if ($my_od_amount > 0) {
	 $this->my_output[] = array('title' => $this->title . ':',
					  'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',
					  'value' => $my_od_amount);
   }
  } 
//----------------------------------------------------------------------


// #################### End Added CGV JONYO ######################

function update_credit_account($i) {
  global $order, $customer_id, $insert_id, $REMOTE_ADDR;
  if (ereg('^GIFT', addslashes($order->products[$i]['model']))) {

 

 

That fixes one problem....

Prior to finding that problem, I noticed one other bug in the install instructions....

In the following code, there is an extra closing bracket present that causes the order_total class to ignore the bottom half of the code present in the file after you install this "easier to understand" mod:

 

In Step #5 - In /catalog/includes/classes/order_total.php...

 
	if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
}
// #################### End Added CGV JONYO ######################
  }

//--Note the extra bracket  below------------------------------
  }
//--(end) Note the extra bracket  ------------------------------

// this function is called in checkout process. it tests whether a decision was made at checkout payment to use

 

The bracket identified above needs to be removed. The real closing bracket is at the end of the file, just before the ?> at the bottom.

 

These changes have at least gotten my test site back up and running on the checkout page... but I have noticed a couple of other issues I'm still grappling with.... More to follow on those...

 

Hope that helps!

-MJ (supra661)

Edited by supra661

Share this post


Link to post
Share on other sites

Hi Mike

 

My bad on that one. Thank you for finding that.

 

I left out the mod_process function in the installer. I'll fix up the readme and repost to the contribution area.

 

I knew I'd miss something. I'm glad people are getting into it.

 

Aaron

 

This is what the first section of the installer html should have been for ot_gv.php

 

	  $this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX;
  $this->credit_class = true;
// #################### Begin Added CGV JONYO ######################
//	  $this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="submitFunction()" name="' . 'c' . $this->code . '">';
$this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="clearRadeos()" name="' . 'c' . $this->code . '">';
// #################### End Added CGV JONYO ######################
  $this->output = array();
}

// #################### Begin Added CGV JONYO ######################
// #################### if you set it in admin to not include tax or shipping in the amount

function process() {
  global $order, $currencies, $cot_gv;
//	  if ($_SESSION['cot_gv']) {  // old code Strider
   if (tep_session_is_registered('cot_gv')) {
	$order_total = $this->get_order_total();
	$od_amount = $this->calculate_credit($order_total);
	if ($this->calculate_tax != "None") {
	  $tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);
	  $od_amount = $this->calculate_credit($order_total);
	}
	$this->deduction = $od_amount;
//		if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != 'true')) {
//		  $od_amount -= $tod_amount;
//		  $order->info['total'] -= $tod_amount;
//		}
	$order->info['total'] = $order->info['total'] - $od_amount;
	if ($od_amount > 0) {
	  $this->output[] = array('title' => $this->title . ':',
					   'text' => '<b>' . $currencies->format($od_amount) . '</b>',
					   'value' => $od_amount);
	}
  }
}

function mod_process() {
 global $currencies;
   $my_order_total = $this->get_order_total();
   $my_od_amount = $this->calculate_credit($my_order_total);
   if ($this->calculate_tax != "None") {
	 $tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);
	 $my_od_amount = $this->calculate_credit($my_order_total);
   }
   $this->deduction = $my_od_amount;
   //$order->info['total'] = $order->info['total'] - $my_od_amount;
   if ($my_od_amount > 0) {
	 $this->my_output[] = array('title' => $this->title . ':',
					  'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',
					  'value' => $my_od_amount);
   }
  }

// #################### End Added CGV JONYO ######################

function selection_test() {
  global $customer_id;

 

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites
Hi Mike

 

My bad on that one. Thank you for finding that.

 

I left out the mod_process function in the installer. I'll fix up the readme and repost to the contribution area.

 

I knew I'd miss something. I'm glad people are getting into it.

 

Aaron

 

This is what the first section of the installer html should have been for ot_gv.php

 

......

 

 

Hey no problem. Looks like I actually posted the wrong info above too!! I put the mod_process function in the right place in my ot_gv.php file, but the post I placed earlier was incorrect... Good thing you re-posted the right stuff :)

 

Thanks!

 

-MJ

Edited by supra661

Share this post


Link to post
Share on other sites

It appears I've left something else out of the readme.html [sorry]

 

This is to go in /catalog/includes/classes/order_total.php

 

		  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$post_var = 'c' . $GLOBALS[$class]->code;
// #################### Begin Added CGV JONYO ######################
//			if ($HTTP_POST_VARS[$post_var]) $_SESSION[$post_var] = $HTTP_POST_VARS[$post_var];
//			if (!tep_session_is_registered($post_var)) tep_session_register($post_var);
		if ($HTTP_POST_VARS[$post_var]) {
							if (!tep_session_is_registered($post_var)) tep_session_register($post_var);
// ############ Added CCGV Contribution ##########
			$post_var = $HTTP_POST_VARS[$post_var];
// ############ End Added CCGV Contribution ##########
					}
// #################### End Added CGV JONYO ######################
		$GLOBALS[$class]->collect_posts();
	  }

 

I'll add this to the installer as well before I resubmit for v1.1

 

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites

Hi guys,

 

Thanks for that, it's now up and running. Cheers for the Mod too Jonyo & team, very nice. The checkbox system on CCGV was always a bit confusing - and ugly!

 

Cheers,

Jono

Share this post


Link to post
Share on other sites

Mike

 

What's the go with the extra brace you were talking about.

 

I must be going blind, I can't see the problem.

 

	function pre_confirmation_check() {
// #################### Begin Added CGV JONYO ######################
  global $payment, $order, $credit_covers, $customer_id;
// #################### End Added CGV JONYO ######################
  if (MODULE_ORDER_TOTAL_INSTALLED) {
	$total_deductions  = 0;
	reset($this->modules);
	$order_total = $order->info['total'];
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  $order_total=$this->get_order_total_main($class,$order_total);

	  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total);
		$order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total);
	  } //end if
	} //end while
// #################### Begin Added CGV JONYO ######################

  $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);
  $gv_payment_amount = $gv_result['amount'];

//		echo 'total='. $order->info['total'];
//		echo ' deduc='. $total_deductions;
//		echo ' gvamount='. $gv_payment_amount;

//		if ($order->info['total'] - $total_deductions <= 0 ) {
	if ($order->info['total'] - $gv_payment_amount <= 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');
	} //end else
// #################### End Added CGV JONYO ######################
  } //end if (MODULE_ORDER_TOTAL_INSTALLED)
} //end function

 

Looks like it needs both.

 

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites
Mike

 

What's the go with the extra brace you were talking about.

 

I must be going blind, I can't see the problem.

 

Aaron,

 

Holy crap!!

 

I just figured it out... It's my fault here, sorry! I took a closer look at my order_total file, and found this:

  
// #################### Begin Added CGV JONYO ######################
  global $payment, $order, $credit_covers, $customer_id;
// #################### End Added CGV JONYO ######################	  if (MODULE_ORDER_TOTAL_INSTALLED) {
	$total_deductions  = 0;

 

Basically, the entire "if (MODULE_ORDER_TOTAL_INSTALLED) { " bit is hidden behind the "end added cgv jonyo" comment!

 

...When I went back to debug, I didn't catch it since it was commented out, but the end effect was to cause the problems I was having with functions being truncated out of the file...

 

So I "fixed" it by removing the "extra" bracket.... OOPS! my bad :blush: DOH!

 

 

Thanks for your help!!

-MJ

Share this post


Link to post
Share on other sites

Ok since we've have a couple of independant installers now successully running with this mod, I'll release the v1.1 to the contribution section which covers what's been mentioned in the previous posts after my initial post.

 

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites

Hello Aaron,

I tested it now with the new updated instruction "CCGV_Easy2UnderstandPayment_v11" and it seems to work. I will check it now again slowly with different options for the customer.

Thank you so much. I was looking for such a long time for a easier way to redeem the gift voucher. And it comes at the right time for the customer - before christmas!

Devon

 

 

Ok since we've have a couple of independant installers now successully running with this mod, I'll release the v1.1 to the contribution section which covers what's been mentioned in the previous posts after my initial post.

 

Aaron

Share this post


Link to post
Share on other sites

Hi,

the checkbox to tick is under each payment option

 

Banktransfer

15,00 EUR Tick to use Gift Voucher account balance

 

Cash on Delivery

15,00 EUR Tick to use Gift Voucher account balance

 

PayPal

15,00 EUR Tick to use Gift Voucher account balance

 

and then again under

 

Gift Vouchers

Tick to use Gift Voucher account balance

 

but then without saying 15,00 EUR.

 

I checked install again but did not find anything.

Perhaps I have to say that I am using GV Version v5.03. But it works after fixing a lot of bugs and I am not going to update to a newer one :)

 

Any idea?

Devon

Share this post


Link to post
Share on other sites

Hi All,

It appears I'm having a similar problem to devon - I have installed this addon (v1.1) over a CCGV 5.14, and I get a checkbox in the Gift Voucher Redeem section as well as the correct checkbox in the payment type section. Strange...

 

In looking for an answer to this I've noticed that use_credit_amount_sub function is not called upon anywhere - is it meant to replace use_credit_amount??

 

Jono

Share this post


Link to post
Share on other sites

Ok - found the solution:

 

I don't know if I just missed something in the notes, but I found that in order_total.php in the credit_selection function, I had to replace:

 

  $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 != '') ) {

 

with

 

 $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 != '') ) {

 

so that it didn't reprint the use_credit_amount variable (ie the checkbox & accompanying text) again.

 

I couldn't see this in the readme file....hope this will be helpful.

 

Jono

Share this post


Link to post
Share on other sites
Hi All,

It appears I'm having a similar problem to devon - I have installed this addon (v1.1) over a CCGV 5.14, and I get a checkbox in the Gift Voucher Redeem section as well as the correct checkbox in the payment type section. Strange...

 

In looking for an answer to this I've noticed that use_credit_amount_sub function is not called upon anywhere - is it meant to replace use_credit_amount??

 

Jono

 

 

Jono,

 

Yep I've run into the same issue. The problem actully comes from the includes/classes/order_total.php file...

 

The function use_credit_amount() ends up getting called twice. First it is called by the newly-added sub_credit_selection, then it is called again by the original credit_selection() function again later on... I'm still digging through this, trying to make it work a little better, but to fix your immediate issue with duplicate check-boxes, try using the following code in the includes/classes/order_total.php file:

 

	 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="1" 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";
	$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 = '';
	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();  //MRJ commented this line out because already used in sub_credit_selection function called from below and used in checkout_payment.php 11/18/05
		if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();  //MRJ note: here is where $selection_string calls out the credit_selection class from the module ot_gv. 11/18/05
//		 if ( ($use_credit_string !='' ) || ($selection_string != '') ) {  //MRJ commented out this line to rewrite and remove $use_credit_string qualifier, not needed in this function anymore since moved into sub_credit_selection() below 11/18/05
		if ( $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; //MRJ commented out this line and replaced with below line because removing $use_credit_string 11/18/05
							'	 <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 ($output_string != '') {
	  $output_string = $header_string . $output_string;
	  $output_string .= $close_string;
	}
  }
  return $output_string;
}
// #################### Begin Added CGV JONYO ######################




function sub_credit_selection()
 {
 //	$selection_string = '';  //MRJ commented out, since selection_string is not necessary here 11/18/05
	   $close_string = '';
	   $credit_class_string = '';
	  if (MODULE_ORDER_TOTAL_INSTALLED) 
   {
		reset($this->modules);
		$output_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();   //MRJ commented this out, is unnecessary  11/08/05
		//  if ( ($use_credit_string !='' ) || ($selection_string != '') ) {		 //MRJ removed old code to get rid of $selection_string statement 11/18/05 
			if ($use_credit_string !='') 
			 {
		  $output_string = $use_credit_string;
			$output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';	 
			$output_string .= '  </tr></table></td><td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td></tr>' . "\n";  
		//	$output_string.=$GLOBALS[$class]->use_credit_amount();
		//	$output_string .= $selection_string;
			 }
		   }
		 }
	   }
	  return $output_string;
 }
// #################### End Added CGV JONYO ######################

 

It's still a bit rough, but it'll do the trick. Unfortunately, I'm still trying to figure out why hitting "redeem" for the coupon entry brings me to the confirmation screen without any payment info present! ...Still working on that one, maybe just an error on my part...

 

HTH

-MJ

Edited by supra661

Share this post


Link to post
Share on other sites

Sorry I missed adding the Begin and End markers on that change when I first merged the code, so it didn't make it into the install.

 

I've now added it to v1.2 of this contribution which is pending on Mike investigating his redeem button issue. You never know there may be some other issue.

 

I don't have that issue on either Firefox or IE6. What browser are you using.?

 

You actually only need to do this to make it work. The other code you commented out shouldn't affect the outcome.

 

Locate this within the function credit_selection() and make the change

	   while (list(, $value) = each($this->modules)) {
	 $class = substr($value, 0, strrpos($value, '.'));
	 if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

// #################### 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 != '') ) {

 

Let me know about any other issues and I'll roll them into v1.2

 

Thanks

Aaron


Aaron Dwyer

Share this post


Link to post
Share on other sites

Can anyone point me to a site that is using this contribution so I can see how it looks before I ask our web folks to install it on our site if it fits the bill for us too?

 

Cheers

Steve

Share this post


Link to post
Share on other sites
Can anyone point me to a site that is using this contribution so I can see how it looks before I ask our web folks to install it on our site if it fits the bill for us too?

 

Cheers

Steve

 

If you download the contribution, there is a picture included that provides an example for you of what it looks like. However, I'll PM you with a link to my test site where you can add a product to your cart and take a look at it. (You'll have to create an account, etc)... I'm currently making some modifications, though... Specifically, I'm testing a few changes to switch the "check box" to a "radio button" instead, which looks a bit more natural to me...

 

-MJ

Share this post


Link to post
Share on other sites
If you download the contribution, there is a picture included that provides an example for you of what it looks like. However, I'll PM you with a link to my test site where you can add a product to your cart and take a look at it. (You'll have to create an account, etc)... I'm currently making some modifications, though... Specifically, I'm testing a few changes to switch the "check box" to a "radio button" instead, which looks a bit more natural to me...

 

-MJ

 

Thanks Mike.. I saw the pic but it didn't give me a real feel so a link would be much appreciated !

 

Cheers

Steve

Share this post


Link to post
Share on other sites

Just finished installing, and something has me concerned.

 

I like how the mod turns off the payment options buttons if the available vouchers cover the total purchase. However, if I have tax and shipping set to be excluded from voucher use, the system apparently doesn't provide me with the ability to pay those amounts (i.e., I never get to choose a payment option for the few dollars I'll owe).

 

Am I missing something? Thanks.

 

- Mike

Share this post


Link to post
Share on other sites

Well, lemme answer part of my own question.

 

The fact that I'm indirectly suggesting that tax should be applied to purchases fully covered by a voucher is most likely double jeapordy. The tax would have been collected on the original voucher purchase.

 

I definitely need to play with the "include/exclude" settings more for coupons and GV's to get a better sense of how this works.

 

Anyone have any recommendations on simple, vanilla values to for GV and coupon tax settings that make sense? Thanks.

Share this post


Link to post
Share on other sites
Sorry I missed adding the Begin and End markers on that change when I first merged the code, so it didn't make it into the install.

 

I've now added it to v1.2 of this contribution which is pending on Mike investigating his redeem button issue. You never know there may be some other issue.

 

I don't have that issue on either Firefox or IE6. What browser are you using.?

 

You actually only need to do this to make it work. The other code you commented out shouldn't affect the outcome.

 

Locate this within the function credit_selection() and make the change

	   while (list(, $value) = each($this->modules)) {
	 $class = substr($value, 0, strrpos($value, '.'));
	 if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

// #################### 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 != '') ) {

 

Let me know about any other issues and I'll roll them into v1.2

 

Thanks

Aaron

 

Aaron - I've tested this redeem button issue on my site and it doesn't seem to be a problem. Perhaps it's due to the extra code which Mike is commenting out.

 

Jono

Share this post


Link to post
Share on other sites
Aaron - I've tested this redeem button issue on my site and it doesn't seem to be a problem. Perhaps it's due to the extra code which Mike is commenting out.

 

Jono

 

Jono / Aaron,

 

I'm pretty sure this has nothing to do with anything commented out in what I posted earlier.... however, that doesn't mean it isnt something else I messed up somewhere along the way....

 

Here's a little more detail about the problem I've run across:

 

1) If check/money order or paypal is selected as the payment method (not using any gift cert, etc), and I click "redeem" with nothing entered into the input box... Then I am redirected straight on to the confirmation page, af if I had simply clicked "continue".

 

2) If credit card is selected as method of payment (with no valid cc info entered), and I click "redeem" (again with nothing entered into the coupon code box), then I am brought back to the checkout payment page with an error at the top complaining that I haven't got the right expiration date entered into the credit card space.... No javascrit warning preceded this to tell me to input payment info into the credit card info entry space...

 

3) Entry of an invalid redeem code results in proper operation (I get redirected back to checkout payment page with an error stating invalid redeem code)

 

4) Entry of a valid redeem code also results in proper operation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×