简体   繁体   中英

Adding stripe button to the pricing table

I'm using marketers delight 3 wp child theme, their pricing tables. I want to replace the standard "order now" button with the stripe script button. I can only put URL's in that field. What can I do in this case? Here is the stripe script itself:

<form action="/charge" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="xxx"
    data-image="/square-image.png"
    data-name="xxxx"
    data-name="Silver Package"
    data-label="Buy the Silver Package - $29.99"
    data-description="Silver Package ($29.99)"
    data-amount="2999">
  </script>
</form>

How can I add this button to the pricing table if that Order Now field can be filled only with an URL?

Edit the theme. Open up the template for that specific part, remove or comment the button with php so it does not show up in devtools and place this stripe code.

Might not be the best approach, pick the one you like the most

  1. Try to inject it into the href field like this:

    $injection= ' ">'.$stripe_button_code.' <a style="display:none';

    <a href="<?=$injection;?>"> title

  2. Try to put an onclick action on the link that clicks on the stripe button somewhere on the page

  3. Same as 2 but if you can't use onclick maybe you can use javascript:function(){ } for the href

  4. Edit the theme file and do it without work arounds [Reccomended]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM