Jump to content
Vger

[CONTRIBUTION] CCGV (trad)

Recommended Posts

Thank you, Vger, for this contribution and to everyone behind the scenes :) I inherited a heavily modified site with CCGV installed about 2 years ago. Honestly, it's difficult to ascertain which version this is. There have been so many tweaks around many installed contributions.

 

There is a REDEEM button on checkout so it is an older version to be sure.

 

Specifically, I need to change the "GIFT" required naming convention to something else, for example: "ABC".

 

One of the restrictions (per install guide) is that each coupon or voucher must begin with "GIFT". This call is found in the following files:

 

Searching for: ^GIFT

includes\classes\shopping_cart.php(276): if (ereg('^GIFT', $gv_result['products_model'])) {

includes\classes\shopping_cart.php(582): if (ereg('^GIFT', $gv_result['products_model'])) {

includes\modules\order_total\ot_coupon.php(411): if (ereg('^GIFT', addslashes($gv_result['products_model']))) {

includes\modules\order_total\ot_gv.php(117): if (ereg('^GIFT', addslashes($order->products[$i]['model']))) {

Found 4 occurrence(s) in 4 file(s)

 

If I edit ^GIFT to ^ABC in these 4 files, is this sufficient to allow the creation of coupons and voucher (products) to begin with "ABC"... followed by anything?

 

I would image that clearing out the relevant data base tables would be required, as well.

 

Thanks much :)

 

jon


It's all just ones and zeros....

Share this post


Link to post
Share on other sites

Hi vger,

 

Thx for this contribution I have installed today.

I have added discount coupons, everything is ok. Could you tell me on with page I can enter the coupon when I process the checkout ?

 

Thank you very much.

 

PS : Sorry for my bad english :-":-" :blush:

 

Cam

Share this post


Link to post
Share on other sites

Hello,

 

Thanks for the ccgv contribution - I installed it but got this message on the catalog site:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

Can you help me? How do i enable the register_globals?

 

I appreciate your assistance.

 

Laura

Share this post


Link to post
Share on other sites

Hi Vger

 

What is the exact logic in the coupons product ID and categories paths to restrict the coupon?

I woke up this morning with a bad surprise: I restricted a promotion to 3 categories in my store.

 

If all products in the cart don't belong to the authorized list, the promotion is not applied: fine

If all products in the cart belong to the authorized list, the promotion is applied: fine

But if ONE product ONLY belongs to the authorized list and all the rest is not authorized, the promotion is still applied: not fine at all.

 

Could you confirm this?

 

Thanks

Edited by pixclinic

Share this post


Link to post
Share on other sites
Hello,

 

Does anybody have an example of this contribution so I could see how it looks and functions? I just want to make sure its what I need before I install it.

 

Thanks.

 

Anybody?

Share this post


Link to post
Share on other sites
Hello,

 

Thanks for the ccgv contribution - I installed it but got this message on the catalog site:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

Can you help me? How do i enable the register_globals?

 

I appreciate your assistance.

 

Laura

 

Laura,

 

There are several ways to do this, one is by contacting support for your webhost, that would be the easiest - they can do it for you quickly and easily, generally...

 

Below are several possibilities I found from a simple search on the forum:

 

Here are a couple of things to try.

 

Try locating your PHP.ini file - it's not in your HTML directories, look for it higher up. Sometimes in a directory called /etc

 

Or, create your own PHP.ini file and put it in your /catalog directory. Put the following line in it

 

 

register_globals = on

 

 

Last and best - since having Register Globals set to on creates a security risk, you might look into a contribution that manages your register globals.

 

http://www.oscommerce.com/community/contributions,2097

 

 

 

 

the php.ini can be a number of locations and depends on how your server has been set up. Most of the time you will find it within the php folder. Once you have found it, open it in a editor and do a search for "globals" and you will find it.

 

Most of the time there is a load of comment text telling you what to do so you need to find the line that actually begins with register etc and alter it.

 

Once changed you will need to restart the webserver to make sure that the changes are refelected.

 

There are a couple of other ways to do it as well.

 

If you have a .htaccess file in the root of your domain you could add:

 

php_value register_globals=on

And as long as your web server allows it the change will be made at your domain level.

 

One other way if you want to do this for individual scripts your could add:

 

<?php
ini_set ('register_globals', 1);
?>

 

but if you do this make sure that these lines are the first lines in the script.

 

Do bare in mind though that this last option is just for individual files and not the entire site.

 

 

 

The below is actually from Vger:

 

Your hosting provider won't enable Register Globals on the server just so you can use them on your osCommerce website.

 

You can either:

 

1. Create a new text document on your PC desktop and rename it php.ini and add this to it:

 

register_globals = On

 

 

then upload it to the root of your website via FTP, or ....

 

2. Create a text document on your PC desktop and rename it txt.htaccess and put this code in it (Apache servers only):

 

php_flag register_globals on

 

 

Upload it to the root of your website via FTP and then use FTP to 'Rename' the file to just .htaccess

 

 

 

hope this helps...

 

Scott

Share this post


Link to post
Share on other sites
Hi,

 

I was reading about how to use gift vouchers

 

I can't seem to find this tick box. Im not seeing any error messages either. Any suggestions or what code is responsible for the checkbox and session variables so I can try to debug?

 

Same here, I saw the "Would you like to redeem" box once, and now it does not appear. did you have any luck is finding the code responsible?

 

Cheers,

 

Malster

Share this post


Link to post
Share on other sites
I'm still looking for suggestions on why my gift vouchers once purchased are not appearing in the queue list for me to release... anyone?

 

I have the same problem, Anyone find the solution ?

Share this post


Link to post
Share on other sites
Hi there,

 

Thank you for your reply. OSC was auto-installed onto the host server...so I don't know how it was done.

 

Mark.

 

Hello Mark,

 

I'm not sure if you already figured this out by now but just in case ...

 

If you have access to your website via a control panel then log on and open the link for databases, select oscommerce then when you click on the admin button for that database the myphpadmin window should open. On mine I had to select import then SQL then import again then the window opened that allowed me to browse for the file and hit the GO button to actually run it.

 

I understand how frustrating this can be because I have had to figure a lot of things out on my

own too!Hope you already figured it out instead of being left hanging but if you hadnt I hope this helps.

 

Laura

Share this post


Link to post
Share on other sites
[snip]

Specifically, I need to change the "GIFT" required naming convention to something else, for example: "ABC".

[snip]

 

jon

 

FYI, if anyone needs to change the GIFT prefix requirement to anything else, search for ^GIFT in your files. Files list:

 

• includes\classes\shopping_cart.php

• includes\classes\shopping_cart.php

• includes\modules\order_total\ot_coupon.php

• includes\modules\order_total\ot_gv.php

 

These data base tables need to be emptied:

 

• coupons

• coupons_description

• coupons_email_track

• coupon_gv_customer

• coupon_gv_queue

• coupon_redeem_track

 

As always BACK UP your data base & your store before you begin. Make the file edits, upload to the correct directories, empty the above-listed tables, create a new coupon with your new prefix -- good to go.

 

I hope this helps :)

 

jon


It's all just ones and zeros....

Share this post


Link to post
Share on other sites

I have installed CCGV and it is working great. Now I want to offer a discount on the purchase of the Gift Vouchers. Does anyone know if this is possible and if so, how?

 

For example, I would like to offer a 10% discount on the purchase of a $25.00 gift voucher. If I do this using "Specials" it reduces the purchasing price of the gift card by 10% (which is what I want), but it also reduces the spending value of the card by 10%.

 

Any help would be very appreciated.

 

Thanks,

Phillip

Share this post


Link to post
Share on other sites

I am sure there is something simple wrong here but when the email is sent to a customer with their gift voucher amount it reads:

 

The Gift Voucher is worth ?12.00

 

To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code which is 61c0e6 in case you have any problems.

 

 

The ? should be € as this is the currency I use. I only have one currency in use and the symbol is defined etc in the admin area under localisation. Is there a quick fix to this ?

 

Many thanks Vger for your work.

Share this post


Link to post
Share on other sites
Laura,

 

There are several ways to do this, one is by contacting support for your webhost, that would be the easiest - they can do it for you quickly and easily, generally...

 

Below are several possibilities I found from a simple search on the forum:

 

Here are a couple of things to try.

 

Try locating your PHP.ini file - it's not in your HTML directories, look for it higher up. Sometimes in a directory called /etc

 

Or, create your own PHP.ini file and put it in your /catalog directory. Put the following line in it

register_globals = on

Last and best - since having Register Globals set to on creates a security risk, you might look into a contribution that manages your register globals.

 

http://www.oscommerce.com/community/contributions,2097

the php.ini can be a number of locations and depends on how your server has been set up. Most of the time you will find it within the php folder. Once you have found it, open it in a editor and do a search for "globals" and you will find it.

 

Most of the time there is a load of comment text telling you what to do so you need to find the line that actually begins with register etc and alter it.

 

Once changed you will need to restart the webserver to make sure that the changes are refelected.

 

There are a couple of other ways to do it as well.

 

If you have a .htaccess file in the root of your domain you could add:

 

php_value register_globals=on

And as long as your web server allows it the change will be made at your domain level.

 

One other way if you want to do this for individual scripts your could add:

 

<?php
ini_set ('register_globals', 1);
?>

 

but if you do this make sure that these lines are the first lines in the script.

 

Do bare in mind though that this last option is just for individual files and not the entire site.

The below is actually from Vger:

 

Your hosting provider won't enable Register Globals on the server just so you can use them on your osCommerce website.

 

You can either:

 

1. Create a new text document on your PC desktop and rename it php.ini and add this to it:

 

register_globals = On

then upload it to the root of your website via FTP, or ....

 

2. Create a text document on your PC desktop and rename it txt.htaccess and put this code in it (Apache servers only):

 

php_flag register_globals on

Upload it to the root of your website via FTP and then use FTP to 'Rename' the file to just .htaccess

hope this helps...

 

Scott

 

Thanks - I got that working! I am currently stuck on 2 seperate issues ... Gift Vouchers, are consistently bringing up the page that tells the recipent that it has already been redeemed or is invalid. For the individual who purchased it, this is not really a problem because it is in their account -can you help me with this?

 

Also, to apply coupons and gift vouchers it is necessary to refresh the Order Confirmation page - or reenter the payment and coupon/gift voucher information ... any thoughts on this?

 

Thank you so much.

 

Laura

Share this post


Link to post
Share on other sites

Ok, I have been all the way through the manual install but unfortunately I did not get it to work . .My store is still up and running so no problems there but when I click onto Vouchers/Coupons in the admin section something is not doing what it should as I get a 404 from this link . . .http://binkycrafts.com/shop/admin/FILENAME_COUPON_ADMIN?selected_box=gv_admin

 

any suggestions on where to start checking? I have so far been through and checked that all of the new files are there and have just started rechecking each of the changed files but thought maybe someone might be able to speed me along??

 

thanks in advance . .


Tony

Share this post


Link to post
Share on other sites

Do you have the following in this file? admin\includes\filenames.php:

 

define('FILENAME_COUPON_ADMIN', 'coupon_admin.php');

 

jon


It's all just ones and zeros....

Share this post


Link to post
Share on other sites
Ok, I have been all the way through the manual install but unfortunately I did not get it to work . .My store is still up and running so no problems there but when I click onto Vouchers/Coupons in the admin section something is not doing what it should as I get a 404 from this link . . .http://binkycrafts.com/shop/admin/FILENAME_COUPON_ADMIN?selected_box=gv_admin

 

any suggestions on where to start checking? I have so far been through and checked that all of the new files are there and have just started rechecking each of the changed files but thought maybe someone might be able to speed me along??

 

thanks in advance . .

 

check the addition to make in admin/includes/filemanes.php, you are probably missing a file name declaration there

Share this post


Link to post
Share on other sites
I am having a problem with the checkout function.

 

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?

 

Thanks,

Glenn

 

I am having this exact issue and it is frustrating customers. Does anyone have an idea how to remedy this? Thanks!

 

Scott

Share this post


Link to post
Share on other sites

I just finished uploading everything, and it appears (I haven't run any tests yet) that everything is going smoothly except with my includes/classes/shopping_cart.php file.

 

I can do the first couple modifications on the file and upload those without a problem. This code (from the CCGV file beginning at line 346 and going to 463) is posing the problem.

 

Here is the code:

//CCGV Edited begin
		  if ($virtual_check['total'] > 0) {

			switch ($this->content_type) {

			  case 'physical':

				$this->content_type = 'mixed';



				return $this->content_type;

				break;

			  default:

				$this->content_type = 'virtual';

				break;

			}

		  } else {
		// CCGV Edited end

// 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;
				return $this->content_type;
				break;

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

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

  return $this->content_type;
}

function unserialize($broken) {
  for(reset($broken);$kv=each($broken);) {
	$key=$kv['key'];
	if (gettype($this->$key)!="user function")
	$this->$key=$kv['value'];
  }
}

	  } 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

 

The error I am receiving is this:

Parse error: parse error, unexpected T_ELSEIF in /home/content/N/o/x/Noxwear/html/includes/classes/shopping_cart.php on line 434

 

I've gone through and can't find where the extra elseif is. If I take that out, then I have an extra } else { file somewhere.

 

Any help?

 

Would you prefer it if I put up my code that I had modified...even though the error continually rested in a portion I took verbatim from the CCGV file?

 

Thanks

Share this post


Link to post
Share on other sites

Hi Rhea,

since three days I'm trying to install a gift-voucher contribution; after spending one day with the "new" version, I reistalled my backup and tried the traditional version. Everything works fine except of one thing: if I buy a gv in my shop, I'm handled like a customer from a non-eu country (even I'm logged in as a german customer), which effects that I don't have to pay tax (no problem if the gv is without) but I have to pay an international low order fee. (20€ below 50€ order).

So it seems, that the low_order_fee doesn't go together with the virtual products. And I wonder, why I get the international low order fee, not the national one.

Do you have any suggestions? Maybe I passed through something during the installation, because I didn't thought having virtual products in my shop.

 

Thanks in advance,

Karsten

 

 

 

 

 

I am launching a reworking of CCGV (Credit Class & Gift Vouchers) today, which harks back to an older version with various bug fixes and security patches applied. It also includes additional features:

 

1. The ability to Delete gift vouchers in the Gift Voucher Queue from within osCommerce admin - for when customers don't follow up with payment.

2. Queue Gift Vouchers is no longer optional - all vouchers are queued.

3. The ability for customers to view their Gift Voucher Balance within their Account page and to send Gift Vouchers from that page.

 

Please don't posts support requests for other versions of CCGV to this thread - they won't be answered!

 

The contribution is available here:

 

http://www.oscommerce.com/community/contributions,4135

 

Rhea (Vger)

Share this post


Link to post
Share on other sites

Can multiple discount coupons be used in one sale?

 

Can I automatically redeem a coupon before going to the checkout stage?

As I describe on another thread, I would like to redeem a coupon when certain products are added to the shopping cart. I will add code to determine when to redeem but would like to know whether the concept is possible.

Share this post


Link to post
Share on other sites

I installed this contribution a while ago and have been using it only for discount coupons, which works well. I now need to start using gift vouchers and have a problem. I can buy, email and redeem vouchers okay, but when the recipient of the voucher uses it to buy something the balance of their account does not get reduced.

 

Could you please give me some idea how to fix this?

 

Thanks

 

Ian

Share this post


Link to post
Share on other sites

Just found something else out. If the customer has a gift voucher balance there is a tick box in the voucher redemption area, labelled 'Tick to use gift voucher balance'. That does exactly what I want but it makes no sense that the customer has to select the gift voucher payment type and tick that box.

 

Also, even if the customer has no vouchers balance, or the voucher balance is not enough to cover the order total, the customer can still checkout if they select the voucher payment method.

 

Is anybody using this side of the contribution successfully? Any help would be appreciated.

Share this post


Link to post
Share on other sites

Okay I've got this mainly sorted now, I was having a dumb moment and had forgotten to disable something else I had been trying.

 

I do have one remaining question though, is there any way of modifying the code so it only insists on a payment method being selected when the voucher balance is not enough to cover the order total?

 

I know you guys are busy but I really could do with some help as I am floundering here.

Share this post


Link to post
Share on other sites

Bit more of an update. It seems that when you first redeem a voucher you do not need to select a payment type, that only happens if you don't spend it all at once and then want to make another purchase. So there must be a flag which gets set on redemption, but not when the customer has a big enough pre-existing voucher balance to use for the current purchase.

 

Hope this helps somebody to give me the solution.

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

×