How to add button to call <script>


(Brian Christmas) #1

G’day

My Payment Processor, FastSpring, has supplied me with code to paste into my Header code, that call up a subscription Payment window.

I assume I need to add an image to my main page to link to this code, but haven’t the foggiest on how to do this link.

And advice, please?

Regards

Santa

The code is


(Brian Christmas) #2

???

Site is, with added button for calling script…

http://meselfsoftware.com/Mail%20Manager/

Actual script, pasted into Head (recommended).

 <script
    id="fsc-api"
    src="https:///************svx3ha.cloudfront.net/sbl/0.7.4/fastspring-builder.min.js"
    type="text/javascript"
    data-storefront="maimanager.test.onfastspring.com/popup-maimanager">
</script>

(Brian Christmas) #3

FastSpring have guided me to a page that has this…

Triggering the Popup Window
The easiest way to show the popup on the page is by using an HTML directive:
Purchase “Product One”

I’ve check the html in the image ?I want to use to call the action, but cannot edit it.

Can anyone tell me where abouts in the following I’m supposed to add the above code, and HOW, please? (had to add as screen shot, cannot edit)


(Brian Christmas) #4

The code to add is…

Triggering the Popup Window

The easiest way to show the popup on the page is by using an HTML directive:

a href=’#’ data-fsc-action=“Add,Checkout” data-fsc-item-path-value=“product-one”>Purchase “Product One”


(scott williams) #5

Is it a stacks page ?

Need to no the details of the page.

That code is just HTML could just use HTML stack or use a button stack


(Brian Christmas) #6

I’ve just created my site using the last ‘create a site in 5 minutes’ video from the beginners section.

Don’t know what a stacks page is!!!

I just have an image, that I need to be able to click on, and have that code activate, somebloodyhow!.

http://meselfsoftware.com/Mail%20Manager/ http://meselfsoftware.com/Mail%20Manager/

It’s the ‘Subscribe’ button

Thanks


(scott williams) #7

Try This:

select the button image
at the bottom of your screen click the link button (looks like link of chain)
for the URL just put a #(hash)
in custom attributes add what I have in below screen shot.

This should build the html string you need and attach it to that image

ZZ171D957B

EDIT: I notice it truncated the name. use the full info from the link code you posted above.

data-fsc-item-path-value


(Brian Christmas) #8

Thank you Scott. I very much appreciate you helping.

Unfortunately it doesn’t work. I’ve tried pasting into your code in several positions, but don’t know if it’s me stuffing up, to your method, or the stores not working.

I have dragged my additional code as a textClipping, and it opens a page of a LOT of text, so presume that’s the code for the pop-up.

Am I pasting into the correct place? (Asterixes only added for screen shot).

Regards

Brian (aka Santa to my mates in Oz)


(Brian Christmas) #9

PS, I’ve saved it on my website, so you can see the actual result.


(scott williams) #10

I’ll have a look when I get back to my computer, in the mean time it would help if you could paste all the actual code they gave you here.

Paste the code in then highlight it and click the </> button in the toolbar, that will allow you to paste the actual code in the chat


(Brian Christmas) #11
<script
    id="fsc-api"
    src="https://******xcsvx3ha.cloudfront.net/sbl/0.7.4/fastspring-builder.min.js"
    type="text/javascript"
    data-storefront="mailmanager.test.onfastspring.com/popup-mailmanager">
</script>

6 characters replaced with ‘*’


(Brian Christmas) #12

Scott, I don’t want to post the entire pass code into the forum, but if you need it, contact me off list at ozsanta@gmail.com


(Brian Christmas) #13

I’ve just re-check the code required to call the header script

Its…

a href=’#’ data-fsc-action=“Add,Checkout” data-fsc-item-path-value=“product-one”>Purchase “Product One”

Not the “product-one”>Purchase “Product One”, which I believe should be “mail-manager”>Purchase “Mail Manager”

I have no idea how to add that to your suggestion, but I think it needs the >Purchase “Mail Manager”


(Brian Christmas) #14

Oh, and I had to remove the starting left carat, and the ending ‘left carat’ & ‘a’ & ‘right carat’


(Oliver) #15

Hello @ozsanta,

even though I didn’t use FastSpring yet, I try to figure out why its not working.

First: Did you get in contact with the FastSpring-Support? If not, please do so, as they need to whitelist your domain. Otherwise the popup will not appear.

Then, try this:

I looked in your website’s source code and noticed, that one of your attributes got destroyed (as you can see in the following image).


(BTW there is no need to obfuscate the link as its available in the official documentation.)

As they said nowhere in the documentation that the link should look like this I’m pretty sure that this is not the way its supposed to be set up.

Try it the way I showed in the first image.

Hope this helps, happy weaving.

~N


(Brian Christmas) #16

Thanks Mate.

It’s 5:21am here. I haven’t slept, so mind is foggy.

However, while waiting for your advice, /I remembered FastSpring created two pop-up store fronts for me. One for an https secure site, and one http.

My sites not secure, but their site generated an https script, and I cannot get it to generate an http script, which will inevitably have a different code.

I’ve already had both forms whitelisted, but have sent a request to make my sire secure with a security certificate.

Perhaps then it will work. But, thanks again. I did not find your approach anywhere on the net over the last two days.

I’m now assuming the ‘>“Mail Manager”’ means ‘returns “Mail Manager”’. Hope so!

Regards

Brian Christmas


(Oliver) #17

I guess this occurred because of the broken link attribute. The '> is a normal thing, just a part of a tag with an attribute’s value closing quotation mark, like <a href='# '>.

And I beliefe I also discovered the error why its still not working -> there is a mistake in your script within the head-section.

This is the current link in your website.

<script id="fsc-api" src="https-equiv://d1f8f9xcsvx3ha.cloudfront.net/sbl/0.7.4/fastspring-builder.min.js" type="text/javascript" data-storefront="mailmanager.test.onfastspring.com/popup-mailmanager">
</script>

But this js-file cannot be loaded -> the link is wrong. In fact, the -equiv-part is the problem. Delete it and the file can be loaded, I just tried it.

<script
    id="fsc-api"
      src="https://d1f8f9xcsvx3ha.cloudfront.net/sbl/0.7.4/fastspring-builder.min.js" type="text/javascript"
      data-storefront="vendor.test.onfastspring.com/popup-vendor">
</script>

This is the sample link FastSpring provides in the docs. As you can see, there is no -equiv. Republish your website with this link and it should work.

~N


(Brian Christmas) #18

Oliver, thank you, but the published change does not work.

I’m wondering… FastSpring set up two pop-ups, one with http, and the other with https

My site at the moment is NOT secure, and it will take about 4 days to get as secure certificate.

When I try and get the code insert, it only offers what I originally published, with https, and I assume if I could get code for http, which probably would have a different number, the code might work.

Hopefully with a suitable certificate, it will work. I don’t know enough about html to know.

How did you get your modified code to run and download the pop-up store front, please?

I’ve re-published with your amended code, as below…

Regards

Santa


(Oliver) #19

Hi @ozsanta,

if it really depends on the site security, you can create a free certificate here. This is a certificate by Let’s Encrypt, which should be accepted by most browsers nowadays (definitely firefox).

Try this first. Anything else needs more investigation.

~N