Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

I'm trying to wrap my mind around how the gift voucher system works. Specifically, how end users purchase them. Do I have to set up gift voucher 'products' in the amounts I wish to offer GVs for? Do customers then pruchase those products, which the admin then uses the Vouchers/Coupons > Mail Gift Voucher section of the admin section to mail the voucher to the proper party? What's the workflow for this?

 

I feel so silly asking this, but I couldn't find any docs on the matter in the latest version of the contribution.

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

@molafish, shanejackson, primadude, and other gv/coupon hackers:

 

I have a question about the order_totals sequence, and am asking here since it is more germane to the gv/coupon code than to any other contribs, or the osC base.

 

The order of the various ot_[modules] is painfully particular.

 

I think that there is a problem where because the ot_tax module must come first, that when the tax is recalculted the $GLOBALS['ot_tax']->output[*] is still not updated, and when the totals are printed on the checkout_confirmation.php page the tax is displayed incorrectly despite the fact that the total is correct, and the correct figures get written into the db.

 

Is there a function or a class that exists or is brewing in any of your minds that will allow for a "safe" update of the various order_total classes?

 

If there is and I am missing it, forgive me. I have not completely dissected the gv/coupon code (!). If not, maybe we could start another thread about this.

 

Bottom line is that there should be a way for order total module X to say, "if order total modules A, B, or C are enabled, please update them after me."

 

Or maybe there is a way to auto-arrange the modules... ot_module_X might be able to specify that ot_module_A needs to both ->process() before and ->re-process() after ot_module_X.

 

--gabe

Link to comment
Share on other sites

@molafish, shanejackson, primadude, and other gv/coupon hackers:

 

I have a question about the order_totals sequence, and am asking here since it is more germane to the gv/coupon code than to any other contribs, or the osC base.

 

The order of the various ot_[modules] is painfully particular.

 

I think that there is a problem where because the ot_tax module must come first, that when the tax is recalculted the $GLOBALS['ot_tax']->output[*] is still not updated, and when the totals are printed on the checkout_confirmation.php page the tax is displayed incorrectly despite the fact that the total is correct, and the correct figures get written into the db.

 

Is there a function or a class that exists or is brewing in any of your minds that will allow for a "safe" update of the various order_total classes?

 

If there is and I am missing it, forgive me. I have not completely dissected the gv/coupon code (!). If not, maybe we could start another thread about this.

 

Bottom line is that there should be a way for order total module X to say, "if order total modules A, B, or C are enabled, please update them after me."

 

Or maybe there is a way to auto-arrange the modules... ot_module_X might be able to specify that ot_module_A needs to both ->process() before and ->re-process() after ot_module_X.

 

--gabe

 

Nice one, saying that anyone trying to help is hacker.

 

Maybe read the forum and the instructions.

Link to comment
Share on other sites

@godino1

 

The code is not in the shopping_cart class but rather in the checkout_shipping.php file

 

At the top of that file you will find something like this:

 

  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'));
 }

 

Which checks to see if there is any weight and if the product is a download, and it then skips shipping. Of course, those settings are created by the calculate() function in the shopping_cart.php class

 

@Coopco

 

http://en.wikipedia.org/wiki/Hacker

 

"...one who knows a (sometimes specified) set of programming interfaces well enough to write software rapidly and expertly."

 

--gabe

Edited by ganast
Link to comment
Share on other sites

@godino1

 

The code is not in the shopping_cart class but rather in the checkout_shipping.php file

 

At the top of that file you will find something like this:

 

  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'));
 }

 

Which checks to see if there is any weight and if the product is a download, and it then skips shipping. Of course, those settings are created by the calculate() function in the shopping_cart.php class

 

@Coopco

 

http://en.wikipedia.org/wiki/Hacker

 

"...one who knows a (sometimes specified) set of programming interfaces well enough to write software rapidly and expertly."

 

--gabe

 

 

Thanks for explaining it to me m8

Link to comment
Share on other sites

Some additional information... the "blank page" that I receive has a fatal error in the view source that might help someone give us some insight on the problem.

 

Here is the code of that page

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Welcome in your Family Support Network Store shop</title>
<base href="http://familysupport.net/store/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
var selected;
var submitter = null;
function submitFunction() {
  submitter = 1;
  }
function selectRowEffect(object, buttonSelect) {

 // #################### Begin Added CGV JONYO ######################
 if (!document.checkout_payment.payment[0].disabled){
 // #################### End Added CGV JONYO ######################
if (!selected) {

if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
} else {
  selected = document.all['defaultSelected'];
}
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_payment.payment[0]) {
document.checkout_payment.payment[buttonSelect].checked=true;
 } else {
document.checkout_payment.payment.checked=true;
 }
// #################### Begin Added CGV JONYO ######################
 }
// #################### End Added CGV JONYO ######################
}

function rowOverEffect(object) {

 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}


<br />
<b>Fatal error</b>:  Call to a member function on a non-object in <b>/home/susanl/public_html/store/checkout_payment.php</b> on line <b>174</b><br />

 

It appears this is the line 174 in checkout_payment.php

$testing=$GLOBALS['ot_gv']->mod_process();

Edited by arkitekt
Link to comment
Share on other sites

Man, i'm sorry guys for multiple posts but I am discovering things as I go along... I didn't think I needed Gift Vouchers in the order total since I was planning on just using discounts but apparently that was the problem... when I install the Gift Vouchers in Order Total I get the checkout_payment.php page loading...

 

now my next issue will just be checking out why I'm getting this info in the payment area:

 

MODULE_PAYMENT_PAYPAL_CC_TEXT

MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION MODULE_PAYMENT_PAYPAL_CC_URL_TEXT

Link to comment
Share on other sites

Some additional information... the "blank page" that I receive has a fatal error in the view source that might help someone give us some insight on the problem.

 

Here is the code of that page

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Welcome in your Family Support Network Store shop</title>
<base href="http://familysupport.net/store/">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
var selected;
var submitter = null;
function submitFunction() {
  submitter = 1;
  }
function selectRowEffect(object, buttonSelect) {

 // #################### Begin Added CGV JONYO ######################
 if (!document.checkout_payment.payment[0].disabled){
 // #################### End Added CGV JONYO ######################
if (!selected) {

if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
} else {
  selected = document.all['defaultSelected'];
}
 }

 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;

// one button is not an array
 if (document.checkout_payment.payment[0]) {
document.checkout_payment.payment[buttonSelect].checked=true;
 } else {
document.checkout_payment.payment.checked=true;
 }
// #################### Begin Added CGV JONYO ######################
 }
// #################### End Added CGV JONYO ######################
}

function rowOverEffect(object) {

 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}

function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
<br />
<b>Fatal error</b>:  Call to a member function on a non-object in <b>/home/susanl/public_html/store/checkout_payment.php</b> on line <b>174</b><br />

 

It appears this is the line 174 in checkout_payment.php

$testing=$GLOBALS['ot_gv']->mod_process();

 

 

 

Comment out lines 174 and 175.

 

 

$testing= $GLOBALS['ot_gv']->mod_process();

$testing=$GLOBALS['ot_gv']->my_output[0];

 

hopefully your page should load

Link to comment
Share on other sites

Man, i'm sorry guys for multiple posts but I am discovering things as I go along... I didn't think I needed Gift Vouchers in the order total since I was planning on just using discounts but apparently that was the problem... when I install the Gift Vouchers in Order Total I get the checkout_payment.php page loading...

 

now my next issue will just be checking out why I'm getting this info in the payment area:

 

MODULE_PAYMENT_PAYPAL_CC_TEXT

MODULE_PAYMENT_PAYPAL_CC_DESCRIPTION MODULE_PAYMENT_PAYPAL_CC_URL_TEXT

 

Thats because in this contribution it doesn't supply the language file

Link to comment
Share on other sites

Has anyone had or got the same problem i'm getting in the coupon_admin.php this part doesn't load up on page what is the problem? does anyone know?

 

<td align="left" class="main"><?php echo COUPON_STARTDATE; ?></td>

<td align="left"><?php echo tep_draw_date_selector('coupon_startdate', mktime(0,0,0, $coupon_startdate[1], $coupon_startdate[2], $coupon_startdate[0], 0)); ?></td>

<td align="left" class="main"><?php echo COUPON_STARTDATE_HELP; ?></td>

</tr>

<tr>

<td align="left" class="main"><?php echo COUPON_FINISHDATE; ?></td>

<td align="left"><?php echo tep_draw_date_selector('coupon_finishdate', mktime(0,0,0, $coupon_finishdate[1], $coupon_finishdate[2], $coupon_finishdate[0], 0)); ?></td>

<td align="left" class="main"><?php echo COUPON_FINISHDATE_HELP; ?></td>

</tr>

<tr>

<td align="left"><?php echo tep_image_submit('button_preview.gif',IMAGE_PREVIEW); ?></td>

<td align="left"><?php echo '  <a href="' . tep_href_link('coupon_admin.php', ''); ?>"><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a>

</td>

</tr>

</td></table></form>

</tr>

 

</table></td>

 

 

Please help me out here

Link to comment
Share on other sites

Wish I could help you godino1... not sure about your error I'm new to this contribution.

 

I am noticing that my other problem with this contribution is there seems to be a missing language file for the Paypal module (not IPN) which creates extra define text items that don't have descriptions.

Link to comment
Share on other sites

Help, newbie Question:

 

Installation steps are provided only for a fresh installation of oscommerce. However, I have already had oscommerce installed, what is the best way to add this mod? Just replace those files with the ones in the zip?

 

Are there any additional DB Table? how to add them?

 

thank you.

 

is this the right thread to post Questions like this? thank you.

Edited by henryho
Link to comment
Share on other sites

Hello. I hope someone can help me with this. I'm getting this error on checkout_payment.php:

 

Warning: Missing argument 1 for javascript_validation() in /nfs/cust/3/97/04/640793/web/catalog/includes/classes/payment.php on line 84

 

And when I go see what's on line 84, this is what I see:

 

'function check_form() {' . "\n" .

Edited by sturmdogg
Link to comment
Share on other sites

Hello. I hope someone can help me with this. I'm getting this error on checkout_payment.php:

 

Warning: Missing argument 1 for javascript_validation() in /nfs/cust/3/97/04/640793/web/catalog/includes/classes/payment.php on line 84

 

And when I go see what's on line 84, this is what I see:

 

'function check_form() {' . "\n" .

 

Ok, I cant find the edit button, so I have to reply to my own post:

 

Seems like the problem is with the linkpointconnect 1.1 module. This is the original line in the CCGV checkout_payment.php page:

 

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>

 

And this is what the readme.txt file from the linkpoint module tells me what the line should read:

 

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL', false), 'post', 'onsubmit="return check_form();"'); ?>

 

Seems like the additional "false" after 'SSL' triggers the error (and prevents the discount module to appear ).

 

Anyone know how to fix this?

Link to comment
Share on other sites

Help, newbie Question:

 

Installation steps are provided only for a fresh installation of oscommerce. However, I have already had oscommerce installed, what is the best way to add this mod? Just replace those files with the ones in the zip?

 

Are there any additional DB Table? how to add them?

 

thank you.

 

is this the right thread to post Questions like this? thank you.

 

Been said before and will no doubt be said again ;) A file-comparing thing will help you loads, Beyond Compare is excellent and well worth the money as one can compare folders and files via ftp as well as locally. What I do is have a server installed here on my laptop, I used xampp for this, very neat package, though there are others. I install a 'clean' version of oscommerce, install the contribution, make sure it works OK as far as I can (still need to suss out getting it to send emails without connecting it to the 'net) then use the comparison program to copy the relevant changes to the right bits of the files on the copy of the 'live' shop that I also have on the local server, (just don't change the 'configure.php' files!!) make sure that works, then again with the comparison program to upload the changes to the real shop. I might be the only one who's so long-winded about it, mind you!!

 

Database edits are done by using the .sql file(s) in the contribution folder(s) in the sql admin program on your site's control panel, mine's phpMyAdmin.

 

HTH :)

Link to comment
Share on other sites

I get this error message in checkout_payment.php:

 

Warning: Missing argument 1 for javascript_validation() in /kunden/84737_51427/webseiten/pizzacompany/shop1/includes/classes/payment.php on line 82

 

Can anybody help me?

Link to comment
Share on other sites

Hello there, shanejackson

 

You say your working on a new version how far is this from being released?

 

 

Hi,

 

Let me first say - I am not actualy working on the new version. No credit to me for that.

 

That said, there is a new release being worked on. No Idea on the release date. As molafish has said, every time he fixes 1 bug he finds 3 more........

 

Hopefully a release is not too far away. However, I would rather wait another month and see a rock solid release than a buggy one (Im sure most would agree).

Link to comment
Share on other sites

Hello, I am hoping to get some help with the redemption part of the gift voucher / discount coupon contribution.

 

The scenario is this:

 

When i get to the payment section, the customer has a choice to enter in credit card info, gift voucher/discount code, etc. If the customer just enter the code and clicks redeem, they are presented with a credit card error javascript message. (even though the redemption will still work).

 

If they enter all the info on the screen such as credit card number and discount coupon, and then click redeem, they get the redemption, but then are being taken back to the exact same screen so they will have to enter their credit card number again, and they also may be confused on whether or not they will need to enter the discount code again.

 

I assume this must be happening to all of you guys with this contribution installed. Is there a fix out there for this to make it easy for the customer to know how to redeem their discount code.

 

Thanks for your help.

 

Liquido :o

Link to comment
Share on other sites

Got everything installed (not easy with all of the purchase-without-account mods and such), and it seems to work so far, but the coupon redemption box is formatted weird. It's the one titled 'Credits Available' and has the text about 'Enter code below'. That text is on the right side, entry blank is on the left below it, and the Redeem button is below that. Works OK, looks ugly. What am I doing wrong?

Link to comment
Share on other sites

Just completed CCGV5.15a2 - clean install

 

 

I've been working on installing this CCGV for a month. I have to say that 5.15a2 is the best version yet. I only have 1 error.

 

Can someone give me a quick fix for this... The currency has changed to Euro's.

 

I did the admin - configuration - default currency button. The problem is that I cannot get back to US dollars at all.

 

Any suggestions?

 

Kym

Link to comment
Share on other sites

Been said before and will no doubt be said again ;) A file-comparing thing will help you loads, Beyond Compare is excellent and well worth the money as one can compare folders and files via ftp as well as locally.

 

It's been said before but is still a very clumsy and long-winded solution to the problem, especially for those with a lot of mods already installed as the highlighted differences can be huge in some cases and sorting through them, especially for novices, can be a big task.

 

Amazing for such a big and popular contribution that nobody has written a simple guide with the changes listed as most of the better mods have. I may try giving it a go myself if I can find some time as it so badly needs doing.

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