Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Discount


boxtel

Recommended Posts

Now that is the proper way to whine, reminds me of all those "I give up" posts.

 

But, this, as most threads, is a support thread, not a code dispencer and as I said before, this thread supports easy discount and not necessarily all the discount conditions and amount calculations creative people can come up with, they are infinite. It seems it has grown into just that but that does not mean that its scope has automatically become infinite as well.

 

I know I frequently do provide the required code but only because I have the code already, it is a very interesting challenge or the requester has at least put in some effort and gets stuck. None apply to you.

 

I gave you the advice on how to go about it in post 464 but you did not even give it a try yourself.

 

So I would suggest you give it a try at least and doors might open.

 

hey box when you get a chance you think you could help me out with how I would go about doing buy 3 get 2 free or something to that effect?

Link to comment
Share on other sites

hey box when you get a chance you think you could help me out with how I would go about doing buy 3 get 2 free or something to that effect?

 

Yes no?

Link to comment
Share on other sites

the easy discount are workink fine,but i can?t see the sucess ou error messages,

 

see an example :

 

cupom.jpg

 

 

 

Anybody can help me?

 

 

Tanks from Brazil

I did, helped or traslate.

http://addons.oscommerce.com/profile/104964

 

My english it´s só poor, but of you need help in portuguese, like shipping and payment that´s make a diference in brazil, come one,

Obrigado (thank´s)

 

Link to comment
Share on other sites

I"m using the following code in application_top.php:

 

if (!tep_session_is_registered('easy_discount')) {

tep_session_register('easy_discount');

$easy_discount = new easy_discount();

}

 

//set discount for individual items at 15 percent at 25 items or more

$easy_discount->reset();

$products = $cart->get_products();

$n=sizeof($products);

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

if ($products[$i]['quantity']) >= 25) {

$easy_discount->set($products[$i]['id'],'Bulk Discount '.$products[$i]['name'],$products[$i]['price']*$products[$i]['quantity']*0.15);

else {

$easy_discount->clear($products[$i]['id']);

}

}

 

I'm getting the following error:

Parse error: syntax error, unexpected T_IS_GREATER_OR_EQUAL in /home/nootersc/public_html/catalog/includes/application_top.php on line 273

 

Line 273 is in red above. I got the code from something that was posted before (by Amanda I think) I'm not sure what I'm doing wrong. Could somebody help please?

Thanks!!

Link to comment
Share on other sites

One opening round bracket and two closing ones

 

OK, from my limited knowledge of php I see what you are saying. Unfortunately, I'm not sure what to change to correct it. I've tried a few things but apparently not the right thing. Where should I add an opening bracket or should I remove one of the existing ones? I really appreciate the help!!

Link to comment
Share on other sites

if ((

 

That seems to have solved the problem on line 273 but now I'm getting another error:

 

Parse error: syntax error, unexpected T_ELSE in /home/nootersc/public_html/catalog/includes/application_top.php on line 275

 

I really appreciate the help. thanks.

Link to comment
Share on other sites

Hooray! I got it working. For anybody following this thread I have posted the code below. I have tested it and it seems to work OK. (I'll know for sure as time goes on) This code was originally written by Amanda (Thanks at ton, Amanda) on post #139. There were just a few minor errors. This code will discount individual items a set percent if they buy a certain amount of the item. In the code below the customer will get a 15% discount on any item when they purchase 25 or more. It does not discount other items where the customer purchases less than 25.

 

 

//set discount for individual items at 15 percent for 25 items or more

$easy_discount->reset();

$products = $cart->get_products();

$n=sizeof($products);

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

if (($products[$i]['quantity']) >= 25) {

$easy_discount->set($products[$i]['id'],'Bulk Discount '.$products[$i]['name'],$products[$i]['price']*$products[$i]['quantity']*0.15);

}else {

$easy_discount->clear($products[$i]['id']);

}

}

 

 

A big "Thank You" to everybody who helped.

Link to comment
Share on other sites

Hooray! I got it working. For anybody following this thread I have posted the code below. I have tested it and it seems to work OK. (I'll know for sure as time goes on) This code was originally written by Amanda (Thanks at ton, Amanda) on post #139. There were just a few minor errors. This code will discount individual items a set percent if they buy a certain amount of the item. In the code below the customer will get a 15% discount on any item when they purchase 25 or more. It does not discount other items where the customer purchases less than 25.

//set discount for individual items at 15 percent for 25 items or more

$easy_discount->reset();

$products = $cart->get_products();

$n=sizeof($products);

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

if (($products[$i]['quantity']) >= 25) {

$easy_discount->set($products[$i]['id'],'Bulk Discount '.$products[$i]['name'],$products[$i]['price']*$products[$i]['quantity']*0.15);

}else {

$easy_discount->clear($products[$i]['id']);

}

}

A big "Thank You" to everybody who helped.

 

Contratulations on your preserverance... I gave up!

Link to comment
Share on other sites

I'm having trouble installing Easy Discount. I'm going to quote some code, using "<-----" and "----->" to indicate where a block of quoted code begins and ends.

 

 

I don't have the following in shopping_cart.php:

 

<-----

 

<tr>

<td>

<table width="100%">

<tr>

<td align="right" class="smallText"><?php echo SUB_TITLE_SUB_TOTAL; ?>

<?php

echo $currencies->format($cart->show_total());

?>

</td>

</tr>

</table>

</td>

</tr>

 

----->

 

Instead, I have the following (assuming six lines before and after):

 

<-----

 

</td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td align="right" class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>

</tr>

<?php

if ($any_out_of_stock == 1) {

if (STOCK_ALLOW_CHECKOUT == 'true') {

?>

 

----->

 

I'm not sure where to put the code from the "addon_shopping_cart" folder.

 

I think I'm using a version before 2.2. I'm not sure which one. If there's a variable like $os_version I could include to see which one I'm running, I could check.

 

I tried downloading 2.2 to see if I could install Easy Discount on it, but had the same problem.

Link to comment
Share on other sites

i think everything is ok so far but i get thi serror

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

Shopping Cart

1146 - Table 'desertva_catalog.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '16'

 

[TEP STOP]

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

 

Do you know what went wrong here? the module still doesnt appear to be installed in the admin area.If you can help I would appreciate it

thanks

jaime garanado

http://www.desertvalleysteam.com

Link to comment
Share on other sites

i think everything is ok so far but i get thi serror

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

Shopping Cart

1146 - Table 'desertva_catalog.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '16'

 

[TEP STOP]

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

 

Do you know what went wrong here? the module still doesnt appear to be installed in the admin area.If you can help I would appreciate it

thanks

jaime garanado

http://www.desertvalleysteam.com

 

Guess you installed a different contribution.

Treasurer MFC

Link to comment
Share on other sites

Having some troubles w/ the contribution... for some reason the subtotal is modified, but taxes are still being calculated with the old subtotal. Any way to fix this?

 

My current sort order is this: Subtotal/Discounts/Shipping/Tax/Rounding/Total

Link to comment
Share on other sites

Having some troubles w/ the contribution... for some reason the subtotal is modified, but taxes are still being calculated with the old subtotal. Any way to fix this?

 

My current sort order is this: Subtotal/Discounts/Shipping/Tax/Rounding/Total

 

It has been addressed in this very thread but once again:

 

in the order total module of easy discount:

 

after :

 

$this->deduction = $od_amount;

 

you add this:

 

// tax adjustment calculation to include discount

if ($order->info['tax'] > 0) {

// discount percentage as in discount divided by subtotal

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

// current tax * discount percentage

$tod_amount = $order->info['tax']*$discount_percentage;

// substract from current tax value

$order->info['tax'] = $order->info['tax'] - $tod_amount;

reset($order->info['tax_groups']);

while (list($key, $value) = each($order->info['tax_groups'])) {

// current tax group value * discount percentage

$god_amount = $value*$discount_percentage;

// substract from current tax group value

$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;

}

}

// end tax calc

 

this spaghetti is necessary as osc calculates tax on individual products and not the order totals.

Treasurer MFC

Link to comment
Share on other sites

  • 2 weeks later...

I have done all the instruction given by amanda and when i tried to buy an item, it appears this error.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/alvinluo/public_html/e-store/osc/shopping_cart.php:2) in /home/alvinluo/public_html/e-store/osc/includes/functions/general.php on line 1174

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/alvinluo/public_html/e-store/osc/shopping_cart.php:2) in /home/alvinluo/public_html/e-store/osc/includes/functions/sessions.php on line 67

 

Here is the source code for my shopping_cart.php

 

<?php
/*
 $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require("includes/application_top.php");

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOPPING_CART);


 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_SHOPPING_CART));
include_once (DIR_WS_FUNCTIONS.'easy_discount.php');

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--
function session_win2() {
 window.open("<?php echo tep_href_link(FILENAME_INFO_COUPON); ?>","info_coupon"," height=360,width=700,toolbar=no,statusbar=no,scrollbars=yes").focus();
}
function autotab(original,destination){if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))destination.focus()}
//--></script>


</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width=437 cellspacing="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	  </tr>

	</table></td>
  </tr>
  <tr>
	<td class=ch7><?php echo tep_draw_separator('pixel_trans.gif', '437', '3'); ?></td>
  </tr>
<?php
 if ($cart->count_contents() > 0) {
?>
  <tr>
	<td class=ch7 align=right>
<?php
$info_box_contents = array();
$info_box_contents[0][] = array('align' => 'center',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_REMOVE);

$info_box_contents[0][] = array('params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_PRODUCTS);

$info_box_contents[0][] = array('align' => 'center',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_QUANTITY);

$info_box_contents[0][] = array('align' => 'right',
								'params' => 'class="productListing-heading"',
								'text' => TABLE_HEADING_TOTAL);

$any_out_of_stock = 0;
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// Push all attributes information in an array
  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
								  from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
								  where pa.products_id = '" . $products[$i]['id'] . "'
								   and pa.options_id = '" . $option . "'
								   and pa.options_id = popt.products_options_id
								   and pa.options_values_id = '" . $value . "'
								   and pa.options_values_id = poval.products_options_values_id
								   and popt.language_id = '" . $languages_id . "'
								   and poval.language_id = '" . $languages_id . "'");
	  $attributes_values = tep_db_fetch_array($attributes);

	  $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
	  $products[$i][$option]['options_values_id'] = $value;
	  $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name'];
	  $products[$i][$option]['options_values_price'] = $attributes_values['options_values_price'];
	  $products[$i][$option]['price_prefix'] = $attributes_values['price_prefix'];
	}
  }
}

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (($i/2) == floor($i/2)) {
	$info_box_contents[] = array('params' => 'class="productListing-even"');
  } else {
	$info_box_contents[] = array('params' => 'class="productListing-odd"');
  }

  $cur_row = sizeof($info_box_contents) - 1;

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id']));

  $products_name = '<table border="0" cellspacing="0" cellpadding="0" width=230>' .
				   '  <tr>' .
				   '	<td class="ZZZproductListing-data" style="padding-left:15px;padding-right:12px"  align="left" ><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' .
				   '	<td class="ZZZproductListing-data" valign="top"><a style="color:#484E53; font-size:11px" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a><div style="color:#484E53; font-size:11px">'.preg_replace('/\s\S*$/i', '', substr($products[$i]['description'], 0, 50)).'</div>';

  if (STOCK_CHECK == 'true') {
	$stock_check = tep_check_stock($products[$i]['id'], $products[$i]['quantity']);
	if (tep_not_null($stock_check)) {
	  $any_out_of_stock = 1;

	  $products_name .= $stock_check;
	}
  }

  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
	reset($products[$i]['attributes']);
	while (list($option, $value) = each($products[$i]['attributes'])) {
	  $products_name .= '<br><small><i> - ' . $products[$i][$option]['products_options_name'] . ' ' . $products[$i][$option]['products_options_values_name'] . '</i></small>';
	}
  }


	if ($cart->count_contents() > 4) {
$easy_discount->add('CART','Order Quantity Discount',50);
} else {
$easy_discount->remove('CART');
}



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



  $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"',
										 'text' => $products_name);

  $info_box_contents[$cur_row][] = array('align' => 'center',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="2"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']));

  $info_box_contents[$cur_row][] = array('align' => 'right',
										 'params' => 'class="productListing-data" valign="top"',
										 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>');
}

new productListingBox($info_box_contents);
?>
	</td>
  </tr>
  <tr>
	<td class=ch7 style="background: #E2F3C7;" ><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class=ch7  align="right" style="color:#484E53; background: #E2F3C7;  font-size:11px; padding-right:5px"  class="main"><b><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?></b></td>
  </tr>
<?php
if ($easy_discount->count() > 0) {
 echo easy_discount_display();
 echo '<tr><td align="right">'.SUB_TITLE_TOTAL.'</td><td align="right">'.$currencies->format(($cart->show_total() - $easy_discount->total())).'</td></tr>';
} 
?>

<?php
if ($any_out_of_stock == 1) {
  if (STOCK_ALLOW_CHECKOUT == 'true') {
?>
  <tr>
	<td class=ch7 style="background: #E2F3C7;"   class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></td>
  </tr>
<?php
  } else {
?>
  <tr>
	<td class=ch7 style="background: #E2F3C7;"   class="stockWarning" align="center"><br><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></td>
  </tr>
<?php
  }
}
?>
  <tr>
	<td class=ch7 style="background: #E2F3C7;" ><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class=ch7 style="background: #E2F3C7;" ><table border="0" width=437 cellspacing="0" cellpadding="0" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td align=right style="text-align:right; padding-top:5px; background: #E2F3C7;;  padding-right:5px;  padding-bottom:5px;">
			<?php echo tep_image_submit('button_update_cart.gif', IMAGE_BUTTON_UPDATE_CART); ?>
<?php
$back = sizeof($navigation->path)-2;
if (isset($navigation->path[$back])) {
?>
			<?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?>
<?php
}
?>
			<?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?>
			</td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr><td><img src=images/m30.gif width=438 height=7></td></tr>
<?php
 } else {
?>
  <tr>
	<td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>

<?php
 }
?><?php include (DIR_WS_MODULES.'easy_coupons_box.php'); ?>
</table></form></td>

<!-- body_text_eof //-->
 </tr>
</table>

<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by Alvinluo
Link to comment
Share on other sites

  • 1 month later...

I have installed the Easy Discount contrib following the instructions but didn't succeed.

Got these errors:

Warning: main(includes/functions/easy_discount.php): failed to open stream: No such file or directory in /home/site/public_html/shop/shopping_cart.php on line 14

 

Warning: main(includes/functions/easy_discount.php): failed to open stream: No such file or directory in /home/site/public_html/shop/shopping_cart.php on line 14

 

Warning: main(): Failed opening 'includes/functions/easy_discount.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/shop/shopping_cart.php on line 14

 

 

I just want to add a 5% off the total price to all the products. Isn't there an easy way?

Thanks for the help!

Link to comment
Share on other sites

I have installed the Easy Discount contrib following the instructions but didn't succeed.

Got these errors:

Warning: main(includes/functions/easy_discount.php): failed to open stream: No such file or directory in /home/site/public_html/shop/shopping_cart.php on line 14

 

Warning: main(includes/functions/easy_discount.php): failed to open stream: No such file or directory in /home/site/public_html/shop/shopping_cart.php on line 14

 

Warning: main(): Failed opening 'includes/functions/easy_discount.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/site/public_html/shop/shopping_cart.php on line 14

I just want to add a 5% off the total price to all the products. Isn't there an easy way?

Thanks for the help!

 

just add the function easy_discount.php to your includes/functions directory.

It contains just a simple function to display the discounts

Treasurer MFC

Link to comment
Share on other sites

Hi Amanda, I read through all of the post in hopes of finding an answer to my question. But no luck, so I will have to ask.

 

What I am looking for is to add price optons on certain product info pages. I have some items that I could sell by one item, but prefer to sell by multiples. Something like this -

 

Example:

1 for $1.39

6 for $8.00

12 for $15.00

 

But would like to see the discounted price and quantity in the shopping cart.

 

I have already tried Discount Plus and that turned out to be a nightmare.

Would Easy Discount serve my needs? If so, is there directions as to what codes should be placed where?

 

Thank you for any help you can provide,

Jim

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Anyone having issues with this contrib and Paypal Website Payments Pro not displaying the discount?

 

Please help!

 

Easy discount works like any other discount order total module in that it affects the order total and/or subtotal of the order object.

Treasurer MFC

Link to comment
Share on other sites

Easy discount works like any other discount order total module in that it affects the order total and/or subtotal of the order object.

 

I can't tell if it is "easy coupon" or "easy discount" but since one is required for the other, I assume they are related.

 

The discount appears during checkout but isn't carried over when using Paypal Website Payments Pro.

 

Any ideas on how to correct it?

 

Thanks,

Mark

Link to comment
Share on other sites

In trying to use "Easy Coupon" & "Easy Discount" contributions with Paypal Website Payments Pro, the coupon discount shows during the checkout but doesn't get carried over to the Paypal total.

 

I have searched and searched and found this as a possible solution but not sure how to troubleshoot it.

 

Change checkout_process.php. The before_process of the payment modules was being called before calling the order totals modules. I don't think this should cause any side effects, but if anyone else sees a problem with this, feel free to chime in.

 

In checkout_process.php, change:

CODE

// load the before_process function from the payment modules

$payment_modules->before_process();

 

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

to:

CODE

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

 

$order_totals = $order_total_modules->process();

 

// load the before_process function from the payment modules

$payment_modules->before_process();

 

The only problem is that when I checkout using a credit card, I get an error:

 

"(10520) The transaction was refused because the amount totals of the order do not match. Review the amounts of the transaction and resubmit."

 

Any ideas on how to correct this?

 

Thanks again

~Mark

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...