Okay
  Public Ticket #2757981
PayPal Button for Event
Closed

Comments

  • colorcoder started the conversation

    Hello,

    I am wanting to be able to add a PayPal button to your event calendar.,  When someone clicks a date it should click the button.  Can that be done?


    Thanks

  • colorcoder replied

    Even if I could just add a link / url that would go to paypal.


    Thanks

  •  877
    Zhivko replied

    Hi,

    I'd suggest you to use the PayPal tools to create the html of the button.

    And then paste the html in the event's description field. The field supports html code.


    Stachethemes Developer

  • colorcoder replied

    Hey There,


    I have tried adding a PayPal button to what I think you meant by description - but to get to it the user is required to click on the event first then he will see the new button.  We want to replace the existing ticketing system with this new method and our preference is to have the user click on the paypal button as soon as he clicks on the event in the calendar and not from the subsequent page.  We would also like that button to be visible on the main calendar.  Can you help with that?


    Thanks

    Scott

  • colorcoder replied

    Hello.  I am reaching out again for help.  I am a paid user of your Stachethemes Event Calendar,  and really need some support.

    Is there a way where I can click an event directly on the calendar and have that take me to pay for the event using paypal.   I can get a url to the paypal payment.  it seems like this should be possible.

    Thanks

    Scott

  •  877
    Zhivko replied

    The following code will redirect the user to event's external link if such link is set in Admin Add / Edit Event Page -> Introduction Tab -> External link field.

    This mod works for month and week layouts.

    /**
     * STEC MOD: Month and Week layout. 
     * Redirects user to event's external link on click
     * If event has no external link it will use the default calendar behavior
     */
    add_action('wp_footer', function() {
        if ( !wp_script_is('stec-js') ) {
            return;
        }
        ?>
        <script type="text/javascript">
            (function ($) {
                $(function () {
                    $.stecExtend(function (m) {
                        m.$instance.on(m.helper.clickHandle(), '.stec-layout-month-daycell-event, .stec-layout-week-daycell-event', function () {
                            var event = m.calData.getEventById($(this).data('id'));
                            if (event.link && event.link.url) {
                                window.open(event.link.url, '_self');
                                m.eventsHandler.eventHolder.close();
                            }
                        });
                    });
                });
            })(window.jQuery);
        </script>
        <?php
    });

    Place the code in your theme or child-theme functions.php file.


    Stachethemes Developer

  • colorcoder replied

    Thank you.  I'm assuming the code goes in functions.php?

  •  877
    Zhivko replied

    Yes, preferably in your child-theme functions.php file.


    Stachethemes Developer