Forums / Addon Payment Modules / How do I replace the add-to-cart button with a PayPal *Donate* button?

How do I replace the add-to-cart button with a PayPal *Donate* button?

Views: 2,258

Results 1 to 8 of 8
28 Apr 2014, 6:31 PM
#1
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

How do I replace the add-to-cart button with a PayPal *Donate* button?

Has anyone (there must be someone) who has added a PayPal donate button to their store?
I created the code via the PayPal site and added the code to my site (since removed until resolved) in my template produc_info_display.php file. It displays as expected, yet clicking it actually adds the product being viewed by the user to their cart rather than transferring then to PayPal to make their donation.
All my products are virtual, I offer one product for free hence the thought of a donate option.

Any thoughts anyone?

29 Apr 2014, 2:31 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

Since you're trying to make that product bypass the ZC shopping cart, use Document-General as the product-type (since those products can't be added to the basket and thus won't show the add-to-cart button), and then modify tpl_document_general_info_display.php to insert your button code there.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Apr 2014, 7:52 AM
#3
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

DrByte:

Since you're trying to make that product bypass the ZC shopping cart, use Document-General as the product-type (since those products can't be added to the basket and thus won't show the add-to-cart button), and then modify tpl_document_general_info_display.php to insert your button code there.

Thank you boss. In doing so (I will try it this evening) will your method allow the store to collect the customers details? Yes I'm giving a product away but it's also useful to understand who returns at a later date to actually purchase products, i.e was the potential customer pleased with the freebie enough to come back and spend their hard earned.
I wonder if it's possible to place the donate button in checkout_success or the view account/orders pages to be displayed solely on the (free) product ID number instead?
Any thoughts Doc?

29 Apr 2014, 10:41 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

picandnix:

will your method allow the store to collect the customers details?No. Your paypal button is completely bypassing the store's checkout.

picandnix:

I wonder if it's possible to place the donate button in checkout_success or the view account/orders pages to be displayed solely on the (free) product ID number instead?
But, what if your customer put other things in their cart too? How would they know that you expect them to go through checkout twice: once for their purchase, and once for the donation you're soliciting?

Sounds like you should just use normal checkout instead. Why the need for a separate "Donate" button at all? Sounds to me like you're just confusing your customers, and that will decrease revenue all round.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Apr 2014, 11:57 AM
#5
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

DrByte:

Sounds to me like you're just confusing your customers, and that will decrease revenue all round.

I'm thinking the same thing after playing around with this idea :cheers:

29 Apr 2014, 12:34 PM
#6
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

Firstly, you want Zen to handle everything.

Running two or more different payment systems for orders and donations is just a pain in the ****!

So the solution is easy. All your FREE products you are giving away - make them products, and ensure that they are set to FREE with FREE shipping. This ensures that everyone creates an account in order to get something for nothing.

Secondly, set up an upselling script on checkout, which asks the customer if they wish to donate to you. If they do, they simply enter the value they want to donate. If you want someone to donate to you as an actual "product", then you can set up a "donation product" and then set a "value attribute" where the customer enters the value of the donation they wish to make. We have a module which is used in the same way for Gift Voucher values, where the customer selects the value of the voucher they wish to purchase.

It's as easy as that.

Now your clients can purchase/send a $15.99 donation, as well as sign up for free stuff, and you can track everything you want to to your heart's content!

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

29 Apr 2014, 1:48 PM
#7
picandnix avatar

picandnix

Totally Zenned

Join Date:
Dec 2010
Location:
UK
Posts:
1,780
Plugin Contributions:
2

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

You had me nodding right up to this > Absolute:

Secondly, set up an upselling script on checkout
any clues for the script please Absolute, for a fellow Westcountry inhabitant :wink:

29 Apr 2014, 1:52 PM
#8
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: How do I replace the add-to-cart button with a PayPal *Donate* button?

Try this contribution: https://www.zen-cart.com/downloads.php?do=file&id=1215

It puts the upsell on your Shopping Cart page. I built one for a client which used this script in it's original format, but inserted an additional page at checkout which was shown once, and offered all the upsell products within a grid layout.

This should get you started though.....

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store