• Resolved GuyB9290

    (@guyb9290)


    Hello,

    Great plugin and really easy to use and setup.
    I’m trying to use the Shortcode with parameters in my functions.php file like this:
    function action_woocommerce_before_add_to_cart_button( ) {
    echo do_shortcode ( ‘[wp_paypal_payment_box options=”Event promoted once – £5 1:5.00|Event promoted 2 or more times – £10 2:10.00″]’ );
    return;}
    add_action( ‘woocommerce_before_add_to_cart_button’, ‘action_woocommerce_before_add_to_cart_button’, 10, 0 );

    Nothing happens, and I’m sure I’m doing something wrong with the way I pass the parameters but can’t figure out how to fix it – can you help me please?
    Thanks
    Guy

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mra13

    (@mra13)

    What happens if you do an echo inside that function just to see if that function is actually getting executed? If that action hook is not getting executed then the shortcode will never show.

    Thread Starter GuyB9290

    (@guyb9290)

    Thanks for getting back to me, I worked it out already. It seems that the Shortcode doesn’t like the ‘reference’ parameter
    This is what worked for me:
    echo do_shortcode(‘[wp_paypal_payment_box email=”sally@herefordequestrian.co.uk” options=”Event promoted once for 1 month:5.00|Event promoted 2 or more times for 2 months:10.00″ currency=”GBP” reference=”Event Name & Date” return=”http://www.herefordequestrian.co.uk/successful-payment/” cancel_url=”http://www.herefordequestrian.co.uk/cancelled-payment/” new_window=”1″]’);
    Thanks for getting back to me
    Guy

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using the shortcode’ is closed to new replies.