why there’s that file in wp-admin? Did you put it there? If yes … not a great choice, but whatever.. π
So take a look here:
http://volatylthemes.com/footer/
technically it is supposed to be .com/discount.js and right now is .com/wp-admin/js/discount.js
i do not understand the process itself of how this script will activate on the PayPal form, or how to implement (where to paste script)…
@d4z_c0nf
I do not have a child theme… these snippets have child theme in them.
Also I do not know where to paste the script to activate on PayPal form.
βββ±β±ββ±β±β
ββββ±βββ±β
ββββ±βββ±β
βββββββ±β
ββββ±βββ±β
ββββ±βββ±β
______________
βββ±β±β±β±β±β
βββββββ±β
ββββ±ββββ
ββββββββ
ββββ±β±β±β±β
βββββββ±β
_____________
ββ±β±ββββ
βββ±ββββ
βββ±ββββ
βββ±ββββ
βββ±β±β±β±β
ββββββ±β
_____________
ββ±β±ββββ
βββ±ββββ
βββ±ββββ
βββ±ββββ
βββ±β±β±β±β
ββββββ±β
ββ±β±β±β±β±β
ββββββ±β
βββ±βββ±β
βββ±βββ±β
βββ±β±ββ±β
ββββββ±β
Here is what I done so far:
I went to this link and copy HTML snippet:
// Add scripts to wp_footer()
function child_theme_footer_script() { ?>
<script type="text/javascript" src="http://drivesafe2015.org/wp-admin/js/discount.js"></script>
<?php }
add_action( 'wp_footer', 'footer_script' );
Still, when I use promo code box there is no result.
For example you can try code 5OFF and nothing happens (supposed to be javascript popup window.
Where did you add that code snippet? I would remove it and add it to your site this way:
- Install the Header and Footer plugin. This plugin will allow you to add script to the
head section of your site.
- After installing and activating the plugin, go to Setting → Header and Footer and copy & paste the link into the Code to be added on HEAD section of every page field:
<script type="text/javascript" src="http://drivesafe2015.org/wp-admin/js/discount.js"></script>
@d4z_c0nf
Either this does not work or I did something wrong (probably the latter).
@crouchingbruin
I downloaded the plugin and pasted the above code into both head section of every page and home page fields and the PayPal discount code box script still is not working.
When I do a view source on your site, I see the link, so the code is there and available.
You need to make a change to your discount.js code, though. These two array definitions:
var coupons = new Array ( // place to put coupon codes
"5OFF", // 1st coupon value - comma seperated
"50FF", // 2nd coupon value - add all you want
);
var coupdc = new Array ( // place to put discounts for coupon vals
25,
25,
);
You need to remove the comma after the last value in each array so it looks like this:
var coupons = new Array ( // place to put coupon codes
"5OFF", // 1st coupon value - comma seperated
"50FF" // 2nd coupon value - add all you want
);
var coupdc = new Array ( // place to put discounts for coupon vals
25,
25
);
IT WORKS!
The problem was the commas; there were 3 values originally, and we left the commas unknowingly.
Thank you so much to both for your help π