Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

very simple question hopefully...

 

i have the shopping cart info in header contrib, and my entire right column is gone. i have figured out how to make the "shopping cart box" appear only when a coupon redeemed.

 

now, for my question. i cannot find out how to remove the top line inside the box that says "coupons". if i do remove it from the only place i can find it, the box heading also dissappears.

 

any idea?

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

very simple question hopefully...

 

i have the shopping cart info in header contrib, and my entire right column is gone. i have figured out how to make the "shopping cart box" appear only when a coupon redeemed.

 

now, for my question. i cannot find out how to remove the top line inside the box that says "coupons". if i do remove it from the only place i can find it, the box heading also dissappears.

 

any idea?

 

 

Sorry I dont understand what you are saying but if you have removed the coupons text buy removing the array_add in a "/includes/boxes" prog I would put it back and change the text to '' in includes/languages.

 

HTH

 

Si.

Link to comment
Share on other sites

Look back a few pages I have already looked into and answered this before, I added some "basic" code that would solve this.

 

HTH

 

Si.

 

Sorry to be a major pain but do you know which page the code is on (or which php page it goes on), or how many pages back it is roughly - i've just gone back 20 pages reading through and nothing jumps out relating to the code for the solution.

 

In the mean time i'll keep looking.

Link to comment
Share on other sites

Sorry to be a major pain but do you know which page the code is on (or which php page it goes on), or how many pages back it is roughly - i've just gone back 20 pages reading through and nothing jumps out relating to the code for the solution.

 

In the mean time i'll keep looking.

 

I've got the version 5.14 installed, will i be able to get around the problem keeping my same installation? (Through adding some coding somewhere) - or will i have to get the new 5.15 version from 17th December?

 

Ideally i'd like to just make it compulsory that payment details are asked for so they pay for packaging, as the voucher isnt designed to cover postage costs in this situation. If it can be done with only tweaking a file or two that'd be great - a full new installation of contrib wouldnt be good.

 

I'll keep reading through for that code.

Link to comment
Share on other sites

I have been working on integrating this contribution on my test OSC site and things are going well. My site is heavily modded already and the integration has been tedious but fruitful. I must say that I am extremely impressed with this contribution. The features it provides are really awesome.

 

I have the Purchase Without Account (PWA) v0.90 contribution installed on my site. Everything integrated fine with no code conflicts. I tested Coupons and they work fine. Gift Vouchers work fine as well except, obviously, when a customer attempts to purchase a Gift Voucher without an account established. CCVG was obviously designed to work only with cusomters that have accounts and I understand that fact.

 

So I did some digging last night and found the code that checks the shopping cart for products starting with GIFT. I was able to insert a few lines of code in login.php that checks the current shopping cart and if it finds that the cart contains any product name beginning with GIFT, it does not give the customer the option to Purchase Without Account. It only provides the customer the option to login with an existing account or create a new account. This seems to be a viable solution so I wanted to share the code that checks she shopping cart for a Gift Voucher so that anyone could benefit from it.

 

I did not write this code snippet and take no credit for it. I did trim it down so that it performs only that function of looking in the cart for the product model GIFT and allows you code around this logic. Let me know if this helps anyone.

 

I found the original code that checks for the shopping cart here: /catalog/includes/modules/order_total/ot_coupon.php at around line 373 beginning at this code comment:

// Check if gift voucher is in cart and adjust total.

 

I took this code snippet and modified it to fit inside login.php so that customers do not get the option to Purchase Without Account. Here is the code snippet in login.php that I slightly modified:

 

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

<!-- BEGIN - PWA ON: Proceed Directly to Checkout -->

<?php

if (PWA_ON == 'true') {

// BEGIN >>> Contribution CCVG v5.13 - Custom Modification for PWA Contribution

$gv_incart = "false";

$products = $cart->get_products();

for ($i=0; $i<sizeof($products); $i++) {

$t_prid = tep_get_prid($products[$i]['id']);

$gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");

$gv_result = tep_db_fetch_array($gv_query);

if (ereg('^GIFT', addslashes($gv_result['products_model']))) {

$gv_incart = "true";

}

}

if (($gv_incart == "false") && ($cart->count_contents() > 0) && (!isset($HTTP_GET_VARS['my_account_f']) || $HTTP_GET_VARS['my_account_f'] !=1)) { // only display of box if something in cart

// END <<< Contribution CCVG v5.13 - Custom Modification for PWA Contribution

?>

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

 

You can take this code an put it anywhere....Hope this helps someone. I am now looking to only allow a customer to use a Gift Voucher by credit card. I do not want customers to purchase a Gift Voucher by Check or Money Order so I am looking to add this code snippet to remove the Check or Money Order option when a Gift Voucher is in the cart. I'll post that soon once it have it working. Hope this helps...

 

Joe

Link to comment
Share on other sites

I am still testing in my dev OSC site and am not live with CCVG v5.14 yet. I have a question regarding CCVG and possible fraud abuse. I think it will turn off customers if a customer makes a purchase of a Gift Voucher and the Voucher is not immediately in their cart for use. The customer gets their standard purchase e-mail receipt, but then their voucher non-existent and is delayed until the admin verifies funds and "releases" the voucher so it shows up in the shopping cart for use. If I was a customer that just spent $100 let's say on a Gift Voucher, I personally would be upset, especially if I used a credit card to make the purchase, and had nothing to show for it immediately.

 

So my question is this: If a customer is forced to use a Credit Card to purchase a Gift Voucher, what is the fraud risk in allowing the Gift Voucher to be automatically available for use? My site does not provide downloads of software so they can't immediately receive a product until it is shipped. What is the fraud risk here? What can a customer do here to rip off the store owner with Gift Vouchers automatically being made available after purchase?

 

Thanks,

 

Joe

Link to comment
Share on other sites

I am still testing in my dev OSC site and am not live with CCVG v5.14 yet. I have a question regarding CCVG and possible fraud abuse. I think it will turn off customers if a customer makes a purchase of a Gift Voucher and the Voucher is not immediately in their cart for use. The customer gets their standard purchase e-mail receipt, but then their voucher non-existent and is delayed until the admin verifies funds and "releases" the voucher so it shows up in the shopping cart for use. If I was a customer that just spent $100 let's say on a Gift Voucher, I personally would be upset, especially if I used a credit card to make the purchase, and had nothing to show for it immediately.

 

So my question is this: If a customer is forced to use a Credit Card to purchase a Gift Voucher, what is the fraud risk in allowing the Gift Voucher to be automatically available for use? My site does not provide downloads of software so they can't immediately receive a product until it is shipped. What is the fraud risk here? What can a customer do here to rip off the store owner with Gift Vouchers automatically being made available after purchase?

 

Thanks,

 

Joe

 

Joe,

 

I have looked into this and the fraud risks are high. Im not saying that people would but it only takes one swine to spoil it for all the others.

 

If you send a voucher immediately they could send it to another email address, create an account, spend it on more goods and as soon as they receive the despatch mail on the new goods cancel their card or call for it being nicked. Granted you can go to the address the customer has sent the goods but what can you say someone signed for the goods so I want them back? Legally I think it would be OK but then how do you recover the goods?

 

On my list of things to do is to stop this email being sent or the item on the email if the order contains other products, then to send another email once the redeem button has been pressed. Unfortunately that is 1-2 months away.

 

 

For now I have left the item on the email and added some extra code saying that the item will be released once payment has been confirmed in x days.

 

HTH

 

Si.

Link to comment
Share on other sites

I am still testing in my dev OSC site and am not live with CCVG v5.14 yet. I have a question regarding CCVG and possible fraud abuse. I think it will turn off customers if a customer makes a purchase of a Gift Voucher and the Voucher is not immediately in their cart for use. The customer gets their standard purchase e-mail receipt, but then their voucher non-existent and is delayed until the admin verifies funds and "releases" the voucher so it shows up in the shopping cart for use. If I was a customer that just spent $100 let's say on a Gift Voucher, I personally would be upset, especially if I used a credit card to make the purchase, and had nothing to show for it immediately.

 

So my question is this: If a customer is forced to use a Credit Card to purchase a Gift Voucher, what is the fraud risk in allowing the Gift Voucher to be automatically available for use? My site does not provide downloads of software so they can't immediately receive a product until it is shipped. What is the fraud risk here? What can a customer do here to rip off the store owner with Gift Vouchers automatically being made available after purchase?

 

Thanks,

 

Joe

 

 

You can disable the hold queue so that your point is overruled. The queue is for people that have soft product such as downloadable files etc etc. If the queue isn't held and someone purchases a GV and then kills the paypal transfer then they'd have X amount of $$$ to go BACK and apply a non existant $XXX voucher that has never been paid for and the user can then download any of the soft product is under the $XXX value.

 

Chris

Link to comment
Share on other sites

Hmmm...Good points all. So just to try and close loop on this thought process here: If you are NOT selling soft products, and you are forcing the customer to use credit cards only (not pay pal for example), the credit card get's approved instantly at purchase. If the voucher is automatically available, the customer can e-mail or redeem the GV to make a purchase, true. However, since it takes a day or so to process, package and ship the physical items ordered, what is the risk here? If the customer cancels his credit card purchase, you still have not yet shipped the product. If after you mail the product, the customer can still cancel the credit card purchase just like any order so what is the risk here...

 

Joe

Link to comment
Share on other sites

I figured out how to force the checkout process to prevent display of payment by Check or Money Order if a only if Gift Voucher is in the shopping cart. This forces a customer to pay using a more instant type of payment method, i.e. credit card. If you choose to allow GV to be redeemed immediately, this code would prevent a customer from selecting a payment by check and then making an instant GV purchase without the check clearing first.

 

This code was added to /catalog/checkout_payment.php at around line 261 after "for ($i=0, $n=sizeof($selection); $i<$n; $i++) {". This could easily be modified to check for other payment methods such as Pay Pal, etc. I am not a PHP expert here and had to look up a PHP command or two to get it working so if you have a better suggestion on this code please help make any corrections...

 

 

for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

// BEGIN >>> Contrubution: CCVG v5.13 - Custom Modification: Remove Check or Money Order Option if GV is in cart.

if (strtolower(MODULE_PAYMENT_MONEYORDER_STATUS) == "true" && strtolower($selection[$i]['id']) == "moneyorder") {

$products = $cart->get_products();

for ($j=0; $j<sizeof($products); $j++) {

$t_prid = tep_get_prid($products[$j]['id']);

$gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");

$gv_result = tep_db_fetch_array($gv_query);

if (ereg('^GIFT', addslashes($gv_result['products_model']))) {

continue 2;

}

}

}

// END <<< Contrubution: CCVG v5.13 - Custom Modification: Remove Check or Money Order Option if GV is in cart.

?>

 

Hope this helps...

 

Joe

Link to comment
Share on other sites

I am still testing in my dev OSC site and am not live with CCVG v5.14 yet. I have a question regarding CCVG and possible fraud abuse. I think it will turn off customers if a customer makes a purchase of a Gift Voucher and the Voucher is not immediately in their cart for use. The customer gets their standard purchase e-mail receipt, but then their voucher non-existent and is delayed until the admin verifies funds and "releases" the voucher so it shows up in the shopping cart for use. If I was a customer that just spent $100 let's say on a Gift Voucher, I personally would be upset, especially if I used a credit card to make the purchase, and had nothing to show for it immediately.

 

So my question is this: If a customer is forced to use a Credit Card to purchase a Gift Voucher, what is the fraud risk in allowing the Gift Voucher to be automatically available for use? My site does not provide downloads of software so they can't immediately receive a product until it is shipped. What is the fraud risk here? What can a customer do here to rip off the store owner with Gift Vouchers automatically being made available after purchase?

 

Thanks,

 

Joe

there is also a contribution called "purchase limter"

 

this caps a limit of your choice that a new first time customer is allowed to purchase a maximum in any currency and any method, so you apply to cap a limit of $50 for new customers but on credit card only and not paypal (if you want)

 

after that they can shop as normal... if you want you can modify that contribution to keep the cap as long as you want i suppose

 

try it

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

Can anyone help me with this error. I have a live shop and I need to fix this soon. Thank you for your time!

 

Fatal error: Cannot redeclare class order_total in /home/motor3n1/public_html/catalog/includes/classes/order_total.php on line 8

 

<?php

/*

 $Id: order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License

*/
class order_total {
var $modules;
// class constructor
function order_total() {
  global $language;
  if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
	$this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value);
	  include(DIR_WS_MODULES . 'order_total/' . $value);
	$class = substr($value, 0, strrpos($value, '.'));
	  $GLOBALS[$class] = new $class;
	}
  }
}
function process() {
  $order_total_array = array();
  if (is_array($this->modules)) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ($GLOBALS[$class]->enabled) {
		$GLOBALS[$class]->process();
		for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
		  if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
			$order_total_array[] = array('code' => $GLOBALS[$class]->code,
										 'title' => $GLOBALS[$class]->output[$i]['title'],
										 'text' => $GLOBALS[$class]->output[$i]['text'],
										 'value' => $GLOBALS[$class]->output[$i]['value'],
										 'sort_order' => $GLOBALS[$class]->sort_order);
		  }
		}
	  }
	}
  }
  return $order_total_array;
}
function output() {
  $output_string = '';
  if (is_array($this->modules)) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ($GLOBALS[$class]->enabled) {
		$size = sizeof($GLOBALS[$class]->output);
		for ($i=0; $i<$size; $i++) {
		  $output_string .= '			  <tr>' . "\n" .
							'				<td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .
							'				<td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
							'			  </tr>';
		}
	  }
	}
  }
  return $output_string;
}
// ############ Added CCGV Contribution ##########
//
// This function is called in checkout payment after display of payment methods. It actually calls
// two credit class functions.
//
// use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce
// the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc.
//
// The second function called is credit_selection(). This in the credit classes already made is usually a redeem box.
// for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on
// E.g. a setting in the admin section.
//
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";
	$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();
		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;
}


//			if ($selection_string !='') {
//			  $output_string .= '</td>' . "\n";
//			  $output_string .= $selection_string;
//			}




// update_credit_account is called in checkout process on a per product basis. It's purpose
// is to decide whether each product in the cart should add something to a credit account.
// e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount
// to the Gift Voucher account.
// Another use would be to check if the product would give reward points and add these to the points/reward account.
//
function update_credit_account($i) {
  if (MODULE_ORDER_TOTAL_INSTALLED) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$GLOBALS[$class]->update_credit_account($i);
	  }
	}
  }
}
// This function is called in checkout confirmation.
// It's main use is for credit classes that use the credit_selection() method. This is usually for
// entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes.
// If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment
// with an error
//
function collect_posts() {
  global $HTTP_POST_VARS,$HTTP_SESSION_VARS;
  if (MODULE_ORDER_TOTAL_INSTALLED) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$post_var = 'c' . $GLOBALS[$class]->code;
		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 ##########
		  }
		$GLOBALS[$class]->collect_posts();
	  }
	}
  }
}
// pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the
// credits available are greater than the order total. If they are then a variable (credit_covers) is set to
// true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order
// total, we don't want to go to paypal etc.
//
function pre_confirmation_check() {
  global $payment, $order, $credit_covers;
  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);
	  }
	}
	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');	
			}
  }
}
// this function is called in checkout process. it tests whether a decision was made at checkout payment to use
// the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account
// is reduced the order total amount.
//
function apply_credit() {
  if (MODULE_ORDER_TOTAL_INSTALLED) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$GLOBALS[$class]->apply_credit();
	  }
	}
  }
}
// Called in checkout process to clear session variables created by each credit class module.
//
function clear_posts() {
  global $HTTP_POST_VARS,$HTTP_SESSION_VARS;
  if (MODULE_ORDER_TOTAL_INSTALLED) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {
		$post_var = 'c' . $GLOBALS[$class]->code;
			if (tep_session_is_registered($post_var)) tep_session_unregister($post_var);
	  }
	}
  }
}
// Called at various times. This function calulates the total value of the order that the
// credit will be appled aginst. This varies depending on whether the credit class applies
// to shipping & tax
//
function get_order_total_main($class, $order_total) {
  global $credit, $order;
//	  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'];
  return $order_total;
}
// ############ End Added CCGV Contribution ##########
 }
?>

Edited by RollingStone
Link to comment
Share on other sites

hey all CGGV and SPPC users:

Too many contributions to pick from, and I'm getting confused on which will do what.

Please read my desires and advise which contribution(s) will be good to use,

and what if any new/custom modules/files/parts might need to be required to pull this all off.

I figure those of you who are using these MODS daily are the best folk to say if it will do what I want.

I have also posted this in SPPC support forum, as I may need both of these MODS or maybe one or the other is the better choice. I know y'all will set me straight!

 

I want to have 3 customer type/groups.

 

group A is regular retail. they will get standard price, but also I want to offer price breaks on a per-product basis for example order 4 each and price is lower per each. Also this group will see the category I have set up under bundled products "kits and sets" which have discounts built into the bundled price. Also this group can be bumped into group B or C if their order is sufficiently large. This part could get tricky as if this happens, all bundled products will have to be split into their components and placed back into the cart separately as customers do not get to double-dip discounts.

 

Now groups B and C are two levels of wholesale discount, 25% and 50%. This discount can be applied at the end onto the order total. It doesn't matter if the discounted price shows for each product as they are shopping, but if it does, I would want both retail and discount price, after they are logged in of course. They do not get to see bundled products category "kits and set" again due to no double-dipping allowed, and they will not get quantity price breaks per product/item. Just the straight % off retail at the end.

 

Also for group C, I cannot do 50% on some items (mostly sewing notions that I don't manufacture), so those items need to be capped at 25%. I would like to add products in the future that would only be available to this group. And to have a certain level of annual sales to stay in this group. And while we're dreaming, let's have a monthly check to see who needs an email reminding them to order $$$ by [date] to stay in the group.

 

Coupons per product or order, or gift certificates, would be gravy but has not yet been a big part of my marketing and distribution efforts.

 

Just for future thought, after this MOD, I will be working on a "dangling carrot" MOD effect of freebies as the order grows, so I will want to be sure they work together. One carrot could be a coupon for a future purchase! Of course the carrots will be different for each of the three groups. HAHAHAHA I know it's possible, osC can do Anything!! Well OK except maybe it can't wash dishes. Darn.

 

I'm willing to get my hands dirty in the database and php, so offer up what you think might be an ideal combo. I am not expecting an out-of-the-box solution, but if one exists, WOO-HOO!! I don't really understand classes (yet) but I can follow the logic and cut-n-paste with relish, sometimes have even made stuff up and it worked! Plus all my MODS so far have required at least some tweaking and I really like my new cart system and adjusting it to meet my needs. It is cool how osC can be twisted and molded to match so many different types of stores and businesses and languages and etc etc etc.

 

As always, TIA

Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Link to comment
Share on other sites

Sorry I dont understand what you are saying but if you have removed the coupons text buy removing the array_add in a "/includes/boxes" prog I would put it back and change the text to '' in includes/languages.

 

HTH

 

Si.

here is a screen shot of the section i cannot get to change right...

 

cart1.JPG

 

 

the line of code that changes that is in /catalog/includes/boxes/shopping_cart.php

 

$info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);

 

that one line of code denotes both lines in the box that say "shopping cart"

 

 

if i go into the /includes/languages/english.php and change the definition of BOX_HEADING_SHOPPING_CART, both lines change the same...

 

 

hope that helps to clear up my question...

Link to comment
Share on other sites

OK

 

I found the problem with the voucher greater than value of the total cost. It is found in the catalog/includes/classes/order_total.php.

 

A refresher: If a gift voucher is present for the voucher holder, and that user decides to purchase a product but NOT use the voucher the current transaction, it bypasses the payment module, adds the order to the database, but no payment can be made because it was bypassed because the voucher value is greater than the order total. It is mentioned in the comments of the authors file:

 

 

// pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the
// credits available are greater than the order total. If they are then a variable (credit_covers) is set to
// true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order
// total, we don't want to go to paypal etc.

 

 

The code that deals with this is:

 

	  $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'];

//		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');

}

 

I've tried to comment it out, and when the voucher is present and the order is less, then the order passes to paypal (in my case) and is normal. However, if I try ANY transaction using the existing voucher, this code is missing and a $messagestack error of "select a payment module" error appears.

 

So what this code needs a conditional switch with a function bypass of this code if the checkbox to "use voucher value" is NOT selected and allow processing as normal and a switch that if the checkbox IS active that this code is used to allow the proper processing of the voucher variable to deduct from the total cost value.

 

I believe that once this is done the voucher system will be 100%

 

Its late here now 1AM my time and bed time.........if someone can come up with a hack i'll try it out. If not I'll continue on it some more tomorrow

 

Chris

Link to comment
Share on other sites

hiya, I am getting duplicates adn triplets of things in the configuration in the admin

 

To offer a gift voucher 0 Info

To offer a gift voucher 0 Info

To offer a gift voucher 0 Info

Offrir un coupon de r?duction Info

To offer a discount coupon Info

To offer a discount coupon Info

To offer a discount coupon

Link to comment
Share on other sites

when i hit redeem to redeem my coupon (value $5), i get this message up top

 

Congratulations, you have redeemed ERROR_REDEEMED_AMOUNT_ZERO

 

hmm, it doesnt seem to be deducting the coupon amount either

Link to comment
Share on other sites

hiya, I am getting duplicates adn triplets of things in the configuration in the admin

 

To offer a gift voucher 0 Info

To offer a gift voucher 0 Info

To offer a gift voucher 0 Info

Offrir un coupon de r?duction Info

To offer a discount coupon Info

To offer a discount coupon Info

To offer a discount coupon

 

 

That is because you've installed the module, uninstalled it........looks like 7 times........you need to access the database directly and delete all of them. Uninstall the module, and then reinstall it ONCE. It looks like the implosion routine of the version you have is not working correctly which is a major down fall of some of the versions. Find the "french fix" 5.14 and the "easy to understand" checkout add ons and that should fix this problem for you.

Link to comment
Share on other sites

hmm, it doesnt seem to be deducting the coupon amount either

 

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***');

Link to comment
Share on other sites

Ok I've modified my code as follows:

	  $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'];


	if ($order->info['total'] - $gv_payment_amount <= 0 ) {
			if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
				  $credit_covers = true;
				  //die( "Is True" );  //used for diagnostic value comparison to see if voucher against total is less than or equal or NOT
				}
			else{   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
							$credit_covers = false;
							//die( "Is False" );  //used for diagnostic value comparison to see if voucher against total is less than or equal or NOT
				if(!tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');

}

 

And the values of true and false can be applied if the voucher is greater than or less than, and I validated its functions values with the die statements for diagnotics. If the final total is less then a value of true is returned, if the final total is greater it returns false, but for some reason that variable 'credit_covers' isn't the final control of whether or not the value less than the GV dumps to paypal (in my case)

 

Looking for some help..............I'm pluggin away, but not sure what it is. I'll keep pluggin away, I hope someone can chime in here for some support. Getting closer but no cigar......yet

 

Chris

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.
Note: Your post will require moderator approval before it will be visible.

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