Droplet - Populate discount_code with JS Cookie or Variable using JS

edited June 2016 in Developers
Hi Peeps!

I am trying to populate the Droplet ‘discount_code:’ field with either a global variable or cookie ...

I can’t use the PHP get cookie function, since the droplet will be published on a page with super cache, wondering if you had some advice? ... 

Mission pre-populate the voucher field from a cookie populated from a query string.
www.website.com/?Discount=Cupon01

Any advice?

:)

Comments

  • Never mind, I am an idiot :)
  • I am still having issues with this, thought I solved it!

    :(
  • Hi Nick,

    Thanks for replying. 

    The website is compressed with WP Rocket, basically an HTML file at the end, that's why echoing PHP won't work.

    I could easily not cache those pages, but with a site that sells as much as we do, caching is key.

    That's why I was hoping JS would solve this. PS I am also going to modify the tid to include the source from marketing campaigns using this same method (if I ever solve it).








Sign In or Register to comment.