Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Ok, about error number 2 I have added

define('MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR', 'Coupon Redemption');

to the catalog/includes/languages/add_ccgvdc_english.php and now It's not whowing the error message, but the looks like the "Congratulations, you have redeemed" message is not complete. What is wrong? anybody has any idea?

and still the discount amount is (Coupon amount+shipping fee).

 

Thank you

The USPS error is solved.

Regards,

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

Hi guys,

 

im still having the same problem i was before, i install CCGV and then my main page comes up blank and my admin page the same, how do i solve this? i was told i could solve it by copying the general.php files from the previous versions so i downloaded them and no general.php files are in there. Im now stuck, i need this to work, any help please?

Edited by n1codemus
Link to comment
Share on other sites

Hi,

 

Firstly, big thanks to all who have been involved in making this contribution - it's fantastic.  I hope that the information below helps in making it even better.

 

I am using the latest versions of all the files for this contrib on MS2.2.

 

Firstly, there is a small ommission of the ICW comment string in the includes/boxes/shopping_cart file.  There is some Javascript at the start that makes the popup_coupon_help work:

 

<!-- shopping_cart //-->
<script language="javascript"><!--
function couponpopupWindow(url) {
?window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
eft=150')
}
//--></script>

 

That will fix the problem for anyone who has been wondering why the popup does nothing (and generates an error).

 

Next, I have also made some other changes to this file.  Using this code, instead of having

 

"coupon: more info"

 

in the shopping cart infobox, you will have:

 

"coupon: (name of coupon you entered in admin)

more info"

 

To me this makes more sense, but that's a matter of opinion.  Here is the code for includes/boxes/shopping_cart:

 

Find ~line 90:

if (tep_session_is_registered('cc_id') && $cc_id) {
? ?$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
? ?$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

Replace with:

if (tep_session_is_registered('cc_id') && $cc_id) {
?$coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_id = '" . $cc_id . "'");
?$coupon = tep_db_fetch_array($coupon_query);
?$coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $cc_id . "' and language_id = '" . $languages_id . "'");
?$coupon_desc = tep_db_fetch_array($coupon_desc_query);
?$text_coupon_help = sprintf($coupon_desc['coupon_name']);
? ?$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());
? ?$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="infoBoxContents">' . CART_COUPON . $text_coupon_help . '<br>' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

Next, I have some other issues to note.  I don't know how many of these are specific to my shop (other contribs conflicting?), but hopefully others can reproduce them and we can fix them!

 

I don't know if any of these have to do with the fact that I am using  register_globals off...is this contrib compatible with globals off?

 

Here are the problems I've encountered:

 

1) When you set the store to send out a Welcome Gift Voucher, even though you enter a Coupon Code, it still send out a randomly generated number, and not the code you enter.

 

2) If the voucher completely covers the cost of the cart, then credit_covers should be set to 1.  However, after echoing out credit_covers in the footer of of my checkout pages, I notice that it only gets set to 1 if you refresh the current page (e.g. checkout_payment) and not if you arrived at checkout_payment through a link.  For some reason the value is not being passed...

 

3) This may be caused by the same thing as above, but if you are at checkout_payment and you enter your coupon code, when you press redeem it sends you straight to checkout_confirmation.  But, the coupon has not been recognised.  When you go back (using the back button or links at the bottom of the page) and enter the coupon code again, you jump straight to the checkout_confirmation page again, but this time the coupon is recognised and the amount correctly deducted.

 

For the above, is it possible that when you enter the coupon code and press redeem that it refreshes the current page (displaying the coupon amount in the shopping_cart infobox) and the user has to press the 'continue' button, to make it consistent with all the other shopping cart pages?  At the moment this also means that the user has no opportunity to enter any comments about their order...

 

Nearly finished...

 

4) Once a coupon is redeemed, the value is deducted whether or not the "use gift voucher account balance" tickbox is selected or not.  It seems to ignore it.

 

Finally,

 

5) If you have a gift voucher balance, and you try to buy more gift vouchers, it screws up the payment modules.  Firstly, the Cash on Delivery payment module disappears, and secondly, I am using the CVV contribution and it causes it to bypass its usual card number checking procedures (amongst other things).

 

That's it!

 

Hopefully these problems are limited to my store, and even more hopefully others have experienced (and fixed) the same problems and can help me out.

 

I'm not lazy - I'm just not programmer, but I am going to offer help in return by fixing all the spelling and grammar issues present, and I will have a crack at rewriting the documentation.

 

Thanks in advance.

-Christian

Hi

I did all the above changes but the more info link is still not working. Any one found any solution for that?

Thanks

Regards,

Link to comment
Share on other sites

hey Jan,

 

did you manage to correct the extra lines in the configuration section that were in french ?

If not then you are probably going to have to use SQLAdmin through your host control panel, or whatever else you can use to edit the database, of course BACKUP; your database first, if you are a little unsure of how to do that, if you browse the configuration table, and REMOVE the french entries from there, then you should be fine...

 

regards

John.

Link to comment
Share on other sites

Hey Jan,

 

I know I was telling you how to remove the french info from the configuration table, I just read the forum incorrectly... sorry 'bout that...

 

ermmm... I have an issue hopefully someone can help me with... in the forum there is a post that say replace the javascript code for the popup window, and it will fix the error and the fact that nothing happens.. well the 'fix' didn't fix that problem for me...

 

this is what I had originally

 

$cart_contents_string ="

<script language=\"javascript\">

function couponpopupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//--></script>";

 

 

I tried replacing that with

 

<!-- shopping_cart //-->

<script language="javascript"><!--

function couponpopupWindow(url) {

window.open(url,'popupWindow',& #39;toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//--></script>

 

but this didn't work, I noticed that the 2nd line of the fix was

<script language="javascript"><!--

 

when in fact to get around a string error showing onscreen, it should've been

<script language=\"javascript\"><!--

 

 

however.. even this did not work.. the error of T_STRING disappeared, but the coupon more info popup still did nothing, and error showed in IE...

 

hmmmmmmmmmmm...

 

anyone ?

Link to comment
Share on other sites

New error I've found:

 

It seems that CCGV cannot calculate Tax Classes with 2 different rates.  I have an Ontario store so I need to collect 8% tax in Ontario and 7% tax for all of canada.  It re-calculates the tax when it only has to deal with one tax class, but it doesn't work if it has to deal with the two tax classes.

 

Go here and you'll see what I'm talking about if you follow the instructions for your store (not a contribution file, just set up notes).

Out of curiosity, why are you recalculating taxes for a Canadian store? GST/HST/PST are calculated on the price before any discounts are applied. So, taxes shouldn't be recalculated for taxable sales.

 

~James

Link to comment
Share on other sites

Out of curiosity, why are you recalculating taxes for a Canadian store?  GST/HST/PST are calculated on the price before any discounts are applied.  So, taxes shouldn't be recalculated for taxable sales.

 

~James

Well, unless you're going to give the customer a break and cover the difference in the taxes you must remit yourself that is.

 

~James

Link to comment
Share on other sites

Just installed the contrib and after having some problems with the dubble functions etc it is now sort a working and I am looking forward to the results as I think it is a great contrib to my store.

 

But I have a question

 

After the customer inserts the code at checkout_payment.php the page reloads with the message "Coupon redemption"

I want it to go directly to checkout_confirmation.php after the code is inserted and only if there is a problem let it show up the same page and mention why it does so.

 

I believe to many steps will loose customers and also it is very unclear as it shows again the coupon boxes etc and if you enter the coupon code again it will show you the same page again after submitting the form and it possibly will get a customer in a loop :) ...

 

Regards,

Edwin

Link to comment
Share on other sites

Hey Jan,

 

I know I was telling you how to remove the french info from the configuration table, I just read the forum incorrectly... sorry 'bout that...

 

ermmm... I have an issue hopefully someone can help me with... in the forum there is a post that say replace the javascript code for the popup window, and it will fix the error and the fact that nothing happens.. well the 'fix' didn't fix that problem for me...

 

this is what I had originally

 

  $cart_contents_string ="

<script language=\"javascript\">

function couponpopupWindow(url) {  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//--></script>";

I tried replacing that with

 

<!-- shopping_cart //-->

<script language="javascript"><!--

function couponpopupWindow(url) {

window.open(url,'popupWindow',& #39;toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//--></script>

 

but this didn't work, I noticed that the 2nd line of the fix was

<script language="javascript"><!--

 

when in fact to get around a string error showing onscreen, it should've been

<script language=\"javascript\"><!--

however.. even this did not work.. the error of T_STRING disappeared, but the  coupon more info popup still did nothing, and error showed in IE...

 

hmmmmmmmmmmm...

 

anyone ?

Hi

Yes I still have the same problem. I have used these other code too but not useful.

Still waiting for a resolution for this.

Regards,

Link to comment
Share on other sites

Here what I have in my store right now. When my Cart is empty, the more info link works just fine and there is no error message in the status bar. but when I add a item to the cart I get the error again.

 

Here is the Javascript code I'm using in my catalog/includes/boxes/shopping_cart.php file:

  $cart_contents_string ="
<script language=\"javascript\">
function couponpopupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
eft=150')
}
//--></script>";

 

I think that will help anyone who knows more programing to solve the problem.

 

Looking forward to hear good news.

Regards,

Link to comment
Share on other sites

Hi

Yes I still have the same problem. I have used these other code too but not useful.

Still waiting for a resolution for this.

 

I think I have the problem sorted with the more info link for the shopping cart, looking at the code with fresh eye's this morning, I noticed that there is an error in the code, or at least, there seemed to be (I'm not up to speed woth PHP)...

 

look just below the javascript code, there is an IF statement...

 

this is the original code:

 

// $cart_contents_string = '';

// ############ End Added CCGV Contribution ##########

if ($cart->count_contents() > 0) {

// ############ Added CCGV Contribution ##########

$cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

$cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility

// ############ End Added CCGV Contribution ##########

 

 

Notice any difference between the two lines after the IF ?

 

I changed it to this:

 

// $cart_contents_string = '';

// ############ End Added CCGV Contribution ##########

if ($cart->count_contents() > 0) {

// ############ Added CCGV Contribution ##########

$cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

$cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility

// ############ End Added CCGV Contribution ##########

 

 

Notice the period ? (( $cart_contents_string .= ))

 

This worked for me...

 

hopefully it will work for you guys too..

Link to comment
Share on other sites

Also.... did anyone find how to remove the INACTIVE COUPONS ?

 

if you hit delete, it jumps to the active coupons to confirm, I will look at the logic, and try to get my head around the code, otherwise for quickness, I guess I will just dump the inactive coupons from the database backend manually... not ideal.. but...

 

regards

John.

Link to comment
Share on other sites

I think I have the problem sorted with the more info link for the shopping cart, looking at the code with fresh eye's this morning, I noticed that there is an error in the code, or at least, there seemed to be (I'm not up to speed woth PHP)...

 

look just below the javascript code, there is an IF statement...

 

this is the original code:

 

//  $cart_contents_string = '';

// ############ End Added CCGV Contribution ##########

  if ($cart->count_contents() > 0) {

// ############ Added CCGV Contribution ##########

    $cart_contents_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

    $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility

// ############ End Added CCGV Contribution ##########

Notice any difference between the two lines after the IF ?

 

I changed it to this:

 

//  $cart_contents_string = '';

// ############ End Added CCGV Contribution ##########

  if ($cart->count_contents() > 0) {

// ############ Added CCGV Contribution ##########

    $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

    $cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility

// ############ End Added CCGV Contribution ##########

Notice the period ? (( $cart_contents_string .= ))

 

This worked for me...

 

hopefully it will work for you guys too..

Excellent.

It is working just fine now. Thanks to your fresh looking eyes man. :thumbsup:

Regards,

Link to comment
Share on other sites

Excellent.

It is working just fine now. Thanks to your fresh looking eyes man.  :thumbsup:

 

Guys,

 

That was originally my post re: the Javascript and the reason that it doesn't work properly is because for some reason one of the quotation marks came out as the ASCI code (')...

 

The Javascript should read:

 

<script language="javascript"><!--
function couponpopupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
eft=150')
}
--></script>

 

Note the change just after 'popupWindow'.

 

-Christian

Link to comment
Share on other sites

Oh! It's bloody done it again - must be something to do with the length of that line of code and the way the message board breaks the text...

 

Let me try again. It should be:

 

<script language="javascript"><!--
function couponpopupWindow(url) {
window.open(url,'popupWindow','toolbar=no,
location=no,
directories=no,
status=no,
menubar=no,
scrollbars=yes,
resizable=yes,
copyhistory=no,
width=450,
height=280,
screenX=150,
screenY=150,
top=150,
left=150')
}
--></script>

 

(but without all the carriage returns - hope everyone knows what I mean...)

Link to comment
Share on other sites

Oh!  It's bloody done it again - must be something to do with the length of that line of code and the way the message board breaks the text...

 

Let me try again.  It should be:

 

<script language="javascript"><!--
function couponpopupWindow(url) {
window.open(url,'popupWindow','toolbar=no,
location=no,
directories=no,
status=no,
menubar=no,
scrollbars=yes,
resizable=yes,
copyhistory=no,
width=450,
height=280,
screenX=150,
screenY=150,
top=150,
left=150')
}
--></script>

 

(but without all the carriage returns - hope everyone knows what I mean...)

 

 

The javascript was not the problem, it was the code of the IF statement below which missed a period... even your javascript with the quote, which I assumed it was, didn't fix the issue, it just doesn't work if there is something in the cart, the reason for this was the incorrect syntax of the IF statement.. nothing to do with the javascript!

 

John.

Link to comment
Share on other sites

The javascript was not the problem, it was the code of the IF statement below which missed a period... even your javascript with the quote, which I assumed it was, didn't fix the issue, it just doesn't work if there is something in the cart, the reason for this was the incorrect syntax of the IF statement.. nothing to do with the javascript!

 

John.

 

Yeah - but it's still nice to see it put right :rolleyes:

Link to comment
Share on other sites

Hey,

 

I have just updated to the latest versions of all the files and the contribution is great. Well done!

 

However, I'm having two really annoying little problems that I suspect are quite individual to my store (I have register_globals off and use ob_start and ob_end_flush on all my pages... long story), but I'm hoping that someone else out there might have come across the same things;

 

1) On the checkout_payment screen you enter the redeem code: fine. The error message reporting is all working fine and you get a message saying 'congrats - successful'. But, it doesn't update and appear in either the shopping cart infobox or the following checkout_confirmation screen. But if you enter the code a second time - BAM. It works and updates on both. It NEVER works the first time, only every subsequent time after that.

 

2) The other problem is that I have a very thin area of active rollover (the same as the radio button payment option rollovers) just above my 'enter you redeem code' box. I can't seem to get rid of it...

 

Anyone else out there experienced/fixed either of the above?

 

Thanks in advance,

Christian

Link to comment
Share on other sites

Hi,

 

This is a re-post to the correct contrib thread.

 

I need to limit the coupon usage for specific products (around 512 items).

It looks like CC&GV does not support this large quantity.

 

I altered the database (table ?coupon? > field ?restrict_to_products? to TEXT type) to hold more than 255 char.

 

However, when I apply coupon, it does not deduct from the total as if there is no coupon.

 

When I try using no restriction on product items, it works.

 

All product IDs are separated with commas like 505470 , 505475 , 505476 , 505477 , 505481 , 505482 , 505483 , 505484 , 505485 , 505487,...

 

Any suggestions?

Is there a limitation for the 'restrict_to_products' array in the code?

or anybody successfully used this contrib w/ large quantities?

 

I am using the current version 5.13d.

Thank You,

OnuR

Link to comment
Share on other sites

Onar,

 

I am having the same problem, only I can't seem to be able to make ANY coupon restrictions, it only works when it is set to all products and all categories. So if you figure something out, please let me know. Or if you can already use the coupon on just a few products, could you tell me how you got that working? I've tried everything I can think of, but I'm not really a coder.

 

If anyone else has run into this problem where they cannot restrict the coupons by category or product, can you please let me know how you fixed it? Thanks!!

 

 

PrintCoach,

 

As far as I could tell, there were some security issues with sending all the data over at once (depending on which payment modules you are using). Anyway, I can't solve your problem, but what I did with the same thought in mind was to move the coupon box to the top of the page. That way, they can redeem the coupon and then put in payment information. I also added a note in the coupon box asking them to redeem the coupon first before continuing. It doesn't solve the number of clicks problem, but it does make the page less confusing and easier to use, which is almost as good.

 

Just a thought,

Adrienne

Link to comment
Share on other sites

Hello All,

 

My catalog produces this error:

Warning: main(includes/add_ccgvdc_application_top.php): failed to open stream: No such file or directory in /var/www/test/catalog/includes/application_top.php on line 604

 

Fatal error: main(): Failed opening required 'includes/add_ccgvdc_application_top.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test/catalog/includes/application_top.php on line 604

 

And I get this in the admin:

 

Warning: main(includes/languages/add_ccgvdc_english.php): failed to open stream: No such file or directory in /var/www/test/catalog/admin/includes/languages/english.php on line 365

 

Fatal error: main(): Failed opening required 'includes/languages/add_ccgvdc_english.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test/catalog/admin/includes/languages/english.php on line

 

But all the "Missing" files are present.

anyone have some ideas for me.

 

thanks

rudy

Link to comment
Share on other sites

I've searched through the first 10 or so pages (most recent) of this thread but found no reference to an issue that I'm having. I'm hoping that someone can point me in the right direction as far as a fix goes or offer up any other advice that might help:

 

Quite simply, some of my client's customers are able to re-use Gift Vouchers on multiple orders. They are simply entering the same redeem code (on the checkout payment page) that they received in an email.

 

Any leads on this issue are greatly appreciated.

cxdi_logo_100x45.gif
Link to comment
Share on other sites

hey Jan,

 

did you manage to correct the extra lines in the configuration section that were in french ?

If not then you are probably going to have to use SQLAdmin through your host control panel, or whatever else you can use to edit the database, of course BACKUP; your database first, if you are a little unsure of how to do that, if you browse the configuration table, and REMOVE the french entries from there, then you should be fine...

 

regards

John.

 

 

Yes I've completely removed all french from my SQL Db and readded the french ones, but thanks for your advice, others may benefit from it too I hope if they read the posts for that problem.

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