Support » Plugins » Hacks » Using script value in shortcode

  • Hi
    I am currently working on a site for a client, which needs a price generator. The pricing generator is javascript, and works like this:
    Test version
    (View the code by using your browser’s source text function)

    I would now like to take the chosen values and the result and add to the shortcode for my shop-plugin, which looks like this:

    [wp_cart_button name=”VALUE 1 to VALUE 2″ price=”RESULT”]

    This is where the shop is located, if you would like to view that as well.

    The plugin is WP Simple Paypal Shopping cart v3.8.5

    I hope this is the right forum, and thanks in advance. Just ask if you need more information, I’m here to get help 😉

Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    Javascript can only pass information back to the server and PHP via some HTTP request. Either as URL parameters for GET requests or as a data string for POST requests. Any cookie values are also passed with each request.

    It’s not trivial, nor necessary, to insert data passed from javascript into shortcode attributes. The passed values will be directly available from $_REQUEST or it’s related super global arrays by the shortcode handler.

Viewing 1 replies (of 1 total)
  • The topic ‘Using script value in shortcode’ is closed to new replies.