Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Please help...

 

Im running paypal IPN and when a customer uses a discount code successfully the admin report never changes.

 

Redemptions

In Total=0

For this Customer=0

 

This discount can also be reused over and over no matter if you select only 1 per user.

 

Also what is the fix for the java popup under the shopping cart Coupon "more_info" link. I only receive an error on page.

 

Thanks,

Steve

 

 

Discount Coupons

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

Webtrek,

 

I want to remove the shipping desc and amount from my total "blob".

 

In my order_confirmation page I have moved things around to make them look better as you can see below. I added the description of the shipping under "Shipping Method" and also put the price out to the right. I also added the subtotal under the items in the cart. Now I need to remove the shipping cost from in the total "blob". I know I can turn it off in the admin but when I do that it then no longer shows when looking at invoices or the order in the admin. That is bad because I DO need it there.

 

I can't figure out how to call everything BUT the shipping in the total "blob". I know I could probably call each other item seperately but I am not sure if that is a good thing to do as it may mess up calculations or something.

 

Let me know if you have any ideas.

 

Craig

 

checkout.JPG

 

WOW! that looks GREAT!....You are a lot more advanced then I am, that's for sure....... the only suggestion I would have is to omit the part of the code that calls for that information. I would be looking in any code that refers to the Order Total. But I would be wondering around in the dark. Good luck man, If you have gotton this far you should have no real trouble figuring this out.

Link to comment
Share on other sites

WOW! that looks GREAT!....You are a lot more advanced then I am, that's for sure....... the only suggestion I would have is to omit the part of the code that calls for that information. I would be looking in any code that refers to the Order Total. But I would be wondering around in the dark. Good luck man, If you have gotton this far you should have no real trouble figuring this out.

Well moving the stuff around was not a problem. Getting the subtotal to display was not THAT hard (just figuring out to use the same code that is used in the cart in the header). Getting the shipping amount to display is not hard either, it is just asking for the value of Orders->total[shipping] but what I CANNOT figure out is HOW in the WORLD to seperate the info coming from the script that calls the order total info ("blob" as I call it).

 

The code that calls all that info is "echo Orders->total->Process()" or soemthing like that. In other words it is the "result" of what the order_total classes calculates. I have looked through the order_total files but cannot really figure out exactly what to do. The only thing I can figure is to define another function (like "process" without the shipping calc) and then call it during checkout_process but not in the other files.

 

ANOTHER problem is that from what I can tell the shipping info doesn't even get written to the database UNLESS it is called in order_confirmation!!! This is STUPID! The setting in the admin is to not SHOW the shipping, not to not RUN it!! I think this is a bug.

 

Anyway, I was hoping someone that knew this contrib (this IS the forum thread for it isn't it??!!) could help me add a function or whatever I need to do to fix this.

 

Any ideas?

 

Craig

Link to comment
Share on other sites

I got the above error and I commented out

// $total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM

 

I don't know if this will cause any problems down the road.. every file I added I got the same eroor..

 

please let me know

Noppie

 

Hi Noppie,

Don't know if you've resolved this yet or not but I just installed the CCGV 5.11 contribution over the week-end and got the same error. After much searching on the forum I found that the missing function is contained at the end of

catalog/includes/classes/shopping_cart.php in CCGV 5.12 and looks like this:

 

// ------------------------ ICW CREDIT CLASS Gift Voucher Addittion-------------------------------Start

// amend count_contents to show nil contents for shipping

// as we don't want to quote for 'virtual' item

// GLOBAL CONSTANTS if NO_COUNT_ZERO_WEIGHT is true then we don't count any product with a weight

// which is less than or equal to MINIMUM_WEIGHT

// otherwise we just don't count gift certificates

 

function count_contents_virtual() { // get total number of items in cart disregard gift vouchers

$total_items = 0;

if (is_array($this->contents)) {

reset($this->contents);

while (list($products_id, ) = each($this->contents)) {

$no_count = false;

$gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");

$gv_result = tep_db_fetch_array($gv_query);

if (ereg('^GIFT', $gv_result['products_model'])) {

$no_count=true;

}

if (NO_COUNT_ZERO_WEIGHT == 1) {

$gv_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($products_id) . "'");

$gv_result=tep_db_fetch_array($gv_query);

if ($gv_result['products_weight']<=MINIMUM_WEIGHT) {

$no_count=true;

}

}

if (!$no_count) $total_items += $this->get_quantity($products_id);

}

}

return $total_items;

}

// ------------------------ ICW CREDIT CLASS Gift Voucher Addittion-------------------------------End

 

HTH,

 

Keith

Link to comment
Share on other sites

Hi,

 

We've just installed this contrib and the discount coupons we can't get to work. The site is not live yet, so you can see the errors for yourself at http://halloweenplayground.com. The coupon code is flat - it should take $1.00 off the price.

 

Here's what I actually get: Tax is 7.75%

 

Sub-Total: $4.00

CA Tax: $0.31

United States Postal Service (1 x 0.65lbs) (Priority (2 - 3 Days)): $3.85

Discount Coupons:flat: -$1.00

Total: $7.08

 

Any ideas on how to fix? I have similar problems with percentage coupons. I also do not have gift vouchers installed as I do not use them.

 

Please, let me know if there is any additional ifnromation I can provide to help debug this.

Thanks

Link to comment
Share on other sites

fixed by setting the modules->order-total->recalc tax to none.

Hi,

 

We've just installed this contrib and the discount coupons we can't get to work.  The site is not live yet, so you can see the errors for yourself at http://halloweenplayground.com.  The coupon code is flat - it should take $1.00 off the price.

 

Here's what I actually get: Tax is 7.75%

 

Sub-Total: $4.00

CA Tax: $0.31

United States Postal Service (1 x 0.65lbs) (Priority (2 - 3 Days)): $3.85

Discount Coupons:flat: -$1.00

Total: $7.08

 

Any ideas on how to fix?  I have similar problems with percentage coupons.  I also do not have gift vouchers installed as I do not use them.

 

Please, let me know if there is any additional ifnromation I can provide to help debug this.

Thanks

Link to comment
Share on other sites

Somebody please help!

 

I have installed this contribution, and all seemed to go well.  I created a new discount voucher, and attempted a sample order.  However, I kept getting a number of errors, most of which I was able to rectify myself.  However, I now have the following error, which appears after choosing payment method at checkout and pressing continue:

I have tried uploading all the files again to see if I made a mistake that way, and searched through the forums for answers but nothing has helped so far!  I am a newcomer to PHP so please be gentle with me!!

 

Many thanks

 

Sarah

 

 

 

I have this very same problem. Can you please tell me how you got this fixed?

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Solved my problem.

 

I noticed it was not just happening in that scenario.  It was also happening if I click on Whats New Arrow to view all new products and then clicked on add to cart for product listed there....

 

I just recently had modified the code through another thread I saw, where instead of when someone adds something to thier cart and then they hit continue shopping it would normally take them back to last product added, but this modification would take them back 2 screens..which normally would be the main category screen...

 

Needless to say, this was causing my problem.  After I reverted the code back to normal, the problem went away.

 

catalog/shopping_cart.php original code:

 ? ? ? ? ? ? ? <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>

 

had changed it to this:

 

<td class="main">
<?php
$back = sizeof($navigation->path)-3; ?// Go back 2 screens
echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';
?>
</td>

 

So if anyone else had saw this in another thread....this is the reason you will have the error I was having....

 

Side note:

an osC Team Member, if I recall correctly, 241 had posted this code:

 ? ? ? ? ? ? ? <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>

However those following that thread...learned that this would take a customer back to default page(index.php)

 

 

 

None of that above would work so this is what I had done to make the fix on my site...

<td class="main"><a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I've been running this module on my site, and it works really well...except for one thing. I don't seem to be able to combine a %age discount wiht free shipping. When I set it up, it's fine, but it actually sets it up as a value discount.

 

IE. If I try to give a 10% discount with free shipping, it turns it into a ?10 voucher with free shipping!

 

Everything else works fine..where am I going wrong?

 

Thanks in advance! :blush:

Link to comment
Share on other sites

sargenle: try changing

if ($order->content_type == 'virtual') {

 

to

 

 if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {

 

Sorry it took me so long to get back to you this adjustment works partly.  If I have just virtual items in the cart than there is no shipping.  If I have virtual items and real items in the cart when I check out shipping is charged based on all items in the cart. I use SMC's table rate which only charges shipping when gift vouchers and real items are combined together.

i have been reading from Page 80 to 100 and I still have not found an answer.  Thought I might post to you and see what you have to say.

 

Leon

 

Link to comment
Share on other sites

 

You know looking at this code:

 

// if the order contains only virtual products, forward the customer to the billing page as

// a shipping address is not needed

// ICW CREDIT CLASS GV AMENDE LINE BELOW

// if ($order->content_type == 'virtual') {

if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {

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

$shipping = false;

$sendto = false;

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

}

 

****** I noticed that the above code says that if all items in the cart are virtual then skip shipping and go to check out. This works great for virtual only items.

 

 

$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

 

 

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

 

Here the code should read something like take cart minus out virtual or no weight items and then calculate shipping accordingly.

 

Could this be the reason that when I add virtual items with real items all get charged a table rate for shipping but if the cart just has virtual items then there is no shipping and the page goes to checkout_payment

 

Can anyone help me out with this?

 

Strider?

 

Leon Sargent

 

By the way I use SMC's Table Rate and it works with virtual items just not with the mix of virtual and non virtual items. They it adds shipping to the whole cart.

Link to comment
Share on other sites

Hey everyone, osCommerce newbie here trying to finish a project in the next 48 hours. everything seemed to be going soooo smoothly when.....

 

 

 

discount coupon of %10 [no restrictions]: if 'calculate shipping' is set to true in the coupon payment mod, then it returns the discount as 10% OF THE SHIPPING COST [not the product cost]; if 'calculate shipping' false, then the coupon isn't honored at all... please help help help help... i am a reasonable PHP programmer so, even any LEADS you might have would help!

 

The site is an osCommerce 2.2ms2 installed standard by PLESK, with the following contributions added to it:

 

Contributions - Credit Class & Gift Voucher / Coupon System [English, Spanish, German]

4 Feb 2005 - The final

19 Feb 2005 - GV_redeem anti SQL injection

 

Contributions - Quickbooks Import QBI [English, Spanish]

24 Feb 2005 - QBI Import v2.02b

 

Contributions - VeriSign Payflow Link for osC 2.2 MS 2 [English]

12 Jan 2005 - VeriSign Payflow Link for osC 2.2 MS 2 (WORKING)

 

thanks

allen

Link to comment
Share on other sites

Hey everyone, osCommerce newbie here trying to finish a project in the next 48 hours. everything seemed to be going soooo smoothly when.....

discount coupon of %10 [no restrictions]: if 'calculate shipping' is set to true in the coupon payment mod, then it returns the discount as 10% OF THE SHIPPING COST [not the product cost]; if 'calculate shipping' false, then the coupon isn't honored at all... please help help help help... i am a reasonable PHP programmer so, even any LEADS you might have would help!

 

updates.. no luck yet, but im getting closer to the issue... the line that takes a percentage of the amount [$amount] is written properly... it seems that in ot_coupon.php, function calculate_credit($amount) is somehow getting passed the SHIPPING amount instead of the TOTAL amount. i'll have to do some debug runs and see if i can find out whats going on; but if anyone more experienced knows the order in which things are called to generate $amount and/or if it could be accidently getting changed somewhere in there [theres a whole lot of GLOBALing going on, for example], I'd love you forever.

 

I'll be checking the thread for the next two hours from now till the end of time, I'm sure ;S

Link to comment
Share on other sites

None of that above would work so this is what I had done to make the fix on my site...

<td class="main"><a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

 

 

Hey PopTheTop!

 

I eventually used this method which ....is lost somewhere in the forum, but Sincraft made it a contribution:

 

http://www.oscommerce.com/community/contri...ntinue+shopping

Link to comment
Share on other sites

Hello all, :)

 

a fast question.

 

I have setup a welcome ammount from 2.50 $. In CCGV 5_12.

In my language files i have add :

 

require(DIR_WS_LANGUAGES . 'add_ccgvdc_german.php'); ?// ICW CREDIT CLASS Gift Voucher Addittion

 

In create account i have added the CCGV addittions too.

 

/* ICW Credit class gift voucher begin */
define('EMAIL_GV_INCENTIVE_HEADER', 'Als kleines Willkommensgeschenk senden wir Dir einen Gutschein ?ber %s');
define('EMAIL_GV_REDEEM', 'Dein pers?nlicher Gutscheincode lautet %s. Du kannst diese Gutschrift entweder w?hrend dem Bestellvorgang verbuchen');
define('EMAIL_GV_LINK', 'oder direkt ?ber diesen Link: ');
define('EMAIL_COUPON_INCENTIVE_HEADER', 'Herzlich Willkommen in unserem Webshop. F?r Deinen ersten Einkauf verf?gst Du ?ber einen kleinen Einkaufsgutschein,' . "\n" .
                                       ' alle notwendigen Informationen diesbeznglich findest Du hier:' . "\n\n");
define('EMAIL_COUPON_REDEEM', 'Gib einfach Deinen pers?nlichen Code %s w?hrend des Bezahlvorganges ' . "\n" .
                              'ein');

/* ICW Credit class gift voucher end */

 

But, when a new user make the rgistration, in the email is nothing

about, that the user have the 2.50 $ Ammount in the account.

 

What have i do wrong, and we can i fix it ?

 

Cheers

Hobbes

Edited by Hobbes_TheReal
Link to comment
Share on other sites

Dear Strider et. al.: (anyone with more than a couple of weeks osC xperience, really)

 

I'm having endless trouble with the CC/GV+DC module, to the point where I've been authorized to offer a reasonable hourly rate for an hour of time from whomever can tell me what the @#$% is going on and help me fix it! Maybe this person and I can make an arrangement to make sure this osC install is working right by midweek, and even perhaps for future installs! I've gotten kinda close so the lid shood be loosened a bit......

 

Here's the situation so far. Our PLESK 7.5.2 Reloaded control pannel installed for us a fresh new osCommerce 2.2ms2. I've added:

 

Contributions - Credit Class & Gift Voucher / Coupon System [English, Spanish, German]

4 Feb 2005 - The final

19 Feb 2005 - GV_redeem anti SQL injection

 

Contributions - Quickbooks Import QBI [English, Spanish]

24 Feb 2005 - QBI Import v2.02b

 

Contributions - VeriSign Payflow Link for osC 2.2 MS 2 [English]

12 Jan 2005 - VeriSign Payflow Link for osC 2.2 MS 2 (WORKING)

 

QBI has not been activated or configued yet.

 

The problem in a nutshell is that if you buy something and choose a shipping method and coupon code [standard 10% off] and go to check out, the 10% is somehow taken off of the SHIPPING charge. This is when the coupon's "Calculate Shipping" is set to true; if it is set to false, the coupon doesn't register AT ALL. This is obviously wrong and has been a bugger to hunt down. I'm a decent programmer but I'm just not familiar with all of the osCommerce inner workings and the general order of things. I have, though, figured out that in ot_coupon.php, the function calculate_credit($amount) functions properly; but somehow, when the checkout_confirmation gets called and displayed, calculate_credit is called TWICE, once with the proper order total, and again with the cost of shipping (naturally, right before the value is displayed, and probably before it is used, as well).

 

Incidently I should mention that I tried 'remove'ing and 'install'ing the Gift Vouchers and Discount modules a few times, and tried multiple payment processing orders, both with sort values of my own invention and around the values installed by default, as indicated in many spots of the thread, about half of which I've skimmed by now!

 

This project is for a client who needs to migrate by the end of the month, and these little problems with coupons and such are the only things standing between him and his 1,139 darned coupons and bliss! If you think you can and will help, please get back to me ASAP :)

 

its only the strength and flexibility in our community interactions

that makes an open source future possible.. together, we are greater

than the sum of our parts. ...or we had better be!

 

-allen

Link to comment
Share on other sites

Having a problem with this contribution and need help locating the problem. My problem is i keep getting the following error

 

Fatal error: Call to a member function on a non-object in /home/ecommerc/public_html/templates/original/content/checkout_payment.tpl.php on line 181

 

and the code it is referring to is

 

<?php
 echo $order_total_modules->credit_selection();//ICW ADDED FOR CREDIT CLASS SYSTEM
?>

 

I have gone through all the files trying to hunt this down but cant seem to find it. A little info about the cart, I installed BTS, PWA and column controller (figure i would start ff with he tugh ones). I tried commenting out the referance but that code is what calls the function to create the gift voucher/coupon input box so it would defeat the purpose to comment it. Any help anyone can give me would be greatly appreciated.

Link to comment
Share on other sites

Hello all, :)

 

i am a bit curious. I have installed all fine and works great now, but

is there no way to show the user in his account page the Voucher Balance ?

 

He see it only in shooping Cart, and i need it in account too.

I think, was a good one, for the costumers.

 

Is that possible ?

 

Regards,

 

Hobbes

Edited by Hobbes_TheReal
Link to comment
Share on other sites

I agree. I added it to the Sending Voucher page. I will post that file in a moment. You will like it. I am guessing that the same code I used will work in the My Account section as well. Try it, you should like it. Go to http://www.popthetop.com/catalog/gv_send.php and http://www.popthetop.com/catalog/gv_faq.php to see them in action.

 

Here is the updated gv_send.php:

<?php
/*
 $Id: gv_send.php,v 1.1.2.3 2003/05/12 22:57:20 wilt Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 - 2003 osCommerce

 Gift Voucher System v1.0
 Copyright (c) 2001, 2002 Ian C Wilson
 http://www.phesis.org

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require('includes/classes/http_client.php');

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_SEND);

 if (($HTTP_POST_VARS['back_x']) || ($HTTP_POST_VARS['back_y'])) {
   $HTTP_GET_VARS['action'] = '';
 }
 if ($HTTP_GET_VARS['action'] == 'send') {
   $error = false;
   if (!tep_validate_email(trim($HTTP_POST_VARS['email']))) {
     $error = true;
     $error_email = ERROR_ENTRY_EMAIL_ADDRESS_CHECK;
   }
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
   $gv_result = tep_db_fetch_array($gv_query);
   $customer_amount = $gv_result['amount'];
   $gv_amount = trim($HTTP_POST_VARS['amount']);
   if (ereg('[^0-9/.]', $gv_amount)) {
     $error = true;
     $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
   }
   if ($gv_amount>$customer_amount || $gv_amount == 0) {
     $error = true; 
     $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
   } 
 }
 if ($HTTP_GET_VARS['action'] == 'process') {
   $id1 = create_coupon_code($mail['customers_email_address']);
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id='".$customer_id."'");
   $gv_result=tep_db_fetch_array($gv_query);
   $new_amount=$gv_result['amount']-$HTTP_POST_VARS['amount'];
   if ($new_amount<0) {
     $error= true;
     $error_amount = ERROR_ENTRY_AMOUNT_CHECK; 
     $HTTP_GET_VARS['action'] = 'send';
   } else {
     $gv_query=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_amount . "' where customer_id = '" . $customer_id . "'");
     $gv_query=tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
     $gv_customer=tep_db_fetch_array($gv_query);
     $gv_query=tep_db_query("insert into " . TABLE_COUPONS . " (coupon_type, coupon_code, date_created, coupon_amount) values ('G', '" . $id1 . "', NOW(), '" . $HTTP_POST_VARS['amount'] . "')");
     $insert_id = tep_db_insert_id($gv_query);
     $gv_query=tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, sent_lastname, emailed_to, date_sent) values ('" . $insert_id . "' ,'" . $customer_id . "', '" . addslashes($gv_customer['customers_firstname']) . "', '" . addslashes($gv_customer['customers_lastname']) . "', '" . $HTTP_POST_VARS['email'] . "', now())");


     $gv_email .= sprintf(EMAIL_GV_SEND_TO, stripslashes($HTTP_POST_VARS['to_name'])) . "\n" .
     sprintf(EMAIL_GV_TEXT_HEADER, $currencies->format($HTTP_POST_VARS['amount'])) . "\n" .
     REDEEMABLE_AT . "\n\n" .
     sprintf(EMAIL_GV_FROM, stripslashes($HTTP_POST_VARS['send_name'])) . "\n";
     if (isset($HTTP_POST_VARS['message'])) {
       $gv_email .= EMAIL_GV_MESSAGE . "\n\n";
       $gv_email .= stripslashes($HTTP_POST_VARS['message']) . "\n\n\n";
     } 
     $gv_email .= sprintf(EMAIL_GV_REDEEM, $id1) . "\n\n";
     $gv_email .= EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false);;
     $gv_email .= "\n\n";  
     $gv_email .= EMAIL_GV_FIXED_FOOTER . "\n\n";
     $gv_email .= EMAIL_GV_SHOP_FOOTER . "\n\n";;
     $gv_email_subject = sprintf(EMAIL_GV_TEXT_SUBJECT, stripslashes($HTTP_POST_VARS['send_name']));             
     tep_mail($HTTP_POST_VARS['to_name'], $HTTP_POST_VARS['email'], $gv_email_subject, nl2br($gv_email), STORE_OWNER_EMAILS_FROM_NAME, STORE_OWNER_EMAIL_ADDRESS, '');
   }
 }
 $breadcrumb->add(NAVBAR_TITLE);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading">Sending a Gift Voucher</td>
           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 if ($HTTP_GET_VARS['action'] == 'process') {
?>
     <tr>
       <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?><br><br><?php echo 'gv '.$id1; ?></td>
     </tr>
     <tr>
       <td align="right"><br><br><a href="<?php echo tep_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
     </tr>
<?php
 }  
 if ($HTTP_GET_VARS['action'] == 'send' && !$error) {
   // validate entries
     $gv_amount = (double) $gv_amount;
     $gv_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
     $gv_result = tep_db_fetch_array($gv_query);
     $send_name = $gv_result['customers_firstname'] . ' ' . $gv_result['customers_lastname'];
?>
     <tr>
       <td><form action="<?php echo tep_href_link(FILENAME_GV_SEND, 'action=process', 'NONSSL'); ?>" method="post"><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php echo sprintf(MAIN_MESSAGE, $currencies->format($HTTP_POST_VARS['amount']), stripslashes($HTTP_POST_VARS['to_name']), $HTTP_POST_VARS['email'], stripslashes($HTTP_POST_VARS['to_name']), $currencies->format($HTTP_POST_VARS['amount']), $send_name); ?></td>
         </tr>
<?php
 if ($HTTP_POST_VARS['message']) {
?>
          <tr>
           <td class="main"><?php echo sprintf(PERSONAL_MESSAGE, $gv_result['customers_firstname']); ?></td>
         </tr>
         <tr>
           <td class="main"><?php echo stripslashes($HTTP_POST_VARS['message']); ?></td>
         </tr>
<?php
     }

     echo tep_draw_hidden_field('send_name', $send_name) . tep_draw_hidden_field('to_name', stripslashes($HTTP_POST_VARS['to_name'])) . tep_draw_hidden_field('email', $HTTP_POST_VARS['email']) . tep_draw_hidden_field('amount', $gv_amount) . tep_draw_hidden_field('message', stripslashes($HTTP_POST_VARS['message']));
?>
         <tr>
           <td class="main"><?php echo tep_image_submit('button_back.gif', IMAGE_BUTTON_BACK, 'name=back') . '</a>'; ?></td>
           <td align="right"><br><?php echo tep_image_submit('button_send.gif', IMAGE_BUTTON_CONTINUE); ?></td>
         </tr>
       </table></form></td>
     </tr>
<?php
 } elseif ($HTTP_GET_VARS['action']=='' || $error) {
?>
 <form action="<?php echo tep_href_link(FILENAME_GV_SEND, 'action=send', 'NONSSL'); ?>" method="post">
     <tr>
      <td>
	 <table border="0" cellspacing="1" cellpadding="4" class="infoBox" width="100%">
   <tr class="infoBoxContents">
  	 <td class="main" valign="top" align="left" width="160"><?php echo tep_draw_separator('pixel_trans.gif', '10', '5'); ?><BR><?php echo HEADING_TEXT; ?></td>
  	 <td align="right">
  	 <table border="0" width="100%" cellspacing="1" cellpadding="2">
     <tr>
    	 <td>
    	 <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr>
      	 <td colspan="2" class="main"><?php echo ENTRY_NAME; ?></td>
       </tr>
       <tr>
      	 <td class="main"><?php echo tep_draw_input_field('to_name', stripslashes($HTTP_POST_VARS['to_name']));?></td>
      	 <td rowspan="4" valign="top" align="center" class="main">
      	 <table border="0" cellspacing="1" cellpadding="4" class="infoBox" width="200">
         <tr class="infoBoxContents">
        	 <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'stop.gif', 'Stop! Please read...','18','17'); ?>   Be absolutely sure that the information herein is correct. Once submitted, you can not go back...</td>
         </tr>
         <tr class="infoBoxContents">
        	 <td class="main">
<?php
// ICW ADDED FOR CREDIT CLASS GV
 if (tep_session_is_registered('customer_id')) {
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
   $gv_result = tep_db_fetch_array($gv_query);
   if ($gv_result['amount'] > 0 ) {
     echo '<strong>Voucher Account Balance:</strong>  ' . $currencies->format($gv_result['amount']);
   }
 }
 if (tep_session_is_registered('gv_id')) {
   $gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
   $coupon = tep_db_fetch_array($gv_query);
     echo VOUCHER_REDEEMED . ' ' . $currencies->format($coupon['coupon_amount']);
 }
 if (tep_session_is_registered('cc_id') && $cc_id) {
     echo CART_COUPON . ' ' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>';
 }
// ADDED FOR CREDIT CLASS GV END ADDITTION
?>
</td>
         </tr>
      	 </table>      
      	 </td>
       </tr>
       <tr>
      	 <td valign="bottom" class="main"><?php echo ENTRY_EMAIL; ?></td>
       </tr>
       <tr>
      	 <td class="main"><?php echo tep_draw_input_field('email', $HTTP_POST_VARS['email']); if ($error) echo $error_email; ?></td>
       </tr>
       <tr>
      	 <td valign="bottom" class="main"><?php echo ENTRY_AMOUNT; ?></td>
       </tr>
       <tr>
      	 <td class="main" colspan="2"><?php echo tep_draw_input_field('amount', $HTTP_POST_VARS['amount'], '', '', false); if ($error) echo $error_amount; ?></td>
       </tr>
       <tr>
      	 <td valign="bottom" class="main" colspan="2"><?php echo ENTRY_MESSAGE; ?></td>
       </tr>
       <tr>
      	 <td class="main" colspan="2"><?php echo tep_draw_textarea_field('message', 'soft', 50, 15, stripslashes($HTTP_POST_VARS['message'])); ?></td>
       </tr>
    	 </table>
    	 </td>
     </tr>
  	 </table>
  	 </td>
   </tr>
	 </table>
	 </td>
 </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><a href="javascript:history.back(-1);"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
               <td align="right"><?php echo tep_image_submit('button_send.gif', 'Click to send...'); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     </form>
<?php
 }
?>
   </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 //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Here is my updated FAQ page too...

<?php
/*
 $Id: gv_faq.php,v 1.2 2003/02/17 23:53:04 wilt Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 - 2003 osCommerce

 Gift Voucher System v1.0
 Copyright (c) 2001, 2002 Ian C Wilson
 http://www.phesis.org

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_FAQ);

 $breadcrumb->add(NAVBAR_TITLE); 
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><table border="0" width="40%" cellspacing="0" cellpadding="0" align="right">
         <tr>
           <td><?php new infoBoxHeading(array(array('text' => SUB_HEADING_TITLE))); ?></td>
         </tr>
         <tr>
           <td><?php new infoBox(array(array('text' => SUB_HEADING_TEXT))); ?></td>
         </tr>
       </table><?php echo TEXT_INFORMATION; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </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 //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

I noticed a few others here with this problem and found the fix...

 

I added a coupon for 10% off all products / categories.

 

At checkout, it took 10% off the shipping amount, NOT the subtotal.

 

The fix is this, go into Admin / Modules / Order Total and edit Discount Coupons like this:

 

Display Total - true

Sort Order - 4

Include Shipping - false

Include Tax - false

Re-calculate Tax - None

Tax Class - --none--

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Is the only way a new coupon voucher can be used if you e-mail it out to someone?

 

Can't I just create a new one and let others know what it is by posting an ad somewhere on my site telling them to use that coupon redemption code?

L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Link to comment
Share on other sites

Hey Top Popper:

 

would u please post the sort order of the rest of your payment modules? ...i havent tried it yet but its hard to believe that this will fix everything! ..and WHY havent i tried it yet? well, now when i press the +Install button next to Discount Coupons, it works for a second and then reverts to uninstalled state. siggghhhhh................. so i guess let me go search the thread on THAT now and perhaps prepare to re-install everything.

 

I noticed a few others here with this problem and found the fix...

 

I added a coupon for 10% off all products / categories.

 

At checkout, it took 10% off the shipping amount, NOT the subtotal.

 

The fix is this, go into Admin / Modules / Order Total and edit Discount Coupons like this:

 

Display Total - true

Sort Order - 4

Include Shipping - false

Include Tax - false

Re-calculate Tax - None

Tax Class - --none--

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