Jump to content
Sign in to follow this  
ms-signs

coupons by ingo

Recommended Posts

I added this contribution to my site, everything works except for the most important thing, it's not subtracting the coupon value. I search for support in english an couldn't find anything.

 

this is the code I added to checkout_process;

 

// unregister session variables used during checkout

tep_session_unregister('sendto');

tep_session_unregister('billto');

tep_session_unregister('shipping');

tep_session_unregister('payment');

tep_session_unregister('comments');

 

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 

// coupons addon start

if (isset($ot_coupon) && is_object($ot_coupon) && $ot_coupon->redeem==true) {

tep_db_query("insert into " . TABLE_COUPONS_SALES . " (coupons_code, customers_id, orders_id, date_purchased) values ('" . tep_db_input($ot_coupon->coupons_code) . "', '" . (int)$customer_id . "', '" . (int)$insert_id . "', now())");

tep_session_unregister('coupon_code_code');

tep_session_unregister('coupon_code_value');

}

// coupons addon end

 

require(DIR_WS_INCLUDES . 'application_bottom.php');

 

?>

 

 

thank you.

Share this post


Link to post
Share on other sites

goog morning,

I have in my checkout_process.php following.

It works very well.

 

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');
// coupons addon start
  if (isset($ot_coupon) && is_object($ot_coupon) && $ot_coupon->redeem==true) {
  	tep_db_query("insert into " . TABLE_COUPONS_SALES . " (coupons_code, customers_id, orders_id, date_purchased) values ('" . tep_db_input($ot_coupon->coupons_code) . "', '" . (int)$customer_id . "', '" . (int)$insert_id . "', now())");
	tep_session_unregister('coupon_code_code');
	tep_session_unregister('coupon_code_value');
  }
// coupons addon end
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

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

 

regards

Diana

Share this post


Link to post
Share on other sites

Hi all

Quick question in relation to this add on.

Is there a way to offer a coupon based on a percentage i.e. 20% off coupon rather than the current value based £2.50 etc?

Thanks

Anthony

Share this post


Link to post
Share on other sites
goog morning,

I have in my checkout_process.php following.

It works very well.

 

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');
// coupons addon start
  if (isset($ot_coupon) && is_object($ot_coupon) && $ot_coupon->redeem==true) {
  	tep_db_query("insert into " . TABLE_COUPONS_SALES . " (coupons_code, customers_id, orders_id, date_purchased) values ('" . tep_db_input($ot_coupon->coupons_code) . "', '" . (int)$customer_id . "', '" . (int)$insert_id . "', now())");
	tep_session_unregister('coupon_code_code');
	tep_session_unregister('coupon_code_value');
  }
// coupons addon end
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

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

 

regards

Diana

 

Hi Diana,

 

Thank you for your help. I found the problem it was in the order total (display order) I had the coupon set to display last, this is why it was not subtracting from order.

Thank you

Share this post


Link to post
Share on other sites

I can't get the coupon box to show in checkout_payment.php It shows Coupon, but no box. I have this as the code:

<tr>

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

</tr>

<!--Coupon by Ingo-->

<tr>

<td class="main"><b><?php echo TEXT_COUPON_HEADING; ?></b></td>

</tr>

<tr>

<td><?php require(DIR_WS_INCLUDES . 'boxes/coupon_payment.php'); ?></td>

</tr>

<tr>

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

</tr>

<!--End Coupon by Ingo-->

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

 

Any Ideas why it's not showing? The tables are showing in my sql and I have coupons set up in my admin backend, and that's working. No error message, just no box.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites

I fixed it. There's a module you have to enable in payment modules in admin. There was nothing in the directions about that *slapping forhead*. Everythings working now.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites
I fixed it. There's a module you have to enable in payment modules in admin. There was nothing in the directions about that *slapping forhead*. Everythings working now.

 

what was the name of the module? I've run into the same issue.

 

Thanks!

Share this post


Link to post
Share on other sites

I have also installed this contribution, but see no location in the admin tool to add in codes to be redeemed. Any suggestions?

Share this post


Link to post
Share on other sites
I have also installed this contribution, but see no location in the admin tool to add in codes to be redeemed. Any suggestions?

It's in the Catalog section in Admin.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites
what was the name of the module? I've run into the same issue.

 

Thanks!

 

In Admin, go to Modules, then Order Total. You'll see Coupons. Click on it.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites

Ok got it. Unfortunately, it provided this:

 

1054 - Unknown column 'coupons_id' in 'field list'

 

select coupons_id, coupons_code, coupons_notice, coupons_value, coupons_min_order, coupons_date from coupons order by coupons_id limit 0, 4

 

[TEP STOP]

 

Any ideas?

Share this post


Link to post
Share on other sites

Somewhat unrelated, is there a way to correct how it displays on the website? www.cupkozy.com is the URL, it's on the left column, but looks funky (for lack of a better term)

Share this post


Link to post
Share on other sites
Ok got it. Unfortunately, it provided this:

 

1054 - Unknown column 'coupons_id' in 'field list'

 

select coupons_id, coupons_code, coupons_notice, coupons_value, coupons_min_order, coupons_date from coupons order by coupons_id limit 0, 4

 

[TEP STOP]

 

Any ideas?

Make sure you copied the code over correctly. It looks like you don't have everything copied over right. Did you add the sql to your database???

 

BTW: You better read my sig.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites
Somewhat unrelated, is there a way to correct how it displays on the website? www.cupkozy.com is the URL, it's on the left column, but looks funky (for lack of a better term)

That's your particular css and template. You'll have to contact your template provider for that information.


Debora

Breaking code.... one website at a time.

Vibrators: like cute little puppies without the puppy breath. Who can't like a vibrator?

Life Tip: Taking yourself too seriously? Put on a penis hat and look in the mirror every 5 minutes. That should fix it.

"Finally found the ball gag for those damn voices. Now to pull out the whip...." - Me

Member of the CODE BREAKERS CLUB - WE RULE!

Share this post


Link to post
Share on other sites
BTW: You better read my sig.

 

Read it, but when I said help, I meant from anyone. lol

 

But thank you for your replies.

Share this post


Link to post
Share on other sites

when i try to add a coupon i get this in the admin -->

 

Fatal error: Call to undefined function: ctype_graph() in c:\apache\htdocs\admin\coupons.php on line 37

 

can someone tell me what this means.

 

I can add the coupon going through phpmyadmin but not through the admin.

 

the only other problem i am having is that the total is not right.

where might i look for the total not being right.

 

Thanks

Share this post


Link to post
Share on other sites

Looks like you did not install a file containing the function ctype_graph when you installed the contribution.

 

Recheck your installation.


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites
Looks like you did not install a file containing the function ctype_graph when you installed the contribution.

 

Recheck your installation.

 

 

I have been through the install instructions for several different versions and i cant find for the life of me what is going on. Will the function be in admin/includes/functions? or admin/coupons?

 

Thanks

Share this post


Link to post
Share on other sites

Just reinstall all the new ones in the correct place and check you amended those that needed amending


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites

Hi All,

 

I have installed this contribution, and all is now working (not at first, also needed to install coupon module in the order payment, thanks for the hint)

 

The problem I have is that PayPal is not deducting the coupon value. I have tried the coupon in all 5 positions in the "order total modules". The discount appears correctly in the checkout page and the sums are correct, but once it gets to PayPal the coupon isn't applied.

 

Is this an issue with this module or within the PayPay payments page settings?

 

What order do you have your "order total modules" in?

 

Please help.

 

All the best,

 

Phil

Share this post


Link to post
Share on other sites

Just a thought,

 

Does PayPal_IPN require a line to include the coupon reduction?

 

Something like this? (code from paypal_ipn.php)

 

$sql_data_array = array('orders_id' => $insert_id,

'products_id' => tep_get_prid($order->products[$i]['id']),

'products_model' => $order->products[$i]['model'],

'products_name' => $order->products[$i]['name'],

'products_price' => $order->products[$i]['price'],

'final_price' => $order->products[$i]['final_price'],

'products_tax' => $order->products[$i]['tax'],

'products_quantity' => $order->products[$i]['qty']);

 

Please advise

 

Phil

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  

×