Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Hi all,

I have installed 5.13 and when trying to redeem a gift voucher I get

 

MODULE_ORDER_TOTAL_GV_TEXT_ERROR <-- This as a title

ERROR_REDEEMED_AMOUNT$120.00 <-- This in the box

 

And I can not see any purchase voucher in the vouchers queue in admin... any ideas how I can fix this?

 

Alex

seems as you may have missed to copy the language files to your folder.

regards,

unai

"Dream as if you'll live forever...

live as if you'll die today."

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

seems as you may have missed to copy the language files to your folder.

regards,

unai

Hi Guys,

 

My total is not adding up. This is my checkout_confirm. page

 

Table Rate (Best Way): 4.57EUR

alc & cigars: 2.52EUR

Sub-Total: 15.76EUR

Total: 20.33EUR

 

The alc & cigar rate is not added. And this is my tax rate priority table

 

Priority Tax Class Zone Tax Rate Action

1 Alc & Cigars 19%

0 others 12%

1 paym fees 3%

 

 

I shoved the priority table up and down so much and still can't get it right. I'll just like to have the 2.52eur and the 3% paym fees (which does not even appear anywhere at the moment) to be added to the total. This is my order_total which I asume is fine:

 

Discount Coupons 9

Gift Vouchers 740

Low Order Fee

Shipping 3

Sub-Total 1

Tax 6

Total 800

 

My apologies if tax priority setting had been dealt with here but I have not been able to find it clearly define anywhere in the forum. Flipping frustrating!

Anyone online knows the trick? Ever so grateful.

 

Many thanks,

Rich

Link to comment
Share on other sites

THnks quentin, that was it!!!!

however if you want to have the error displayed as a box insteasd an url as modified in 5.13....you would have to change:

 

     if ($HTTP_POST_VARS['submit_redeem_x'] && $gv_result['coupon_type'] == 'G') tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL'));

 

to....

 

  
if ($HTTP_POST_VARS['submit_redeem_x'] && !$HTTP_POST_VARS['gv_redeem_code']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' .$this->code.'&error=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL')); }

 

and thats it.

 

thanks all

regards,

unai

 

Please note that while you can make the "&& $HTTP_POST_VARS['gv_redeem_code']" modification on older version than v5.13, the new way to display alarm (in fact it's not the new way, it's the correct MS way!) :

'payment_error=' .$this->code.'&error=' ....

involves modifications in modules too, so for the alarms to work correctly, you MUST look at v5.13.

For PopTheTop: one of your module is probably missing the get_error() function, or the "payment_error=" refers to an unexisting module.

 

- Rigadin

Link to comment
Share on other sites

hey all

I'm still using ccgv510c, the bug fix version...

 

My main problem right now is that a 10% discount coupon on a specific item is only applying the 10% discount to the shipping, not the actual product. Anyone run across this? Has it been addressed in the newer version?

The install doc doesn't cover upgrading to 513 so not sure how to proceed. My store has many other contribs so I need to be careful...

thanks, bopp

 

v5.13 is quite new, can't be 100% sure that it works for everybody and in fact alienation2005 has same problem but i don't know which version he is using.

 

For the upgrade question, I have not made any doc because I have no time for this boring work and there is a faster and easier way to do:

the contribution is packed with original MS2 files + the CCGV modifications to do. By using a comparison tool (like Beyond Compare 2 from Scooter Software) that allows to see clearly all differences in 2 parallel windows and to make the update line by line or file by file. You can also compare your offline project with your online project (FTP).

Personnally I can't think working without such a tool!

 

- Rigadin

Link to comment
Share on other sites

Can anyone help me with this email problem? I have been running this contribution for some time and it works great. But I have sent out numerous coupons and have recently been informed that they were never received! It seems to be primarily web based email accoutns that are having the difficulty any reason??

 

I am on a windows server and have the email options configured as follows:

 

E-Mail Transport Method smtp

E-Mail Linefeeds CRLF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

 

 

 

I am sednign out a mohters day copoun and want to make sure everyone gets it!

Link to comment
Share on other sites

Can anyone help me with this email problem? I have been running this contribution for some time and it works great. But I have sent out numerous coupons and have recently been informed that they were never received! It seems to be primarily web based email accoutns that are having the difficulty any reason??

 

I am on a windows server and have the email options configured as follows:

 

E-Mail Transport Method  smtp 

E-Mail Linefeeds              CRLF 

Use MIME HTML When Sending Emails      true 

Verify E-Mail Addresses Through DNS      false 

Send E-Mails        true 

I am sednign out a mohters day copoun and want to make sure everyone gets it!

 

I had a problem sending e-mails for a while, it turns out my ip was on a ban list! I was using sendmail so this might not be the same issue for you.

 

I don't know how my ip got banned, I never spam or anything, and after bringing this to the attention of the isp, they looked into it and ended up un-banning me. The affect of being on the ban list meant that I never even got a bounce back, the e-mail simply disapeared.

 

So you might want to see if there are any simularities in who can't get your e-mails. Make sure they check their spam folder, because some filtering software sees something that looks like a coupon and they automatically think it is spam...

Link to comment
Share on other sites

I had a problem sending e-mails for a while, it turns out my ip was on a ban list!  I was using sendmail so this might not be the same issue for you. 

 

I don't know how my ip got banned, I never spam or anything, and after bringing this to the attention of the isp, they looked into it and ended up un-banning me.  The affect of being on the ban list meant that I never even got a bounce back, the e-mail simply disapeared.

 

So you might want to see if there are any simularities in who can't get your e-mails.  Make sure they check their spam folder, because some filtering software sees something that looks like a coupon and they automatically think it is spam...

 

I checked and I am not banned... suppose it could be spam blockers? But even when I email to myself I do not get them... to web based email accounts. Just can not figure it out and I do not want people to miss them :'(

Link to comment
Share on other sites

I checked and I am not banned... suppose it could be spam blockers? But even when I email to myself I do not get them... to web based email accounts. Just can not figure it out and I do not want people to miss them  :'(

 

 

Are you sending in HTML format? If so, try turning off HTML e-mail sending.

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

Are you sending in HTML format? If so, try turning off HTML e-mail sending.

 

 

Yes I have HTML emabled IO will try this thanks!

 

I am currently adding the update by Rigadin anyone know what language file I need to add the new file

 

catalog/includes/modules/payment/ccerr.php module + corresponding language files?

Link to comment
Share on other sites

Hello everyone!

I just installed 5.13 (upgraded from a really old version) and almost everything works perfectly.

The bug that is bothering me right now is this: If you create a discount coupon that is restricted to certain categories, it seems that the tax IS NOT recalculated after applying the discount (and yes, the tax recalculation is set to 'standard'). Like so:

 

Sub-Total: $13.00

Discount Coupons:test1234: -$1.30

Sales Tax: $0.91 (THIS IS WRONG!!!!!!!!!)

First-Class Mail: $2.60

Total: $15.21

 

However, if you create a coupon that has the same discount (10%) and do not restrict the categories, the tax is recalculated perfectly. And yes, the product being purchased is in one of the categories.

Later tonight I'll look at the specific code and hopefully post a fix. I just thought I'd let everyone know what I found first.

 

Regards,

Joseph

Link to comment
Share on other sites

I am currently adding the update by Rigadin anyone know what language file I need to add the new file

 

catalog/includes/modules/payment/ccerr.php module + corresponding language files?

 

Order total modules language files (for example ot_gv and ot_coupon for this contribution) are located here:

catalog\includes\languages\english\modules\order_total

 

Payment modules language files (for example ccerr) are located here:

catalog\includes\languages\english\modules\payment

 

Like that for each language installed.

 

- Rigadin

Link to comment
Share on other sites

I've got a problem I'm assuming is just something out of order somewhere. My coupons are including shipping in the discount price, and I don't want them to. Example, coupon is for 10% off, item cost is $10, shipping is $5, the coupon is calculated at $1.50 (10% of grand total, not subtotal).

 

Anybody know where to fix this?

 

-Matt

Link to comment
Share on other sites

I've got a problem I'm assuming is just something out of order somewhere.  My coupons are including shipping in the discount price, and I don't want them to.  Example, coupon is for 10% off, item cost is $10, shipping is $5, the coupon is calculated at $1.50 (10% of grand total, not subtotal).

 

Anybody know where to fix this?

 

-Matt

 

Nevermind, found the setting in the admin/modules

Link to comment
Share on other sites

Hello everyone,

Its time to fix some bugs:

First of all, the problem I mention with the tax not being deducted from products if they are in restricted categories:

To fix this, we replace line 258 in /includes/modules/order_total/ot_coupon.php

 

original:

$cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'");

 

New line:

$cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $t_prid . "' and categories_id = '" . $cat_ids[$c] . "'");

 

Also, if anyone is using a Tax Exempt Module, I can show them how to incorporate this module with the tax exempt one (if they are having trouble).

 

Hopefully more bug fixes to come....

Joseph

Link to comment
Share on other sites

Hello again,

This time there is a bug that double counts the percentage discount for products in subcategories if both the parent category and the subcategory are listed in the valid category list. Lets give an example so people understand:

 

This is the category tree:

 

Stuff (cat_id 1)

-More Stuff (cat_id 2)

-Even More Stuff (cat_id 3)

-Product X

 

Now if we have a valid category list that consists of: 1, 2, 3

Then any products in More Stuff or Even More Stuff will get discounted twice (for a 10% discount, each product actually gets a 20% discount).

This is BAD.

 

To fix this, we need to add/change the following lines to the /includes/modules/order_total/ot_coupon.php file

 

Original code around line 196

  $pod_amount = round($pr_c*10)/10*$c_deduct/100;
 $od_amount = $od_amount + $pod_amount;
} else {
 $od_amount = $c_deduct;
}

 

Modified code:

$pod_amount = round($pr_c*10)/10*$c_deduct/100;
$od_amount = $od_amount + $pod_amount;
 continue 3;      // Tanaka 2005-4-30: to prevent double counting of a product discount
} else {
 $od_amount = $c_deduct;
 continue 3;      // Tanaka 2005-4-30: to prevent double counting of a product discount
}

 

Only 2 new short lines are needed.

 

There is also a bug with the tax deduction. These tax deductions are only applied if the product is in one of the categories listed, not in a sub-category. Next post should show how to fix this.

 

Regards,

Joseph

Link to comment
Share on other sites

Hello once again,

This is the next bug fix. When calculating the correct tax deduction (when tax needs to be recalculated), if a product was in a valid subcategory, the discount applied but the tax was not deducted. This change in code fixes that.

 

Changes applied to /includes/modules/order_total/ot_coupon.php

around line 257

 

Original code:

if ($get_result['restrict_to_categories']) {
   $cat_ids = split("[,]", $get_result['restrict_to_categories']);
  for ($c = 0; $c < sizeof($cat_ids); $c++) {
      $cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'");
      if (tep_db_num_rows($cat_query) !=0 ) $valid_product = true;
  }
}

 

New code:

if ($get_result['restrict_to_categories']) {
   // Tanaka 2005-4-30:  Original Code
   /*$cat_ids = split("[,]", $get_result['restrict_to_categories']);
   for ($c = 0; $c < sizeof($cat_ids); $c++) {
       $cat_query = tep_db_query("select products_id from products_to_categories where products_id = '" . $products_id . "' and categories_id = '" . $cat_ids[$i] . "'");
       if (tep_db_num_rows($cat_query) !=0 ) $valid_product = true;
   }*/
   
   // Tanaka 2005-4-30:  New code, this correctly identifies valid products in subcategories
   $cat_ids = split("[,]", $get_result['restrict_to_categories']);
   $my_path = tep_get_product_path($t_prid);
   $sub_cat_ids = split("[_]", $my_path);
   for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
        for ($ii = 0; $ii < count($cat_ids); $ii++) {
             if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
                 $valid_product = true;
                 continue 2;
             }
        }
   }
}

 

Regards,

Joseph

Link to comment
Share on other sites

Hello again,

  This time there is a bug that double counts the percentage discount for products in subcategories if both the parent category and the subcategory are listed in the valid category list.  Lets give an example so people understand:

 

This is the category tree:

 

  Stuff (cat_id 1)

    -More Stuff (cat_id 2)

    -Even More Stuff (cat_id 3)

      -Product X

 

Now if we have a valid category list that consists of: 1, 2, 3

Then any products in More Stuff or Even More Stuff will get discounted twice (for a 10% discount, each product actually gets a 20% discount).

This is BAD.

 

  To fix this, we need to add/change the following lines to the /includes/modules/order_total/ot_coupon.php file

 

Original code around line 196

 ?$pod_amount = round($pr_c*10)/10*$c_deduct/100;
?$od_amount = $od_amount + $pod_amount;
} else {
?$od_amount = $c_deduct;
}

 

Modified code:

$pod_amount = round($pr_c*10)/10*$c_deduct/100;
$od_amount = $od_amount + $pod_amount;
?continue 3; ? ? ?// Tanaka 2005-4-30: to prevent double counting of a product discount
} else {
?$od_amount = $c_deduct;
?continue 3; ? ? ?// Tanaka 2005-4-30: to prevent double counting of a product discount
}

 

Only 2 new short lines are needed.

 

There is also a bug with the tax deduction.  These tax deductions are only applied if the product is in one of the categories listed, not in a sub-category.  Next post should show how to fix this.

 

Regards,

Joseph

 

 

I have 2 places that this code is at in this file, do I replace both or just one of them?

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

In the order_total.php 5.13 changes there is:

 

if (!tep_session_is_registered($post_var)) tep_session_register($post_var);
    	 // START modification for Credit Class v5.13 by Rigadin: have to register the new created variable as global cause we are in a function
    	 $post_var = $HTTP_POST_VARS[$post_var]; // Rigadin: does not work because not global variable
    	 // END modification v5.13
     }

 

Apart from the comments, I can't see any difference with 5.12 - am I missing something subtle?

Link to comment
Share on other sites

Me again....

 

 

from ot_gv.php

 

        // Amended line, was giving an error when a zero value was arriving here. v5.13 by Rigadin
       //$ratio1 = tep_round($od_amount / $amount,2);
       $ratio1= ($amout==0? 0 : tep_round($od_amount / $amount,2) );

 

Shouldn't "amout" be "amount"?

 

Quentin

Edited by cube
Link to comment
Share on other sites

Error in Checkout Success now that I have installed CCGV 5.13!

 

I installed the gift registry contribution(newest version) on a clean copy of osC and everything worked beautifully. Installed the CCGV newest version 5.13 yesterday (no other contributions installed) and all looked grand until the checkout success page. Instead of the usual confirmation that the order has been placed, etc. I receive a page with the following error:

 

Warning: Cannot modify header information - headers already sent by (output started at /mnt/web_b/d34/s37/b0229a75/www/babyandchild/nfoscomm/catalog/includes/classes/payment.php:210) in /mnt/web_b/d34/s37/b0229a75/www/babyandchild/nfoscomm/catalog/includes/functions/general.php on line 29

 

The order does go through but the customer never gets to see the checkout success page, just this error.

 

I have tried to locate something in the code that directs the process to go one way while another piece of code tells the process to do something else...I must be blind and really need some guidance. Any ideas?

Link to comment
Share on other sites

Me again....

from ot_gv.php

 

 ? ? ? ?// Amended line, was giving an error when a zero value was arriving here. v5.13 by Rigadin
? ? ? ?//$ratio1 = tep_round($od_amount / $amount,2);
? ? ? ?$ratio1= ($amout==0? 0 : tep_round($od_amount / $amount,2) );

 

Shouldn't "amout" be "amount"?

 

Quentin

 

 

I changed it to "amount" and now the tax will be recalculated. However, the recalculation of the tax proves a totally wrong result.

 

Zwischensumme: 99,00 ?

Gutscheine: 50,00 ?

Versandkosten (nach: DE : 4 kg): 6,70 ?

MwSt.: 1,56 ? (must be 7,68 ?)

Summe: 42,68 ?

 

Can somebody help?

Link to comment
Share on other sites

Do a search for "$god_amout" in ot_coupon.php

 

 

It should be in this section of code...

   	 while (list($key, $value) = each($order->info['tax_groups'])) {
     $god_amout=0;
     $tax_rate = tep_get_tax_rate_from_desc($key);
     $net = $tax_rate * $order->info['tax_groups'][$key];
     if ($net>0) {
    	 $god_amount = $order->info['tax_groups'][$key] * $get_result['coupon_amount']/100;
    	 $tod_amount += $god_amount;
    	 $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
     }
  	 }

 

 

I am assuming this should be changed as well to "$god_amount" as well?

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

Do a search for "$god_amout" in ot_coupon.php

It should be in this section of code...

 ? ?	while (list($key, $value) = each($order->info['tax_groups'])) {
? ? ?$god_amout=0;
? ? ?$tax_rate = tep_get_tax_rate_from_desc($key);
? ? ?$net = $tax_rate * $order->info['tax_groups'][$key];
? ? ?if ($net>0) {
? ? ?	$god_amount = $order->info['tax_groups'][$key] * $get_result['coupon_amount']/100;
? ? ?	$tod_amount += $god_amount;
? ? ?	$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
? ? ?}
? ?	}

I am assuming this should be changed as well to "$god_amount" as well?

 

 

The wrong recalculation of the tax takes place in the gift voucher module ot_gv.php, not ot_coupon.php.

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