Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Discount


boxtel

Recommended Posts

well, with regard to first time customer:

 

1) yes, if you have PWA then you need to take the PWA component into account so simply set the $first_time_customer variable to "False" if a pwa customer signs in. That is done in a separate file anyway.

 

2) after a customer completes an order you need to set the $first_time_customer variable to false (or "False") in checkout_process.php, right where

 

$cart->reset();

$easy_discount->reset();

 

are located.

 

This because now they are no longer a first time customer ofcourse.

 

so $first_time_customer = 'False';

 

or $first_time_customer = false;

3) with regard to CCGV, I do not know that contribution so I have no idea how, when and where it determines and holds it's discounts.

if you know that, then you can combine it with easy discount.

 

and yes, if someone creates a real account just before checkout then he is by definition a first time customer so no need to check in the database but simply set the $first_time_customer variable to "True".

Treasurer MFC

Link to comment
Share on other sites

Thanks Amanda for all your help.

 

So I changed checkout_process.php from:

 

$cart->reset(true);

 

to

 

$cart->reset(true);
 $easy_discount->reset();
 $first_time_customer = 'False';

 

I'm a bit confused by the other two things (PWA and the customer checking out right after they make their account).... to me, and maybe my logic is wrong, but is it not a problem that the customer might not go back to the shopping_cart.php page and thus the discount will never be applied?

 

If that is not a problem, then would the only thing I need to do is put code on

 

Order_Info.php <--- 1st page customers that chose to use PWA.

create_account.php <---- the page where new customers (who are not using PWA) will start.

 

If that is the case, would it be the same code I used on the login.php page? Sorry for all the questions, I hope they can help people in the future.

 

Thanks again!

 

Nate

Link to comment
Share on other sites

Thanks Amanda for all your help.

 

So I changed checkout_process.php from:

 

$cart->reset(true);

 

to

 

$cart->reset(true);
 $easy_discount->reset();
 $first_time_customer = 'False';

 

I'm a bit confused by the other two things (PWA and the customer checking out right after they make their account).... to me, and maybe my logic is wrong, but is it not a problem that the customer might not go back to the shopping_cart.php page and thus the discount will never be applied?

 

If that is not a problem, then would the only thing I need to do is put code on

 

Order_Info.php <--- 1st page customers that chose to use PWA.

create_account.php <---- the page where new customers (who are not using PWA) will start.

 

If that is the case, would it be the same code I used on the login.php page? Sorry for all the questions, I hope they can help people in the future.

 

Thanks again!

 

Nate

 

yes, if you have the option that a customer can bypass shopping_cart.php then the code would not be executed. So in that case more the discount code either to application_top or checkout_shipping.

Treasurer MFC

Link to comment
Share on other sites

For everyone that wants to use easy discount and CCGV side by side

 

My goal was to give all my first time customers a 10% off discount (see my above posts and boxtel on this page) ... but at the same time I wanted to use the CCGV coupon features... but at no time did I want a customer to get 10% off an use a CCGV coupon.

 

Here is what you must do:

 

1. Open and BACKUP ot_coupon.php

2. Find

 

function process() {
global $PHP_SELF, $order, $currencies;

 

replace it with:

 

function process() {
global $PHP_SELF, $order, $currencies, $easy_discount; // add global easy discount

 

a couple of lines down find:

 

		$tod_amount = 0.0; //Fred
	$this->deduction = $od_amount;
	if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!		
	$tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);

	}

 

replace this with:

 

		$tod_amount = 0.0; //Fred
	$this->deduction = $od_amount;
	if ($this->calculate_tax != 'None') { //Fred - changed from 'none' to 'None'!
$easy_discount->reset(); //reset ALL easy discount savings 
	$tod_amount = $this->calculate_tax_deduction($order_total, $this->deduction, $this->calculate_tax);

	}

 

finally, right under this should be:

 

		if ($od_amount > 0) {
			$order->info['total'] = $order->info['total'] - $od_amount;
			$this->output[] = array('title' => $this->title . ':' . $this->coupon_code .':','text' => '<b>-' . $currencies->format($od_amount) . '</b>', 'value' => $od_amount); //Fred added hyphen

	}

}

 

relace this with

 

	   if ($od_amount > 0) {
	$easy_discount->reset(); //reset ALL easy discount savings 
			$order->info['total'] = $order->info['total'] - $od_amount;
			$this->output[] = array('title' => $this->title . ':' . $this->coupon_code .':','text' => '<b>-' . $currencies->format($od_amount) . '</b>', 'value' => $od_amount); //Fred added hyphen

	}

}

 

3. Save and upload the file....

4. Test it.

 

 

 

From my testing, which at this point is very limited, seems to make me want to say this works... but I'm still testing. If anyone has problems/ suggestions please post/ message me about them.

 

Also, keep in mind that if you don't want to clear ALL your easy discount when a coupon is used, then you can find and replace both instances of this code (see below) in the above listed edits:

 

$easy_discount->reset(); //reset ALL easy discount savings

with:

$easy_discount->clear('discount name'); //clear specific easy discount

just make sure you replace the 'discount name' with the actual name of the discount.

 

Good Luck! and thanks again to Boxtel/ Amanda for such a great contribution!

Link to comment
Share on other sites

yes, if you have the option that a customer can bypass shopping_cart.php then the code would not be executed. So in that case more the discount code either to application_top or checkout_shipping.

 

Amanda,

 

Thanks for the idea. I think it would work best for me if it was in the checkout_shipping.php file, but i'm a bit lost on where to put this.

 

Can I put both the code I have in the login.php file (which checks to see if a customer is a 'new customer' who has not ordered) and the shopping_cart.php (which applies the easy discount) all in the checkout_shipping.php? If so, where about?

 

Thanks,

 

Nate

 

PS: Let me know what you think about the post I made about using CCGV and Easy Discount...

Link to comment
Share on other sites

Amanda,

 

Thanks for the idea. I think it would work best for me if it was in the checkout_shipping.php file, but i'm a bit lost on where to put this.

 

Can I put both the code I have in the login.php file (which checks to see if a customer is a 'new customer' who has not ordered) and the shopping_cart.php (which applies the easy discount) all in the checkout_shipping.php? If so, where about?

 

Thanks,

 

Nate

 

PS: Let me know what you think about the post I made about using CCGV and Easy Discount...

 

the code which determines if a customer is a first timer you need to put into login.php as that is the appropriate place.

 

so in login.php you put the code with the order query and set the variable to either "True" or "False".

 

in create_account you simple set the variable to "true" as a new account is always a first time customer.

 

in order_info_process.php for PWA's you set that variable to "False" unless you want those customers to be first timers also.

 

where to put the code for the discounts depends on what the conditions are and how the discount is determined.

 

if you want to give $5 discount to all first time registered customers regardless of cart quantities or totals, then you can do that anywhere, even in login.php after you determined the first time customer and create account. This because that condition does not change (until the order is made) and neither does the discount.

 

but if you want to do something like this:

 

$easy_discount->set('WEB','First Time Web Customer:',$cart->show_total()*0.1); // 10% of cart total

 

then the discount depends on the cart contents and that means that this code needs to be executed every time that contants changes or at a point where it can no longer change.

The farther back you go in checkout, the more stable the cart contents becomes but the less opportunity you have to easily display the discounts to the user.

 

So normally I would put this code in shopping_cart.php so that it displays the discount with every update of the cart. But in my case everyone goes to the cart before checkout so I know that this code IS executed whenever the cart changes.

 

second option would be to put this code in application_top.php which is ofcourse always executed.

 

3rd option is to put it in checkout_shipping in the top after application_top is included. but this means that while the updates his cart with new products, you cannot show the accurate discount messages because those are not updated until you hit checkout_shipping.

 

So in your case where users can bypass the cart to go directly to checkout, I would put it in the bottom of application_top.php.

It is peanut code which does not access the database anyway so performance-wise, no problem.

 

 

with regard to CCGV, I see you erase the easy discounts if users have used a CCGV.

That may work ok but I assume that that determination is made at checkout and as such the easy discounts remain set until that moment. Does it therefore not produce easy discount messages that are later removed?

Treasurer MFC

Link to comment
Share on other sites

Amanda,

 

Thanks for all your suggestions... I must say that it is nice that easy discounts is so flexible/customizable; it just sometimes is hard for a newbie like me. :blush:

 

If I leave it how it is now, in both the login.php and the shopping_cart.php I think it will fine for customers who don't create an account and then go directly to checkout... so in other words if they create an account... come back, login and then add stuff to their cart all will be fine.

 

I figure (well I think......) if I just added this line to create_account.php and Order_Info.php (which takes care of PWA orders):

 

$easy_discount->set('WEB','First Time Web Customer',*0.1);

 

Is this all that I will need to add to those pages? or must I do somthing like this again?

 

 require("includes/application_top.php");
// BOE Easy Discount by Boxtel
include (DIR_WS_FUNCTIONS.'easy_discount.php');
// EOE Easy Discount by Boxtel

 

Also, where should I put the code that sets $easy_discount ? Will somthing like this do?

 

From (in both create_account.php/Order_Info.php):

if (ACCOUNT_GENDER == 'true') {

  if (isset($HTTP_POST_VARS['gender'])) {

	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

  } else {

	$gender = false;

  }

}

to:

$easy_discount->set('WEB','First Time Web Customer',*0.1);

if (ACCOUNT_GENDER == 'true') {

  if (isset($HTTP_POST_VARS['gender'])) {

	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

  } else {

	$gender = false;

  }

}

 

Thanks for all the help! :D

 

Nate

Link to comment
Share on other sites

Amanda,

 

Thanks for all your suggestions... I must say that it is nice that easy discounts is so flexible/customizable; it just sometimes is hard for a newbie like me. :blush:

 

If I leave it how it is now, in both the login.php and the shopping_cart.php I think it will fine for customers who don't create an account and then go directly to checkout... so in other words if they create an account... come back, login and then add stuff to their cart all will be fine.

 

I figure (well I think......) if I just added this line to create_account.php and Order_Info.php (which takes care of PWA orders):

 

$easy_discount->set('WEB','First Time Web Customer',*0.1);

 

Is this all that I will need to add to those pages? or must I do somthing like this again?

 

 require("includes/application_top.php");
// BOE Easy Discount by Boxtel
include (DIR_WS_FUNCTIONS.'easy_discount.php');
// EOE Easy Discount by Boxtel

 

Also, where should I put the code that sets $easy_discount ? Will somthing like this do?

 

From (in both create_account.php/Order_Info.php):

if (ACCOUNT_GENDER == 'true') {

  if (isset($HTTP_POST_VARS['gender'])) {

	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

  } else {

	$gender = false;

  }

}

to:

$easy_discount->set('WEB','First Time Web Customer',*0.1);

if (ACCOUNT_GENDER == 'true') {

  if (isset($HTTP_POST_VARS['gender'])) {

	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

  } else {

	$gender = false;

  }

}

 

Thanks for all the help! :D

 

Nate

 

1)

 

yes, if you want pwa customers to also get the first timer discount then you add the code to order_info_process as well.

 

But again, put it in create_account and order_info_process only if the discount itself is not dependant on a dynamic entity like cart quantity or cart amount as those pages are not revisited while the cart contents can change many times over before checkout and so should the discount if it depends on it.

 

so $easy_discount->set('WEB','First Time Web Customer',5);

is fine in there but $easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);

is not so fine.

 

the second line can better be put in the bottom of application_top like :

 

if (($first_time_customer == 'True') and ($cart->count_contents() > 0)) {

$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);

}

 

that will make sure that the discount is updated correctly as the cart contents changes.

 

By the way, this line:

 

$easy_discount->set('WEB','First Time Web Customer',*0.1);

 

does not work as *0.1 is not a right amount.

 

2)

The function include is only needed on pages where you want to display the easy discounts.

it only contains the display function.

 

3)

in create account I would put it just before :

 

$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

 

there you are sure that the new account is created.

 

in order_info_process just before :

 

tep_session_register('noaccount');

 

as there you know the signin is ok for pwa.

Treasurer MFC

Link to comment
Share on other sites

Amanda,

 

So here is what I should do... (I just want to double check w/ you).

 

1. Leave my login.php how it is.

2.Take out the code in my shopping_cart.php and then in my application_top.php at the very bottom before ?> add:

 

if (($first_time_customer == 'True') and ($cart->count_contents() > 0)) {
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
}

 

3. Then in my create_account.php make it look like this:

 

 if (ACCOUNT_GENDER == 'true') {

	 if ($gender == 'm') {
	   $email_text = sprintf(EMAIL_GREET_MR, $lastname);
	 } else {
	   $email_text = sprintf(EMAIL_GREET_MS, $lastname);
	 }
  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }
// BOF EASY DISCOUNT
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
// EOF EASY DISCOUNT
  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

 

4. Then in my create_account.php make it look like this:

 

// restore cart contents
$cart->restore_contents();
// BOF EASY DISCOUNT
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
// EOF EASY DISCOUNT
tep_session_register('noaccount');

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 }

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

That look right? Thanks again!

 

Nate

Link to comment
Share on other sites

Amanda,

 

So here is what I should do... (I just want to double check w/ you).

 

1. Leave my login.php how it is.

2.Take out the code in my shopping_cart.php and then in my application_top.php at the very bottom before ?> add:

 

if (($first_time_customer == 'True') and ($cart->count_contents() > 0)) {
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
}

 

3. Then in my create_account.php make it look like this:

 

 if (ACCOUNT_GENDER == 'true') {

	 if ($gender == 'm') {
	   $email_text = sprintf(EMAIL_GREET_MR, $lastname);
	 } else {
	   $email_text = sprintf(EMAIL_GREET_MS, $lastname);
	 }
  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }
// BOF EASY DISCOUNT
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
// EOF EASY DISCOUNT
  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

 

4. Then in my create_account.php make it look like this:

 

// restore cart contents
$cart->restore_contents();
// BOF EASY DISCOUNT
$easy_discount->set('WEB','First Time Web Customer',$cart->show_total()*0.1);
// EOF EASY DISCOUNT
tep_session_register('noaccount');

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 }

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

That look right? Thanks again!

 

Nate

 

well, since you already have the discount setting in application_top you need not put that anywhere else as it is executed at all times.

 

what you need to put in create account and order_info_process is :

 

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

$first_time_customer = 'True';

 

 

and in login.php the first time customer check with the order query as before.

 

 

so when someone creates an account or provides his pwa info or signs in with no previous orders, they are considered first time customers.

 

then on every page load the check is made whether it is a first time customer and if the cart has contents the discount is updated based on the total value of the cart at all times.

Treasurer MFC

Link to comment
Share on other sites

To give a discount right after login for specific customers, add the discount right after a successful signin.

 

To give multiple discounts based on multiple coupon codes you add those to the case statement, but, currently this case statement if covered with the condition that the cart has to hold products.

 

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

if ((isset($_POST['coupon_code'])) and ($_POST['coupon_code'] != '')) {

switch (strtolower($_POST['coupon_code'])) {

case 'abcde' : $new_discount = $cart->show_total() * 0.1;

$easy_discount->set('COUPON1','10% Coupon Discount', $new_discount);

break;

case 'fghij' : $new_discount = $cart->show_total() * 0.12;

$easy_discount->set('COUPON2','12% Coupon Discount', $new_discount);

break;

case 'klmni' : $new_discount = $cart->show_total() * 0.50;

$easy_discount->set('COUPON3','50% Coupon Discount', $new_discount);

break;

}

}

} else {

$easy_discount->reset();

}

 

so if it does not, the case is not executed.

 

This is mainly when giving discounts based on cart contents like percentages of totals or quantity of products.

To just give a fixed discount regardless of cart contents you do not need/want that condition.

 

something like :

 

if ((isset($_POST['coupon_code'])) and ($_POST['coupon_code'] != '')) { // use entered something

switch (strtolower($_POST['coupon_code'])) { // do the validation in lowercase

case 'abcde' : if ($cart->count_contents() > 0) { // products in the cart

$new_discount = $cart->show_total() * 0.1; // 10% of cart total

$easy_discount->set('COUPON1','10% Coupon Discount', $new_discount);

}

break;

case 'klmni' : if ($cart->count_contents() > 0) {

$new_discount = $cart->show_total() * 0.50;

$easy_discount->set('COUPON2','50% Coupon Discount', $new_discount);

}

break;

case '5dollar' : $new_discount = 5;

$easy_discount->set('COUPON3','$5 off', $new_discount);

break;

}

}

 

This would enable the customer to add all 3 discounts if they enter all 3 coupon codes, the first 2 only if the cart has products.

 

If you want 3 coupon codes but only 1 discount (they overwrite eachother) then give those discounts the same name like COUPON.

 

PS. note the lowercase for '5dollar' as the coupon code is compared to the lowercase via the conversion :

strtolower so it does not matter if users enter 5Dollar or 5DOLLAR or .... but it means that you need to do the compare with lowercase.

 

PS2. the discount that you add is the actual discount, not the result. Easy discount will discount that amount from your totals in the end.

 

So if you wish to give 5$ discount, you state:

 

$easy_discount->set('COUPON3','$5 off', 5);

 

not

 

$easy_discount->set('COUPON3','$5 off', $cart->show_total() -5.00);

thank you very much for the thorough explanation!

i was able to achieve a dollar discount (like $5.00) after login, but i cannot get it to work with percents.

 

this is what i have for dollar discounts:

<?php
if ($customer_id == '1097') { // gives dollar discount once logged in
$easy_discount->set('COUPON3','$6 off', 6);
?>
<?php
}
?>

 

 

this is what i tried for a % off:

<?php
if ($customer_id == '1097') { // gives dollar discount once logged in
$easy_discount->set('COUPON1','10% Coupon Discount', * 0.1);
?>
<?php
}
?>

Link to comment
Share on other sites

thank you very much for the thorough explanation!

i was able to achieve a dollar discount (like $5.00) after login, but i cannot get it to work with percents.

 

this is what i have for dollar discounts:

<?php
if ($customer_id == '1097') { // gives dollar discount once logged in
$easy_discount->set('COUPON3','$6 off', 6);
?>
<?php
}
?>

this is what i tried for a % off:

<?php
if ($customer_id == '1097') { // gives dollar discount once logged in
$easy_discount->set('COUPON1','10% Coupon Discount', * 0.1);
?>
<?php
}
?>

 

well, you have to tell it 10% of what, *0.1 will not produce a value.

 

like 10% of the total value of the cart at that time:

 

<?php

if ($customer_id == '1097') $easy_discount->set('COUPON1','10% Coupon Discount', $cart->show_total() * 0.1);

?>

Treasurer MFC

Link to comment
Share on other sites

thank you, that worked! :)

 

is it possible to give the customer some kind of notification that their code was received?

 

for instance: right now, when i enter my code.. the page just reloads

Edited by eww
Link to comment
Share on other sites

thank you, that worked! :)

 

is it possible to give the customer some kind of notification that their code was received?

 

for instance: right now, when i enter my code.. the page just reloads

 

use the message stack.

for the login page :

 

$messageStack->add('login', TEXT_LOGIN_ERROR);

 

 

like :

 

 

<?php

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Coupon Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $cart->show_total() * 0.1 . ' discount');

}

?>

Treasurer MFC

Link to comment
Share on other sites

use the message stack.

for the login page :

 

$messageStack->add('login', TEXT_LOGIN_ERROR);

like :

<?php

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Coupon Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $cart->show_total() * 0.1 . ' discount');

}

?>

 

 

better make that :

 

<?php

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Coupon Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

?>

Treasurer MFC

Link to comment
Share on other sites

do i have to add $messageStack->add('login', TEXT_LOGIN_ERROR); to the top of account.php?

 

i keep getting the error:

Parse error: parse error, unexpected '}'

 

 

and on the line is:

}

 

from

if ($customer_id == '1097') $easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

Link to comment
Share on other sites

do i have to add $messageStack->add('login', TEXT_LOGIN_ERROR); to the top of account.php?

 

i keep getting the error:

Parse error: parse error, unexpected '}'

and on the line is:

}

 

from

if ($customer_id == '1097') $easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

 

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

Treasurer MFC

Link to comment
Share on other sites

do i have to add $messageStack->add('login', TEXT_LOGIN_ERROR); to the top of account.php?

 

i keep getting the error:

Parse error: parse error, unexpected '}'

and on the line is:

}

 

from

if ($customer_id == '1097') $easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

 

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

Treasurer MFC

Link to comment
Share on other sites

if ($customer_id == '1097') {

$easy_discount->set('COUPON1','10% Discount', $cart->show_total() * 0.1);

$messageStack->add('login', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

that got rid of the error, but the text "You just received.." doesn't show up anywhere, do i have to create a separate messagestack for it?

Link to comment
Share on other sites

  • 2 weeks later...

amanda, for some reason the discount code:

<?php

if ($customer_id == '862') { $easy_discount->set('COUPON90','10% Discount', $cart->show_total() * 0.1);

//$messageStack->add('account', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

 

?>

(to give an individual member a discount) isn't working, it's showing up on the checkout page as:

10% Discount -$0.00

 

any suggestions as to what i should check?

Link to comment
Share on other sites

amanda, for some reason the discount code:

<?php

if ($customer_id == '862') { $easy_discount->set('COUPON90','10% Discount', $cart->show_total() * 0.1);

//$messageStack->add('account', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

 

?>

(to give an individual member a discount) isn't working, it's showing up on the checkout page as:

10% Discount -$0.00

 

any suggestions as to what i should check?

 

then it must have been issued while nothing was in the cart.

 

so always use:

 

<?php

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

if ($customer_id == '862') { $easy_discount->set('COUPON90','10% Discount', $cart->show_total() * 0.1);

//$messageStack->add('account', 'You just received ' . $currencies->format($cart->show_total() * 0.1) . ' discount');

}

}

?>

 

if the amount is dependant on the contents of the cart.

Treasurer MFC

Link to comment
Share on other sites

I've been reading up on the posts and I just want to clarify:

 

I want customers (new and old) to be able to enter a special code when they order to get a discount on their order (promotional code). The discount would be valid for maybe 30 days. Does the current version (2/10/2006) have this code already in the files?

Edited by aheisey
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...