Sitelok php button


(Drew) #1

This might be really simple or just not doable.
I just started using sitelok on my site. Im trying to add a sitelok - Stripe button to my RW page.
The code provided is this…

<?php echo sl_get_stripe_button(array("pid"=>"AllAccessY","objid"=>"OBJECTID","page"=>"autoregister","bill_address"=>"","bill_city"=>"","bill_state"=>"","bill_zip"=>"","bill_country"=>"")); ?>

When I add this to an html stack or as piece of code in the body this appears when the page is published…

Fatal error: Call to undefined function sl_get_stripe_button() in /private/var/folders/gk/h23smb_x73sg7g0z6grs7fsr0000gp/T/com.realmacsoftware.rapidweaver/RapidWeaver/3253/document-0x6000003fe800/RWDocumentPagePreview/register.php on line 196

When I add the code to the PHP page with a text editor and upload the button works.

Is there s simple way to add the code in RW?


(Mathew Mitchell) #2

Drew: I’m guessing a little bit because I don’t use the Stripe button. But I use Sitelok all the time. All my code is placed either in the Prefix section of the HTML Code area (see Page Inspector) or sometimes with something like the Disqus plugin with Sitelok there’s a portion I additionally put in the Head section.

My guess is your entire code goes in the Prefix section.


(Drew) #3

Unfortunately that doesn’t work. I get the same error when I add it in prefix head or body.


(scott williams) #4

Did you actually publish the page? Some php won’t show in preview.
Is the page set to php?


(Doug Bennett) #5

I don’t use siteLok, but from a PHP perspective, you are using a function that does not exist. Do you need to add something like a
require_once()
With a sitelok library in the ()?
Perhaps @vibralogix can explain.


(Drew) #6

Yeah I have tried publishing and get this error and nothing else on the page…

Fatal error: Call to undefined function sl_get_stripe_button() in /home/n6x9t2/public_html/themacu/register.php on line 1

As far as being set to php the page name is register.php. Is there something else I should do to change it?


(Drew) #7

Why would it work when I just paste it into the page with a text editor then?


(Doug Bennett) #8

This is not a standard PHP function, As I said I don’t know sitelok but that function would need to be defined in an include library ahead of using it.

It might be the location you are pasting.


(Mathew Mitchell) #9

Where did you get this code from? I’m looking at the Stripe manual for Sitelok and I’m seeing no such code. As Doug mentioned, there seems to be something very off about the code you are using.

For example in the manual it mentions this with OBJECTID:

In this case you need to replace OBJECTID in the button code with the id of the html object.

So at the very least your use of OjbectID seems to be incomplete.

The developer lives in England but I would email him directly. He is fantastic with support. To my untrained eye (since I don’t use the Stripe plugin) the code you are using looks both incomplete and incorrect. But I haven’t the foggiest about how to help you out. And, of course, I may be wrong.


(Drew) #10

It gets produced on the stripe plugin page in sitelok. Its set up for a specific membership plan on stripe. Screenshot attached.
The code works when I paste it into the right spot of the page with a text editor. Thats the weird thing.


(Jason Bostick) #11

Have you tried highlighting all of your code in the HTML stack and selecting Format -> Ignore Formatting?


(Drew) #12

That worked!! Great call, I knew it was going to be something stupid like that!

Thanks!