Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted
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

  • 2 months later...
Posted

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.

Posted

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.

Posted
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!

Posted

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

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

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

Posted

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?

Posted

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)

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

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

  • 2 weeks later...
Posted

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

Posted

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

Posted
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

Posted

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

  • 2 months later...
Posted

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

Posted

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

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