Jump to content
Sign in to follow this  
boxtel

Easy Coupons

Recommended Posts

I managed to make the coupon to be processed, there was a problem with STS...

 

Now, the coupon is applied but only if it's a percentage type (amount ones dont work) and in the View Cart page appears the following:

KECROCDDUIRAMERE Coupon Discount (10%): - $0,00

 

This means the coupon is retrieved but the discount isn't applied. Why may this happen?

Share this post


Link to post
Share on other sites

Hi Amanda,

 

Been using your contribution for a while and it's great!

 

I am using only manually created coupons, and I have 3 coupons that I am using for wholesale customers.

 

- 35% discount when you order between $400.00 & $799.00

- 40% discount when you order between $800.00 & $999.00

- 50% discount when you order $1.000 or more

 

However, as it is now, even if people buy a product for $50 and enter any of the codes, they will still get the discount. Is it possible to apply some sort of check so that people only can use these 3 specific codes if their orders matches the value above?

 

Regards.

Share this post


Link to post
Share on other sites

I tried putting this into includes\modules\easy_coupons_code.php after // valid and available coupon code found:

 

if (($inputcouponcode = '12330') && ($cart_total >= 400) && ($cart_total < 800)) {

$couponcode = array('code' => $coupon['code'], 'discount' => $coupon['discount'], 'type' => $coupon['type']);

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

// give message

$messageStack->add_session('cart',EC_PROCESSED,'success');

} else {

// give message

$messageStack->add_session('cart',EC_UNKNOWN,'error');

}

if (($inputcouponcode = '12340') && ($cart_total >= 800) && ($cart_total < 1000)) {

$couponcode = array('code' => $coupon['code'], 'discount' => $coupon['discount'], 'type' => $coupon['type']);

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

// give message

$messageStack->add_session('cart',EC_PROCESSED,'success');

} else {

// give message

$messageStack->add_session('cart',EC_UNKNOWN,'error');

}

if (($inputcouponcode = '12350') && ($cart_total >= 1000)) {

$couponcode = array('code' => $coupon['code'], 'discount' => $coupon['discount'], 'type' => $coupon['type']);

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

// give message

$messageStack->add_session('cart',EC_PROCESSED,'success');

} else {

// give message

$messageStack->add_session('cart',EC_UNKNOWN,'error');

}

 

But it does not seem to work? What am I doing wrong?

Edited by JangoF

Share this post


Link to post
Share on other sites
Hello Amanda,

 

I Installed easy coupons and it works like a charm :thumbsup:

 

However I wonder if you could help me with configure this thing? I`m using automatic coupon and this is what I want it to do :

 

1. Create a coupon ONLY if total order value is over 50 Euro.

 

2. The coupon discount should be 5% and to redeem your next order value must be 50 Euro or more.

 

How should this be done?

 

Thanks in advance!

I, too, am lost on this. I don't care about the Euro part because I'm in the USA, but if anyone can answer Mrwerzel's question, I can sure use the answer about making the coupon discount 5%! I have looked at the table in the admin, but I don't know what those numbers mean: 1000; 2; 10000; 5; etc. Does that mean that if the person has 2 items in their cart they get a 1000% discount? :'( of course not... so what does it mean and how do I configure it to what I need?


Tammy Kelly

Share this post


Link to post
Share on other sites

Hello

Im trying to install this contribution

I´ve been following install.txt but now I am stuck on: :blink:

 

5)invoice.php

 

add:

<?php

// extract configuration detail

$config = split(';',EASY_COUPONS);

$ec_invoice = $config[3];

if ($ec_invoice) {

$coupon_query = tep_db_query("select code from coupons where orders_id_issued = ".$HTTP_GET_VARS['oID']);

$coupon = tep_db_fetch_array($coupon_query);

if ($coupon['code']) {

echo '<br><CENTER><span style="font-size:12px">Your Coupon Code : <b>'.$coupon['code'].'</b></span></CENTER>';

echo '<CENTER><span style="font-size:10px">(Use this code during your next purchase to receive a nice discount)</span></CENTER>';

}

}

?>

 

The problem is that I don’t know where to put this code :'(

I can’t advance any further because on this. I read the install.txt file until the end and I noticed there are not are guides on where to past the code.

 

Seems so many of you have successfully installed this contribution can you please tell me where I must past the code on each file. On the Admin side and on Store side.

 

Thanks. :thumbsup:

Share this post


Link to post
Share on other sites

I've got a headache.

 

I've been doing some extensive mods on a site, culminating in having now just installed Easy Discount and Easy Coupons. I kind of have them working on my dev. server but am having some issues with both of them. The Easy Discount ones can wait for the other thread for now, as the issues are mainly down to me working out the coding for issuing discounts based on attributes.

 

The most pressing problem is with Easy Coupons and I seem to be going round in circles, in as much as, the code is being input (it's appearing in the array):

<pre>Array
  (
   [osCsid] => a3bd84cc2baedb3a633b744f19e49f27
   [coupon_code1] => TROMUCHASW
   [x] => 23
   [y] => 12
  )</pre>

 

but it's not appearing on the shopping_cart or checkout_confirmation pages and it's not being applied (I suspect it may be one issue, as opposed to 2 seperate issues).

 

The other discounts are showing and being applied just fine, so I'm sure it must be something to do with the Easy Coupon Box (which I've been very careful not to enclose within another <form></form> :rolleyes: by putting it right at the bottom of the page in it's own table.

	   </table></form>
		 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><?php include (DIR_WS_MODULES.'easy_coupons_box.php'); ?></tr></table>  
   </td>  
  <!-- body_text_eof //-->  
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">  
  <!-- right_navigation //-->  
  <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>  
  <!-- right_navigation_eof //-->  
   </table></td>  
 </tr>  
  </table>  
  <!-- body_eof //-->

 

The Coupon code is in the variable array above and, as you can see from the screenshot below, the Easy Discount module is working. I just can't get to the bottom of why the Coupon Code is not being displayed or processed!!???!! :'(

 

easy_discount_screenshot.gif

 

This is my easy_coupons_box.php:

 
	 <td width="100%" align="right">  
	 <?php echo tep_draw_form('coupon', tep_href_link(basename($PHP_SELF), '', $request_type)); ?>  
	 <table class="bordergray" width="100%">  
	  <tr>  
	   <td valign="middle" align="right" width="100%">  
<?php echo EC_COUPONCODE; 
if ($ec_auto) { 
$info = file_get_contents('info_coupon.txt');
$thumb = DIR_WS_LANGUAGES . $language.'/images/buttons/button_about.gif';  
$popup = DIR_WS_LANGUAGES . $language.'/images/buttons/button_about.gif';  
$caption = $info;  
$prod_url = basename($PHP_SELF);  
 ?>
<a class="easyInfo" href="<?php echo $prod_url; ?>">  
<img src = "<?php  echo $thumb; ?>" hspace="5" vspace="5" border=0/>  
<span>  
<img src = "<?php  echo $popup; ?>"/>  
<BR/>  
<?php  echo $caption; ?>  
</span><br/>  
</a>  


<?php } ?>  
	   </td>  
	   <td align="center" valign="middle" nowrap>  
	   <?php if ($ec_active) {  
			   echo tep_draw_password_field('coupon_code1', '', ' size="'.$ec_clth.'" maxlength="'.$ec_clth.'" class="inputbox" ');  
			 } else {  
			   echo tep_draw_password_field('coupon_code1', '', ' size="'.$ec_clth.'" maxlength="'.$ec_clth.'" disabled class="inputbox" ');  
			 }  
	   ?>  
	   </td>  
	   <td align="left" width="50%">  
	   <?php  
			 if ($ec_active) {  
			  echo tep_hide_session_id() .tep_image_submit('button_cash_in.gif', 'Cash in Coupon');  
			 } else {  
			  echo '<img src="includes/languages/'.$language.'/images/buttons/button_cash_in_gray.gif" style="vertical-align:bottom;" alt="Unavailable" title="Unavailable">';  
			 }  
	   ?>  
	   </td>  
	  </tr>  
	 </table>  
	</form>  
	</td>


* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Share this post


Link to post
Share on other sites

Hmmmm......

 

Well now. I've finally got Easy Coupons to display the discount by commenting out these two lines in <easy_coupons_code.php>

 

 

//if (MODULE_EASY_DISCOUNT_STATUS == 'true') {

// coupons enabled

if ($ec_active) {

// cart not empty

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

// coupon code input given

if ($_POST['coupon_code1'] != '') {

// concatenate the input fields

$inputcouponcode = strtoupper($_POST['coupon_code1']);

// coupon reset code

if ($inputcouponcode != 'RESET') {

// fetch the coupon code from the database

$coupon_query = tep_db_query("select code, discount, type, enddate

from coupons

where code = '" . $inputcouponcode . "'

and (enddate > now() || enddate is null)

and used = 0 ");

$coupon = tep_db_fetch_array($coupon_query);

// valid and available coupon code found

if ($coupon['code']) {

$couponcode = array('code' => $coupon['code'], 'discount' => $coupon['discount'], 'type' => $coupon['type']);

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

// give message

// $messageStack->add_session('cart',EC_PROCESSED,'success');

 

 

But I haven't yet managed to figure out why it's not working with those two lines in. I'm sure I probably need the correct code to go into those two lines so that the discount gets applied and the database updated with used status but I haven't managed to work it out yet (Slowly going under from sleep deprivation)

:'(

 

Can anyone shed any light please, as to what I need to replace those two lines with?


* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Share this post


Link to post
Share on other sites

Is it just my imagination, or has this thread just ground to a halt?


* * * * * * * * * * * * * * * * * * * * *

Porpoises are most happy when wet!

\ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _ \ _

Share this post


Link to post
Share on other sites

Help! Okay, I'm setting up my OSC site, and decided we needed a coupon function. I installed Easy Discount (including addons), and Easy Coupon, and waded through a few errors, all my fault. But I've hit a wall. In my Admin it shows the "Easy Coupon" link, so I click through and it comes up with:

 

"1146 - Table 'jadeattar.configuration' doesn't exist

 

select configuration_value from configuration where configuration_key ='EASY_COUPONS'

 

[TEP STOP]"

 

jadeattar is the database, and configuration (or osc_configuration as it's actually in the db) is installed, I ran the sql file, and I double checked the configuration file, and all seems correct. Any ideas why this is happening? I would love to get this running!!

 

Thanks in advance!

Share this post


Link to post
Share on other sites

I have installed the easy discount and easy coupon contributions but I am getting the error:

 

Fatal error: Call to undefined function: clear() in c:\apache\htdocs\includes\modules\easy_coupons_code.php on line 72

 

 

Not sure where to look.

Can anyone help me

 

Thanks

 

Mike

Share this post


Link to post
Share on other sites

Can anyone help me

 

I've installed Easy Discount and Easy Coupon as directed and the Coupon fields shows up on the Shopping_cart.php page.

 

But nothing appears to work.

 

It enter the coupon code and update the cart but no discount shows

 

Can anyone point me in the right direction as to why it isn't showing up on the page or does it only show up on the confirmation page ?

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

 

could you also give me an advice...? I have installed your easy coupons and easy discount. Whenever I want to get easy_coupon page on admin I get the following error:

 

Fatal error: Cannot redeclare genpassword() (previously declared in /web/1/000/035/596/115692/htdocs/admin/easy_coupons.php:14) in /web/1/000/035/596/115692/htdocs/admin/includes/functions/general.php on line 51

 

... where is the problem? I have checked my installation several times and cannot find the mistake... Any advice welcome ;o)

Share this post


Link to post
Share on other sites

Time for a giggle but dont laugh too much I am not daft, just stupid...lol

 

Added Easy Coupons, everything seemed fine but 5 digit code generated and web site asking for 4x4 code, then I realised it states easy discounts needed.

 

So added that but have 2 issues:

 

1) in top of shopping_cart.php add:

 

include_once (DIR_WS_FUNCTIONS.'easy_discount.php');

 

Does this mean in the head of the file as when i did this it just printed the line on the webpage check out.

 

Also discount code still 5 digits and site asking for 4x4?

 

Sorry for the daft questions

 

ricardo


Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Share this post


Link to post
Share on other sites

Is any one supporting this thread? Not being impatient just I note that the last few posts are all asking for help and are unanswered. And if its not that not a problem, just need to know whether to plod on or look for alt coupons


Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×