Zen Cart Logo
Forums / All Other Contributions/Addons / Mod for value field for Gift Certificates

Mod for value field for Gift Certificates

Locked

Views: 10,146

Results 1 to 20 of 43
This thread is locked. New replies are disabled.
5 Oct 2006, 12:50 PM
#1
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Mod for value field for Gift Certificates

This mod-package is divided in two mods.

Value-Mod:
This mod makes it possible to have an input field set the value of a Gift Certificate. Intended to be use with the GV-Product_Type-Mod that uses a seperate Product Type for Gift Certificates.

GV-Product_Type-Mod:
This Mod creates a new Product Type, Gift Certificates. The new Product Type is based on the Free Shipping Product Type and is intended to be used with the Value-Mod in order to better control the look and behaviour of Gift Certificates.

The mod will be downloaded from the download section under Product Types.

Questions, comments and support are given in this thread.

Beez & vike

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

29 Oct 2006, 11:19 AM
#2
pierre avatar

pierre

New Zenner

Join Date:
Oct 2006
Posts:
84
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

I installed the mods for the gift certificate, but I keep getting the error message:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /includes/classes/shopping_cart.php on line 383

I then overwrited the shopping_cart.php with the original one and the mod still didn't work. I tried this on new zen cart installations, and edited ones.

Can someone please give me some help on how to install the gv mod?

http://www.customscripts.co.za - Custom development for open-source applications

http://www.pcservice.co.za - Website Development, Domain Registration, Hosting

31 Oct 2006, 11:55 AM
#3
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

Pierre:

I installed the mods for the gift certificate, but I keep getting the error message:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /includes/classes/shopping_cart.php on line 383

I then overwrited the shopping_cart.php with the original one and the mod still didn't work. I tried this on new zen cart installations, and edited ones.

Can someone please give me some help on how to install the gv mod?

Hi there Pierre!

I discovered a similar problem when I moved to a server with an older php and MySQL, where the line $mod_product_model = $db->Execute($mod_product_model_query)->fields['products_model']; must be changed to ```
$mod_product_model = $db->Execute($mod_product_model_query);
$mod_product_model = $mod_product_model->fields['products_model'];


It seems that "$db->Execute" and "->fields" cant' be on the same line. You can try it your self or wait for an updated version to be posted shortly... The same kind of change needs to be on on several lines in shopping_cart.php and maybe in some other file.

Thank you for your feedback! Good luck!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

31 Oct 2006, 11:36 PM
#4
pierre avatar

pierre

New Zenner

Join Date:
Oct 2006
Posts:
84
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

Hi Beez.

Thanks for the support, it helped me alot. If anybody else also have this problem, you also need to edit the following lines in /includes/classes/shopping_cart.php

Line 742

$value_id =$db->Execute("select products_options_values_id
	   		      from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . "
		  	      where products_options_id = '" . $option_id . "'
		  	      limit 1
			    ")->fields['products_options_values_id'];

change to

	
$value_id =$db->Execute("select products_options_values_id
			 from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . "
			 where products_options_id = '" . $option_id . "'
			 limit 1
			");
$value_id = $value_id->fields['products_options_values_id'];

Line 931

$value_id =$db->Execute("select products_options_values_id
	                     from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . "
			     where products_options_id = '" . $option_id . "'
			     limit 1
			   ")->fields['products_options_values_id'];

change to

$value_id =$db->Execute("select products_options_values_id
			 from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . "
			 where products_options_id = '" . $option_id . "'
			 limit 1
			");
$value_id = $value_id->fields['products_options_values_id'];

Line 1943

$mod_value_gift_model=$db->Execute($mod_value_gift_model_query)->fields['products_model'];

change to

$mod_value_gift_model=$db->Execute($mod_value_gift_model_query);
$mod_value_gift_model = $mod_value_gift_model->fields['products_model'];

Line 1949

$mod_value_gift_options_id=$db->Execute($mod_value_gift_options_id_query)->fields['options_id'];

change to

$mod_value_gift_options_id=$db->Execute($mod_value_gift_options_id_query);
$mod_value_gift_options_id = $mod_value_gift_options_id->fields['options_id'];

Line 1955

$mod_value_gift_options_type=$db->Execute($mod_value_gift_options_type_query)->fields['products_options_type'];

change to

$mod_value_gift_options_type=$db->Execute($mod_value_gift_options_type_query);
$mod_value_gift_options_type = $mod_value_gift_options_type->fields['products_options_type'];

Line 1986

$mod_value_gift_query_model=$db->Execute($mod_value_gift_query_model_query)->fields['products_model'];

change to

$mod_value_gift_query_model=$db->Execute($mod_value_gift_query_model_query);
$mod_value_gift_query_model = $mod_value_gift_query_model->fields['products_model'];

You also need to edit the file includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php

Line 95

$mod_product_model      =$db->Execute($mod_product_model_query)->fields['products_model'];

change to

$mod_product_model      =$db->Execute($mod_product_model_query);
$mod_product_model = $mod_product_model->fields['products_model'];

I hope this helps.

http://www.customscripts.co.za - Custom development for open-source applications

http://www.pcservice.co.za - Website Development, Domain Registration, Hosting

1 Nov 2006, 12:00 AM
#5
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

Exactly!

Thanx for typing it ;-)

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

1 Nov 2006, 1:36 AM
#6
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

I've uploaded a new version (1.1) with the changes above. It works with Zen Cart 1.3.6.

Thanx Pierre!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

19 Nov 2006, 2:39 PM
#7
kimartist avatar

kimartist

New Zenner

Join Date:
Feb 2006
Posts:
23
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

I am encountering a problem with this and the improved attributes controller and this working together...has anyone else encountered this problem.
Thanks in advance....

7 Dec 2006, 11:17 AM
#8
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

I'm not using that mod so I can't help you with that. If you manage to get it to work, please let us know.

Good luck!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

7 Dec 2006, 4:31 PM
#9
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

A new version is uploaded. The new version (1.2) is updated so that the value of gift certificates in the shopping cart is shown in the value field.

The new version will located in the download section once it has been approved.

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

10 Dec 2006, 11:39 AM
#10
bradlawson avatar

bradlawson

New Zenner

Join Date:
Oct 2005
Posts:
71
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

This might work for multiple quantity boxes, but I am not sure. Can the numerical number entered into the text box act as a quantity amount too. So say a shirt is $5 and they want to order 10 smalls 10 medium and 5 larges WITHOUT having to go back and forth from the shopping cart. The question is can I have this new text input option increase the quantity based on the number they enter?

Thanks,

Brad

12 Dec 2006, 7:28 AM
#11
samad64 avatar

samad64

Totally Zenned

Join Date:
May 2006
Location:
Texas
Posts:
554
Plugin Contributions:
2

Re: Mod for value field for Gift Certificates

are both mods required for use of the value mod?

12 Dec 2006, 8:00 PM
#12
rogersmj avatar

rogersmj

New Zenner

Join Date:
Dec 2006
Posts:
1
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

I need to provide the ability for visitors to buy gift certificates in any amount, and this mod looks to be exactly what I need. However, I can't get it to work. I was able to install it without any problems, but when I go to my Gift Certificate item there's no option to enter a value. What else do I have to do? The directions aren't very clear on the use.

Thanks!

23 Feb 2007, 2:25 AM
#13
vike avatar

vike

New Zenner

Join Date:
May 2006
Location:
Göteborg
Posts:
17
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

bradlawson:

This might work for multiple quantity boxes, but I am not sure. Can the numerical number entered into the text box act as a quantity amount too ... The question is can I have this new text input option increase the quantity based on the number they enter?

No.

You could perhaps rewrite this mod but rather find a mod which behavior is more like what youre after.. or write your own from 'scratch'..

We can make it for you if you make it worth our while :)

23 Feb 2007, 2:34 AM
#14
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

samad64:

are both mods required for use of the value mod?
Sorry for the delayed answer, but no, not really... But we created a new product type mostly to make it easier. You can look at the first post in this thread and in the install.txt in the mod-package for more info on how it works.

If you any more questions, just ask!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

23 Feb 2007, 2:42 AM
#15
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

rogersmj:

I need to provide the ability for visitors to buy gift certificates in any amount, and this mod looks to be exactly what I need. However, I can't get it to work. I was able to install it without any problems, but when I go to my Gift Certificate item there's no option to enter a value. What else do I have to do? The directions aren't very clear on the use.

Thanks!

Have you installed both the GV-Product_Type-Mod and Value-Mod?
Have you read the install-files for both mods, especially the "Configure the Shop" part?

Get back if you can't make it work and good luck with your shop!

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

1 Apr 2007, 3:53 AM
#16
thunbug avatar

thunbug

New Zenner

Join Date:
Mar 2007
Posts:
26
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

I was following the steps in the text file "install_value-mod_137.txt" to "Configure the Shop" but I got an error when I was trying to add a new attribute. Here's the error message I got: "Attribute Option and Option Value Do NOT Match - Attribute was not added - : TEXT".

Here are the steps I took:

  1. Went to Catalog->Option Name Manager
  2. Entered the text "Value" in the Option Name field.
  3. Selected "Value" in the drop down list under option type
  4. Went to Catalog->Attributes Controller
  5. Selected Categories: - Gift Certificates (created previously)
  6. Selected the Gift Certificate product
  7. In the "Adding New Attributes" section, I clicked "insert". Option Name was "Value [Value]" and Option Value was "TEXT [RESERVED FOR TEXT/FILES ONLY ATTRIBUTES]Then I got the error message. Please let me know what I may have done wrong.

Thank you guys!

8 Apr 2007, 5:57 PM
#17
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

Thanks for the excellent description of your steps. Unfortunately we're unable to reproduce your error.

Could you please try and remove the entry in Admin->Options Name Manager. You can also try and remove the product itself too and create a new. Then add the option name again in the Option Name Manager and then go to Attributes Controller and choose your product and select "Value" from the Option Name and don't select anything in the Option Value-field. Click Insert. Still the same error?

You are sure you have got all the changes in the modded files?

Good luck and please let us know how it turns out.

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

8 Apr 2007, 10:55 PM
#18
thunbug avatar

thunbug

New Zenner

Join Date:
Mar 2007
Posts:
26
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

Thanks a lot Beez. I have since opted to sell gift certificates at $25, $50 and $100 and I'm happier with that.

I appreciate your response.

9 Apr 2007, 10:08 AM
#19
beez avatar

beez

Zen Follower

Join Date:
Sep 2005
Location:
Malmö, Sweden
Posts:
117
Plugin Contributions:
4

Re: Mod for value field for Gift Certificates

Good for you! Thanx for the update.

Focus dammit, I'm trying to focus!

SweetFabrik - True believer of Zen Cart!

http://www.last.fm/user/beez/

25 Apr 2007, 7:49 PM
#20
hrm avatar

hrm

New Zenner

Join Date:
Oct 2005
Posts:
95
Plugin Contributions:
0

Re: Mod for value field for Gift Certificates

Thanks for the great mod. I love it. However, I was just testing it in my test cart and discovered that whenever the shopping cart is updated/refreshed after removing other products, the GV value gets changed to 0.00. I've tried this several different ways, going through the steps in a different order and the result is always the same.

Any ideas what is happening?

Heather
Results! Why, man, I have gotten a lot of results.
I know several thousand things that won't work.
----Thomas Edison