Zen Cart Logo
Forums / All Other Contributions/Addons / Donation product type

Donation product type

Locked

Views: 6,959

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
26 Feb 2008, 12:54 AM
#1
audleman avatar

audleman

New Zenner

Join Date:
Jul 2007
Posts:
69
Plugin Contributions:
0

Donation product type

Hey Zenners,

As part of my work with YES! Magazine, I created a donation product type. Check it out here:

http://www.yesmagazine.org/store/index.php?main_page=document_product_info&cPath=5&products_id=12

It lets customers select from a number of pre-defined amounts ($25, $50), enter their own amount, and do recurring monthly donations.

The way it works is that it's a product with a value of $1 and the quantity becomes the value of the donation.

I'm interested in contributing my work back to the open source community. However I don't have a lot of spare time and a bad case of tendonitis prevents me from doing lots of extra work. In addition, to create this product type I had to do a bunch of modifications to a bunch of template pages, and modify some core files. These changes were associated with changing the display of the quantity. So if somebody donated $50, it should show

Donation $50

instead of

50 x $1 Donation $50

I can't think of how to easily wrap up my changes. So if somebody with more ZenCart experience wants to talk, that'd be awesome.

Kevin

10 Apr 2008, 4:18 PM
#2
paulinenmu avatar

paulinenmu

New Zenner

Join Date:
Sep 2005
Posts:
23
Plugin Contributions:
0

Re: Donation product type

Would you be willing to help me do this with a site I'm working on? It's for a camp for disabled children, and they would like to take donations and I thought that bouncing it through their camp store would be the best way to do it.

29 Oct 2008, 9:06 AM
#3
tom_s avatar

tom_s

New Zenner

Join Date:
Oct 2008
Posts:
2
Plugin Contributions:
0

Re: Donation product type

Did you get this to work? I am very interested please.

Thank you in advance.

Tom

29 Oct 2008, 3:51 PM
#4
audleman avatar

audleman

New Zenner

Join Date:
Jul 2007
Posts:
69
Plugin Contributions:
0

Re: Donation product type

Yep, check out the link I posted above. For a basic donation product, you can simply cannibalize the code on the product page.

It's simply a product with a price of $1. The quantity determines the total donation. The meat of it is the Javascript on the product page that updates cartQuantity when the user clicks on a radio box or enters a value. You'll probably want to get rid of the code that handles our "Dedicated Friends"; it sets an attribute that lets me know this is a recurring monthly donation.

The only other part is finding every page where it displays
50 x Donation ($1)
and updating it to display

  • Donation $50

Of course that's optional. I know one guy who didn't bother. People will get the idea either way.

29 Oct 2008, 3:56 PM
#5
tom_s avatar

tom_s

New Zenner

Join Date:
Oct 2008
Posts:
2
Plugin Contributions:
0

Re: Donation product type

Thanks my friend! Very much appreciated! :clap:

18 Nov 2008, 3:16 PM
#6
willt avatar

willt

New Zenner

Join Date:
Aug 2005
Posts:
5
Plugin Contributions:
0

Re: Donation product type

audleman,

I think that ALOT of nonprofit people REALLY would be interested in this. I have wanted this for a couple of years, and have never had the time or knowledge to do it.

What you have could serve many many nonprofits.

I encourage you to simply document in the forum what specific mods you made to the various files involved.

Did you use attributes on one product? Looks like!

How to you get the "other" line item to have a "quantity box"? and not the rest?

Please PLEASE do what you can to document this more fully. I would be very willing to write it up formally if you were to just throw some rough notes my way.

Will

2 Dec 2008, 4:33 PM
#7
sansan avatar

sansan

New Zenner

Join Date:
Aug 2008
Posts:
2
Plugin Contributions:
0

Re: Donation product type

I also represent a non-profit, and would love assistance with implementing this. Has the documentation been created yet?

Thanks.

2 Dec 2008, 5:28 PM
#8
audleman avatar

audleman

New Zenner

Join Date:
Jul 2007
Posts:
69
Plugin Contributions:
0

Re: Donation product type

Friends,

There appears to be some interest from a number of groups for my donation module. I think I will look at what it will take to wrap up my work into an open source package. Please hold :) I'll get back to this thread in a couple of days...

Kevin

5 Dec 2008, 8:58 PM
#9
gabenn2 avatar

gabenn2

Zen Follower

Join Date:
Feb 2007
Posts:
109
Plugin Contributions:
0

Re: Donation product type

I am looking for exactly this type of module. For now I am going to modify the template files but I would love to see this available.

7 Aug 2009, 6:59 AM
#10
natefromdetroit avatar

natefromdetroit

New Zenner

Join Date:
Mar 2009
Posts:
13
Plugin Contributions:
0

Re: Donation product type

I'd like to revive this thread. I've seen many people in search for this and audleman hit it Right On. I think we would ALL like to know how he did it. I would pay for an add-on such as this. I can not find one for free or to purchase. How is this done?

7 Aug 2009, 8:50 AM
#11
natefromdetroit avatar

natefromdetroit

New Zenner

Join Date:
Mar 2009
Posts:
13
Plugin Contributions:
0

Re: Donation product type

HA! I got it!. I used a product type, for me I used Document. Then on Line 100 of tpl_document_product_info_display.php delete PRODUCTS_ORDER_QTY_TEXT and type whatever you want it to say there. Use single quotes if you want to use spaces or dollar signs!

13 Aug 2009, 8:19 PM
#12
audleman avatar

audleman

New Zenner

Join Date:
Jul 2007
Posts:
69
Plugin Contributions:
0

Re: Donation product type

Nate, it sounds like you're on the right track.

Originally I thought I would complete this as its own module, but I've currently got way more work than I could handle. If there is somebody interested in funding the work then let's talk.

Kevin

23 Aug 2010, 2:21 PM
#13
owen26 avatar

owen26

New Zenner

Join Date:
Feb 2010
Posts:
12
Plugin Contributions:
0

Re: Donation product type

Well, I have this working just fine for me now.

But my question is, how do you hide the quantity display in the shopping cart for the "donation" product type only?

If you go to Audelman's website at http://store.yesmagazine.org/donate?cPath=5 , enter a donation amount, and go to his shopping cart, you'll see that he is able to hide the quantity displayed for the donation item. So, if you donate $50, the dollar total displays fine but it doesn't display 50 "units" under quantity.

That's what I want my cart to do as well. Additionally, if you add one of his "standard" product types, the quantities show up just as they should.

I tried setting "show quantity in shopping cart" under my product type (Document Product Type) to zero, but no luck.

I'm guessing I need to modify either my shopping cart template or product type template, but I would appreciate any help with the PHP code.

23 Aug 2010, 2:36 PM
#14
audleman avatar

audleman

New Zenner

Join Date:
Jul 2007
Posts:
69
Plugin Contributions:
0

Re: Donation product type

owen26:

Well, I have this working just fine for me now.

But my question is, how do you hide the quantity display in the shopping cart for the "donation" product type only?

I overwrote the shopping cart template directly. You'll have to do the same for the Order Confirmation page and, to be thorough, the customer email.

The first two are pretty easy to override, the email is some of the craziest spaghetti logic code you'll ever deal with.

Good luck,
Audleman

23 Aug 2010, 3:58 PM
#15
owen26 avatar

owen26

New Zenner

Join Date:
Feb 2010
Posts:
12
Plugin Contributions:
0

Re: Donation product type

Audleman: Would you be willing to share your tpl_shopping_cart_default.php code with us? I'm thinking your modification must lie somewhere inside the "loop through all products" section of that page. Did you just delete a little snippet of the default code, or did you have to add some new logic of your own? Thanks.