Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Add Discount Code Capability to PayPal Button WordPress

Here's a typical page from the site

I want to add a little text field so people can add a coupon code and get 10% off when they check out.

I've tried several javascript/paypal button code solutions and none would add the discount.

I know this is not a WP question but I've had such good experiences with the talent here that I thought I'd toss this one out there.

$50 for whomever gives us a workable solution.


Answers (3)


Denzel Chia answers:


First of all, regarding the paypal button.
Are you using a plugin to generate the paypal button?
Or the paypal button is generated by copy and paste from paypal button generator?

If it is a plugin, can you tell me which one you are using.
and if it is code generated by paypal, can you please paste it here?


Denzel Chia comments:


Taken a look at your paypal button code, and found that they are paypal hosted buy now button code.
I don't think you can add discount code to that.

I recommend you use the services of ejunkie.
It is priced at USD$5 per month for 10 different products.
It integrates with paypal easily and supports paypal website payments standard.
It supports discount codes
<strong>And most importantly, everything is created on your ejunkie account, including setting discount codes for your paypal buy button. Then you copy and paste on your site! There is no programming knowledge needed!</strong>

Please try out the demo
You can try out the discount code feature in the shopping cart.

I recommend ejunkie service, because I used to use it to sell my software, but stop using because I am not selling anymore, and not because ejunkie is bad, in fact ejunkie is the best!</strong>

<em><strong>I can help you setup your first buttons, so as to justify your $50 price money!</strong></em>


Denzel Chia comments:


If you do not want a monthly subscribed service, and preferred a one timed solution.
I can recommend you to use this WordPress Shopping Cart plugin from Tribulant Software which cause $49.90

This shopping cart supports discount codes as well as PayPal.
You can see the list of features here.

One of my client had used this before and he told me that Tribulant Software's support is prompt and good.



Matt Zeisler answers:

The biggest issue that you're going to run into is the fact that PayPal does not allow for a negative amount to be added to their checkout cart (otherwise, it'd be as simple as adding a "Discount" item with a negative value, along with the item that is normally added). Granted, there is a reason for this because it's easy to add an item to a cart (even if the seller hasn't created the button for it) and especially if they haven't encrypted the button.

If you're using a Buy Now button, the easiest thing to do is write a little bit of JavaScript that will switch out the Buy Now button code (it's encrypted, right?), when the correct discount code is entered, to one the same item that is now 10% less in price. For ease of use, the new price should also be reflected on the item page by slashing out the old price and displaying the new price, which would be triggered with the discount code JavaScript.

I ran into this issue when I was creating my own custom cart that would interface with PayPal. My end solution was to include the Discount item (at $0.00) for code tracking and instead spread the discount amount between whatever items were in my cart (I was directly dumping the cart to PayPal so I could do this when the customer checks out).


Clay Butler comments:

So far the e-junkie seems easier (but more expensive) than created double (or tripple) versions of each product and then using javascript to switch it out.


Duncan O'Neill answers:

Since you're using a hosted button you'd need to generate the code yourself.

You need to add the hidden input variable discount_amount as on this page;

One way you can do that is described on this page;

( Post by wombat near the bottom of the page.) That is, generate the code, but don't save it, and copy that generated code into your page. Then you'll need some Javascript to add the hidden input element discount_amount if the coupon code matches.

Let me know if you need more details, or coding help.