Jump to content
Vger

[CONTRIBUTION] CCGV (trad)

Recommended Posts

I have created a coupon in admin but when I try to test it during checkout this is what happens:

 

I add a product to the cart and go to checkout.

I select a shipping method and click on Continue.

I select a payment amount and enter the coupon code in the redeem box and click Continue.

On the confirmation page, the discount does not appear, however, if I click the Back button and go back to the payment page, reselect a payment type and retype the coupon code and then click Continue, the discount does appear properly.

 

It is like there is a variable that is getting set out of order somewhere, I just can't find it.

 

Anyone have any suggestions or a fix for this?

 

Scott

Share this post


Link to post
Share on other sites
I have created a coupon in admin but when I try to test it during checkout this is what happens:

 

I add a product to the cart and go to checkout.

I select a shipping method and click on Continue.

I select a payment amount and enter the coupon code in the redeem box and click Continue.

On the confirmation page, the discount does not appear, however, if I click the Back button and go back to the payment page, reselect a payment type and retype the coupon code and then click Continue, the discount does appear properly.

 

It is like there is a variable that is getting set out of order somewhere, I just can't find it.

 

Anyone have any suggestions or a fix for this?

 

Scott

 

Hi Scott,

 

I think this is so sad because I also experience this and have asked for help and above this I notice others who have legitimate problems and the silence is deafening from those that could help us.

 

If you ever figure this out on your own please post it because I will be checking back occasionally to see if any answers are posted.

 

Merry Christmas

 

Laura

Share this post


Link to post
Share on other sites

To those who are seeking support here, Vger posted a while back that she will provide support for this contribution only via her web site at osc answers dot com. Give that site a go.

 

Cheers,

Max

Edited by maxxxie

Share this post


Link to post
Share on other sites
Hi Scott,

 

I think this is so sad because I also experience this and have asked for help and above this I notice others who have legitimate problems and the silence is deafening from those that could help us.

 

If you ever figure this out on your own please post it because I will be checking back occasionally to see if any answers are posted.

 

Merry Christmas

 

Laura

 

Don't know if this will work for everyone, but it certainly worked for me:

 

In includes/functions/sessions.php

if you find the following code

 

function tep_session_register($variable) {

global $session_started;

 

if ($session_started == true) {

if (PHP_VERSION < 4.3) {

return session_register($variable);

} else {

if (isset($GLOBALS[$variable])) {

$_SESSION[$variable] =& $GLOBALS[$variable];

} else {

$_SESSION[$variable] = null;

}

$GLOBALS[$variable] =& $_SESSION[$variable];

}

}

 

return false;

}

 

then replace it with

 

function tep_session_register($variable) {

global $session_started;

 

if ($session_started == true) {

return session_register($variable);

} else {

return false;

}

}

 

Haven't found any adverse effects yet but ... use at your own discretion

(my site is very, VERY heavily modded, so it may not apply to all)

Share this post


Link to post
Share on other sites

Hello,

 

first time on your Forum. I wish you all the best for this chritsmas time and for 2008.

 

3 Days ago I installed the CCGV(trad) contribution. Because it´s the first contribution I install, I just upload avery files of the contribution as well as the ones for the french translation.

 

Everything is working fine. The only thing that doesn't work is that after a cutomer bought a coupon (GIFT25 for example) it doesn´t appear in the queue for the admin.

 

I saw that a lot a person already experienced this problem but I couldn´t fin the solution.

 

Does someone knows where the problem is ?

 

Thanks a lot !

Hervé

Share this post


Link to post
Share on other sites
Hello,

 

first time on your Forum. I wish you all the best for this chritsmas time and for 2008.

 

3 Days ago I installed the CCGV(trad) contribution. Because it´s the first contribution I install, I just upload avery files of the contribution as well as the ones for the french translation.

 

Everything is working fine. The only thing that doesn't work is that after a cutomer bought a coupon (GIFT25 for example) it doesn´t appear in the queue for the admin.

 

I saw that a lot a person already experienced this problem but I couldn´t fin the solution.

 

Does someone knows where the problem is ?

 

Thanks a lot !

Hervé

Did you run the SQL query and check the tables? I'd go back through the installation instructions and make sure all of the steps were followed exactly to the letter.

Share this post


Link to post
Share on other sites
Did you run the SQL query and check the tables? I'd go back through the installation instructions and make sure all of the steps were followed exactly to the letter.

 

Yes I run the SQL-file.

 

If Nobody knows, I would intall my Backup-version on my server and start again. But as I said, I didn´t edit my files. I just upload every file as they are in the last package.

 

If I go in my SQL-DB, there is a table and a File I should check ? I saw that the coupon is not in the "queue"-table....

Share this post


Link to post
Share on other sites

getting close . . .oooooh

 

Ok so I went through the install again checking every line and found I had missed one so now its all working apart from a slight glitch I cannot work out. If I buy a voucher worth 5 including taxes I have got it so it shows up as 5 in my cart box on the right. however, when i click . .send voucher and enter 5 in the amount box it says invalid amount. If I input 4.99 it works but not at 5 . . anyone have any suggestions? I am thinking its a problem because of sales tax and decimals but this does not help me start using the vouchers.

 

Thanks for now . .


Tony

Share this post


Link to post
Share on other sites
Don't know if this will work for everyone, but it certainly worked for me:

 

In includes/functions/sessions.php

if you find the following code

 

function tep_session_register($variable) {

global $session_started;

 

if ($session_started == true) {

if (PHP_VERSION < 4.3) {

return session_register($variable);

} else {

if (isset($GLOBALS[$variable])) {

$_SESSION[$variable] =& $GLOBALS[$variable];

} else {

$_SESSION[$variable] = null;

}

$GLOBALS[$variable] =& $_SESSION[$variable];

}

}

 

return false;

}

 

then replace it with

 

function tep_session_register($variable) {

global $session_started;

 

if ($session_started == true) {

return session_register($variable);

} else {

return false;

}

}

 

Haven't found any adverse effects yet but ... use at your own discretion

(my site is very, VERY heavily modded, so it may not apply to all)

 

Thanks Tony and Laura for the replies and esp. to Tony for the fix. It works; however, I'd recommend just commenting out the code you have to replace with "//" before each line because these were changes to sessions.php made by RC1 (the fix reverts back to the old MS2 code pretty much) - so, there will have to a more permanent fix in the future that works with RC1. Thanks and merry Christmas to you all as well.

 

Scott

olsonsp4c

Share this post


Link to post
Share on other sites

For the problem of Voucher not appearing in the queue ... I have some bad news. I found 2 members that never found the solution to the problem !

 

I tried to install every files new (no edit > just upload), run the sql-file new.... same problem....

 

I am now using a Work around. When a customer buy a voucher, I check for the payment then I send a voucher though the admin. It works but there are 2 convenients :

 

- If the cusotmer pays with credit card or paypal he doesn' t get its voucher Immediately. He has to wait that I send him a voucher for the same amount.

- The cusotmer has to redeem the voucher that I send through the admin.

 

It´s not good but it´s the only solution I found untill now solong the vouchers don´t appear in the release queue.

 

If someone knows the solution, many thanks for helping !

 

Hervé

Share this post


Link to post
Share on other sites

And now, I will help a lot o people....!

 

I found the solution and that nothing with code or something technical to do !

 

The problem is :

 

- When you create a new voucher in the catalog, important ist NOT to create a product begining with "GIFT" as a prodcut name !

 

>> Important is the "Product models" Field ! here you have to write something begining with GIFT

 

We just read to fast.... ;-)

Share this post


Link to post
Share on other sites

I have everything installed, and double-checked, but when a GV is purchased, the GV is not recorded in the database. The order is confirmed, but nothing for it is in the database. The same goes for emailing a coupon. It arrives in email, but nothing is in the database indicating it. I have installed and re-installed but I am clearly overlooking something.

Share this post


Link to post
Share on other sites

Have just installed and get the following error as soon as i try to setup a coupon

 

 

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /homepages/6/d121049916/htdocs/flrsupplies/catalog/admin/includes/functions/database.php on line 117

 

 

Please anyone, ideas?

Share this post


Link to post
Share on other sites

Hi! I desperately need a way to see, in the voucher report in admin, either how much money was withdrawn or the total of the order. Per default, you only see how many times a customer has used the coupon etc, but I need to see how much money he spent in my store and/or how much discount he got using my 20% coupon.

 

Anyone know how to mod this thing? :blush:

Share this post


Link to post
Share on other sites

I've been writing a mod for this, and I discovered a small bug in "ot_coupon.php", function "get_order_total". Occasionally $total_price sends back a null, so I added this line before the return statement and it fixed it:

 

$order_total = (is_numeric($total_price)) ? $total_price : $order_total;

Share this post


Link to post
Share on other sites
I've been writing a mod for this, and I discovered a small bug in "ot_coupon.php", function "get_order_total". Occasionally $total_price sends back a null, so I added this line before the return statement and it fixed it:

 

$order_total = (is_numeric($total_price)) ? $total_price : $order_total;

 

Sweet! Sadly I noticed my CCGV refuses to accept coupon codes the first time they're entered (they work if you reload the checkout_confirmation.php page) so I still can't use it :'(

Share this post


Link to post
Share on other sites

Testing new stuff on localhost. just installed OSC RC1 then installed CCVG (trad)

Now when i go to admin where you manage administrator it looks like this - BOX_CONFIGURATION_ADMINISTRATORS

Any ideas how to fix this? the contribution seams to work fine.

 

Thanks in advance.

 

George

Share this post


Link to post
Share on other sites

Hi, I have installed this great contribution and I can get this error message:

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/****/includes/classes/shopping_cart.php:392) in /home/***/includes/functions/sessions.php on line 97

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/***/includes/classes/shopping_cart.php:392) in /home/****/includes/functions/sessions.php on line 97

 

I've tried to put the sessions and cache off put it did not help. I've re installed the contrib from scratch on a test server and ended up with the same problem.

 

Does anybody have a clue?? :blink:

 

Thanks

Pat.

Share this post


Link to post
Share on other sites

I have gotten most of the contribution working, but when checking Gift Vouchers Sent, nothing appears. The problem is that the Coupon_id is not being entered into the coupon_email_track table. In that table, all coupon_id = 0 The same happens whether the GV is sent from Admin, or purchased and sent from a customer. The other information is showing in that table, such as Customer_id_sent, Sent_firstname, etc. It looks like the only thing not showing up is the coupon_id

 

I have reloaded the GV_mail.php file, and same problem.

Share this post


Link to post
Share on other sites

Did anyone else run into this problem...

 

I have no problems with this install except for one page /includes/classes/shopping_cart.php. I can insert all the needed code, but when I put in this line:

 

// CCGV ADDED - BEGIN
	   if ($this->show_weight() == 0) {
		  $wvirtual_check_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");
		  $wvirtual_check = tep_db_fetch_array($wvirtual_check_query);

		  if ($wvirtual_check['products_weight'] == 0) {
			switch ($this->content_type) {

			  case 'physical':
				$this->content_type = 'mixed';
				return $this->content_type;
				break;

			  default:
				$this->content_type = 'virtual_weight';
				break;
			}

		  } else {
			switch ($this->content_type) {

			  case 'virtual':
				$this->content_type = 'mixed';
				return $this->content_type;
				break;

			  default:
				$this->content_type = 'physical';
				break;
			}
		  }
	  }			  
   }
 }

	  } elseif ($this->show_weight() == 0) {
		reset($this->contents);
		while (list($products_id, ) = each($this->contents)) {
		  $virtual_check_query = tep_db_query("select products_weight from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");
		  $virtual_check = tep_db_fetch_array($virtual_check_query);
		  if ($virtual_check['products_weight'] == 0) {
			switch ($this->content_type) {
			  case 'physical':
				$this->content_type = 'mixed';

				return $this->content_type;
				break;
			  default:
				$this->content_type = 'virtual_weight';
				break;
			}
		  } else {
			switch ($this->content_type) {
			  case 'virtual':
				$this->content_type = 'mixed';

				return $this->content_type;
				break;
			  default:
				$this->content_type = 'physical';
				break;
			}
		  }
		}
// CCGV ADDED - END

 

All the pages on my site become blank. That is the only addition that shuts it all down. Anyone else run into this, or is there someone who can help me?

Share this post


Link to post
Share on other sites

I think the tax calculation for coupons subtracted before tax is wrong. For my installation, the commented out code on line 322 to calculate ratio1 is correct and intuitive, whereas the code on line 325 to calculate ratio1 (curiously marked "//// debug") does not make any sense.

 

For example, the current release calculates a 4.9% tax on a $129.60 order with a $10 coupon (discounted total of $119.60) at $5.84 whereas the older code calculates correctly at $5.86. The larger the coupon, the worse is the error.

 

For those who sell instate merchandise in the US with fixed off coupons, check your orders. Those pennies could add up!

 

Here is the release code for ot_coupon at line 321:

 

					} else {
//						$ratio1 = $od_amount/$amount;   // this produces the wrong ratipo on fixed amounts
					reset($order->info['tax_groups']);
					while (list($key, $value) = each($order->info['tax_groups'])) {
						$ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug
						$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] * $ratio1;
							$tod_amount += $god_amount;
							$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
						}
					}
				}

Share this post


Link to post
Share on other sites
I think the tax calculation for coupons subtracted before tax is wrong. For my installation, the commented out code on line 322 to calculate ratio1 is correct and intuitive, whereas the code on line 325 to calculate ratio1 (curiously marked "//// debug") does not make any sense.

 

For example, the current release calculates a 4.9% tax on a $129.60 order with a $10 coupon (discounted total of $119.60) at $5.84 whereas the older code calculates correctly at $5.86. The larger the coupon, the worse is the error.

 

For those who sell instate merchandise in the US with fixed off coupons, check your orders. Those pennies could add up!

 

Here is the release code for ot_coupon at line 321:

 

					} else {
//						$ratio1 = $od_amount/$amount;   // this produces the wrong ratipo on fixed amounts
					reset($order->info['tax_groups']);
					while (list($key, $value) = each($order->info['tax_groups'])) {
						$ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug
						$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] * $ratio1;
							$tod_amount += $god_amount;
							$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
						}
					}
				}

 

What page is this supposed to be used at?

Share this post


Link to post
Share on other sites
What page is this supposed to be used at?

 

The code is used during checkout confirmation when calculating the order total and order tax. If you redeem a fixed amount coupon, then checkout, you run this code.

Share this post


Link to post
Share on other sites

Apologies if this has been answered before - but I have CCGV installed on a client's store. They created a discount code with a value of $100. A customer came through with $38 in their cart, entered the code and placed a successful order without entering any credit card info - meaning they placed an order without paying for shipping.

 

It looks like if the code redeem amount is greater than the amount in the cart you can proceed from checkout_payment to checkout_confirmation/checkout_success without entering a CC to pay for shipping. Any ideas how to fix this? My order total sort order is below:

 

Discount Coupons 3

Giftwrap 4

Gift Vouchers

Low Order Fee

Shipping 2

Sub-Total 1

Tax 5

Total 6

 

cheers

 

Jason

Share this post


Link to post
Share on other sites

I have been fighting this contribution and need some help. When I email a GV from Admin, I get the following error.

 

Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in ..... admin\includes\functions\database.php on line 117

 

line 117:

return mysql_insert_id($$link);

 

The email goes through to the intended email address.

 

When commented out, emails will go through, but all insert_id() in admin will not work, effectively breaking many things. I went back through the contribution and don't see any edits to this file.

 

Also, no matter what the setting, the coupon_id is not being inserted into any other table other than queue, (I am able to release it), so it never shows up as sent in Admin. I never see the GV in Gift Vouchers Sent. The customer is getting the correct emails and GV and coupons are redeemed correctly.

 

Help on this is most appreciated.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×