Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount Voucher


Guest

Recommended Posts

I have the Discount Voucher? Gift Voucher Contri installed in my store but it won't do one thing that I want.

 

I would like to be able to to allow potential customers to input their e-mail address in a form and recieve a discount voucher by return.

 

This is a comon marketing scheme used across the web but I don't see a way to impliment it here.

 

As a work around I thought of the request e-mail comming to me, and I would input the address into the Voucher Admin myself and send it off. BUT you can't enter an address, only send e-mail to customers who are already registered.

 

 

Any ideas please?

Link to comment
Share on other sites

This should already be in Gift Voucher Discount Coupons v.5.03...

 

In the create_account.php(newer OSC versions) or in the create_account_process.php(older OSC versions) you should have this:

 

// ICW - CREDIT CLASS CODE BLOCK ADDED  ******************************************************* BEGIN

 if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) {

   $coupon_code = create_coupon_code();

   $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())");

   $insert_id = tep_db_insert_id($insert_query);

   $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )"); 



   $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "nn" .

                  sprintf(EMAIL_GV_REDEEM, $coupon_code) . "nn" .

                  EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code) . 

                  "nn";

 }

 if (NEW_SIGNUP_DISCOUNT_COUPON != '') {

   $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;

   $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");

   $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . languages_id . "'");

   $coupon = tep_db_fetch_array($coupon_query);

   $coupon_desc = tep_db_fetch_array($coupon_desc_query);

   $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )"); 

   $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .  "nn" .

                  $coupon_desc['coupon_description'] . 

                  sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "nn" . 

                  "nn";

  





 }

   $email_text .= EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;

// ICW - CREDIT CLASS CODE BLOCK ADDED  ******************************************************* END

   tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

And then in catalog/includes/add_ccgvdc_application_top.php you have this where you can turn it on and off as well as set the dollar amount:

 

// The settings below determine whether a new customer receives an incentive when they first signup

//

// Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none

 define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10');

//

// Set the coupon ID that will be sent by email to a new signup, if no id is set then no email :)

 define('NEW_SIGNUP_DISCOUNT_COUPON', '1');

 

Those settings were what I had used and made the first coupon ie. coupon_id="1" the New Sign Up Coupon.

Link to comment
Share on other sites

Thanks for the reply. I'm running a version of OS by Ian Wilson, and I think I have an earlier version.

 

Does anyone know if it is possible to upgrade maybe ??

Link to comment
Share on other sites

Ian would probably be the best one to ask as he is pretty familiar with the contribution. :) I would think you could just add this added functionality to your current set-up. If you can figure out what version of the GV you are using you can probably download both contributions and compare them to figure out what new items were added.

 

BTW, I goofed when I posted the part about turning the New Sign-Up discount on. If you put 10 and 1 or whatever in the add_ccgvdc_application_top.php you will send both a gift voucher as well as a coupon. :oops: It should be more like this if you just want to send a coupon only (really no sense in sending one of each):

 

// The settings below determine whether a new customer receives an incentive when they first signup 

// 

// Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none 

 define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '0'); 

// 

// Set the coupon ID that will be sent by email to a new signup, if no id is set then no email :) 

 define('NEW_SIGNUP_DISCOUNT_COUPON', '1');

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