Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount Coupon v0.95


Ian

Recommended Posts

Discount Coupon add-on for the New Checkout.

 

Note: You must have the Credit Class/GV 4.1+ installed to use this.

 

Cosmetic changes only from v0.94. Although the coupon code is now shown in order details, for better tracking.

 

I've also changed the default display in admin to show only active coupons.

 

http://www.oscommerce.com/downloads.php/co...ions,806/type,6

Trust me, I'm an Accountant.

Link to comment
Share on other sites

  • 1 month later...

Hi Ian!

 

Without offence to you may I say that it is quite unbecoming of you to have posted a mod that contains incomplete code!

 

Well, this mod works fine, but sends out only sketchy emails! ... No URLs to click upon and go back to the site to redeem coupons .. and no way to see the final format of the email that gets sent out!

 

And, the following text labels appear all through the admin side of the coupon mod:

 

COUPON_NAME  

COUPON_NAME_HELP  

COUPON_DESC

COUPON_DESC_HELP  

COUPON_AMOUNT  

COUPON_AMOUNT_HELP  

COUPON_MIN_ORDER  

COUPON_MIN_ORDER_HELP  

COUPON_CODE  

COUPON_CODE_HELP  

COUPON_USES_COUPON  

COUPON_USES_COUPON_HELP  

COUPON_USES_USER  

COUPON_USES_USER_HELP  

COUPON_PRODUCTS  

COUPON_PRODUCTS_HELP  

COUPON_CATEGORIES  

COUPON_CATEGORIES_HELP  

COUPON_STARTDATE  

COUPON_STARTDATE_HELP  

COUPON_FINISHDATE  

COUPON_FINISHDATE_HELP

 

Did I miss something to be added to the english.php file?

 

Any help will be most appreciated.

Link to comment
Share on other sites

Well, I can live with the insufficient Admin side, but the following erroneous content appears in the mail-out that contains the discount coupon.

 

1. TEXT_TO_REDEEM

 

2. TEXT_VOUCHER_ISb3c10106dd48

 

3. TEXT_REMEMBER

 

4. TEXT_VISIT

 

I really wish there was some way to populate these text labels with custom content.

Link to comment
Share on other sites

Furthermore, the order total doesn't get reduced even after punching in the coupon code in the checkout section at the appropriate place!

 

I am amazed to see that I am the only one facing this issue :shock:

 

Sunny

Link to comment
Share on other sites

I think you missed something in the install as it should not look like that at all. :? The standard email that is sent to my customers looks like this and can be changed in the defines:

 

"You can redeem this coupon during checkout. Just enter the code in the box provided, and click on the redeem button.

 

The coupon code is test

 

Don't lose the coupon code, make sure to keep the code safe so you can benefit from this special offer.

 

when you visit http://www.yoursite.com/catalog/

 

While I did have a few minor hick-ups trying to install these rather complex mods...what you have going there is just not quite right. :shock:

Link to comment
Share on other sites

Did you make sure to do the additional text edits that are included in the contributions? There were files to upload as well as text files where you just needed to add a line here and there, such as make sure you have this in catalog/includes/languages/english.php

 

require(DIR_WS_LANGUAGES . 'add_english.php');

 

There are other similar text edits that need to be carried out so you might want to double check that you have completed them all properly. HTH

Link to comment
Share on other sites

Discount Coupon add-on for the New Checkout.

 

Note: You must have the Credit Class/GV 4.1+ installed to use this.

 

Cosmetic changes only from v0.94. Although the coupon code is now shown in order details, for better tracking.

 

I've also changed the default display in admin to show only active coupons.

http://www.oscommerce.com/downloads.php/co...ions,806/type,6

 

How about a list of features for this contrib?

Link to comment
Share on other sites

fdb

 

Could you post an example of the output at checkout confirmation. Also what settings you have for the Discount Coupon(eg. include tax, exclude shipping etc)

Trust me, I'm an Accountant.

Link to comment
Share on other sites

From catalog side:

Sub-Total: $26.00

Tax (8.25%): $2.15

United States Postal Service (Priority Mail): $3.85

Discount Coupon: $5.00

Total: $26.39

 

From admin side:

Display Total

true

 

Sort Order

4

 

Include Shipping

false

 

Include Tax

false

 

Re-calculate Tax

false

Link to comment
Share on other sites

Two final questions,

 

Do you charge tax on shipping and is the Discount Coupon used product restricted. I'll then set up my dev site with the same parameters as you and test :)

Trust me, I'm an Accountant.

Link to comment
Share on other sites

  • 2 weeks later...

I would like to create an alert window containg the coupon error_message instead of having the error_message output in the header - in checkout_payment.php -- like the payment selection is. Has anyone done this or know how to do this? (I'm not good with javascript)...

Link to comment
Share on other sites

I've already answered my last question, but I have to ask another. Has anyone realized or fixed the error in modules/order_total/ot_coupon.php?

 

The error I'm referring to is this:

 

Output on successfully entering valid coupon code:

 

Congratulations, you have redeemed a coupon worth $5.00 on orders greater than 20.00 on orders over $20.00.

 

This, of course doesn't make much sense. I'm sure this area is the trouble spot. It seems that upon redemption, it isn't distinguishing the MIN_ORDER from the RESTRICTIONS - and therefore putting them together. By the way, I have no restrictions set on my coupon, only the minimum purchase of $5 off $20:

if ($coupon_result['min_order'] > 0) $coupon_extra = REDEEMED_MIN_ORDER . $currencies->format($coupon_result['min_order']);

   if ($coupon_result['products'] || $coupon_result['categories']) $coupon_extra .= REDEEMED_RESTRICTIONS;

   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'info_message=' . urlencode(ERROR_REEDEEMED_AMOUNT.REDEEMED_COUPON.$coupon_amount.' '.$coupon_extra.'.'), 'SSL'));

 

Anyone already fixed this?

Link to comment
Share on other sites

Michelle,

 

In checkout_payment.php, after a similar structure for payment error, insert this:

<?php

 if (isset($HTTP_GET_VARS['coupon_error'])){

?>

     <tr>

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

         <tr>

           <td class="main"><b>Coupon</b></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">

         <tr class="infoBoxNoticeContents">

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

             <tr>

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

               <td class="main" width="100%" valign="top"><?php echo $HTTP_GET_VARS['coupon_error']; ?></td>

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

             </tr>

           </table></td>

         </tr>

       </table></td>

     </tr>

     <tr>

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

     </tr>

<?php

 }

?>

then, in ot_coupons.php, replace all

 

'error_message='

 

with

 

'coupon_error='

 

It's not that it's an error - that is just the method that is used to notify the customer of the addition. I agree that it's not a great place to put it. The above will move it into its own box at the top of checkout_payment.php

 

- Greg

Link to comment
Share on other sites

What you posted does the same thing. There is no, and will be no difference. Why I know this without testing this, is I had already changed the error_message to coupon_message and even info_message for this (as you can see in my code above - the error_message was changed to info_message at the time I posted this).

 

The problem, like I said is that the 2 $coupon_result messages are merging even if there are no product restrictions.

Link to comment
Share on other sites

By commenting out each line seperately, the problem lies within this line of code only:

 

if ($coupon_result['min_order'] > 0) $coupon_extra = REDEEMED_MIN_ORDER . $currencies->format($coupon_result['min_order']);

 

When I commented out this line, I get:

 

Congratulations, you have redeemed a coupon worth $5.00 on orders greater than 20.00

 

Instead of:

 

Congratulations, you have redeemed a coupon worth $5.00 on orders greater than 20.00 on orders over $20.00

 

Not far from a solution now... :D

Link to comment
Share on other sites

There's a bug in the code. If you backtrack 5 or 6 lines from where you are you will find the line

 

    if ($coupon_result['min_order']>0) $coupon_amount .= 'on orders greater than ' .  $coupon_result['min_order'];    

 

Try commenting that out and seeing if that fixes it.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

I noticed that right after I posted - that commenting this specific line out does indeed correct the problem. BTW., Do you know what is the intention of that line is? I tried making two different test orders. One with, and without the minimum amount in my shopping cart - and it didn't change the output. Is this line even necesary?

 

Anyways, sorry I didn't post that I had found that earlier - had to run kids to school and dr's. appt. But indeed commenting this out did the trick. Of course, this could present a problem if this is a necessary line of code...I just don't see it's importance - other than fudging up the output.

 

:)

 

There's a bug in the code. If you backtrack 5 or 6 lines from where you are you will find the line

 

    if ($coupon_result['min_order']>0) $coupon_amount .= 'on orders greater than ' .  $coupon_result['min_order'];    

 

Try commenting that out and seeing if that fixes it.

Link to comment
Share on other sites

  • 1 month later...

    if ($coupon_result['min_order']>0) $coupon_amount .= 'on orders greater than ' .  $coupon_result['min_order'];    

 

Ian, having a problem with this one. I commented out the line above and that fixed that particulare problem. I can use the coupons if I don't put in a category or product list. I can redeem the coupon but it doesn't show up even if I have the item in the product or category list in my cart. any idea what may be wrong?

 

TIA, Tony

Link to comment
Share on other sites

Do your products have attributes. There was a known problem with attributes.

 

If this is the case I'll try and dig out the fix.

Trust me, I'm an Accountant.

Link to comment
Share on other sites

So far, I only have a couple items with attributes. the Item I was using to test wasn't one of them.

 

I plan on adding more items with attributes very shortly so that fix may help after all.

 

 

TIA, Tony

Link to comment
Share on other sites

Tony,

 

It's work in progress.

 

The idea is that you create a discount coupon then email it to someone. If the text restrict box is ticked, then that customer is added to a list. The customers in the list are the only people who can redeem the coupon.

 

In other words a coupon only some customers can use.

 

Only its not working yet :(

Trust me, I'm an Accountant.

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