- This topic has 2 replies, 2 voices, and was last updated 11 years, 6 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Place Short Code into Page from a JavaScript
Tagged: java variable to page, product purchase from javascript, Short code from Java variable to page
I have quite a unique situation
I have a java script which recommends products. within the Java Script I have defined a variable which is the eStore buy now short code for the product being recommended.
I am calling the Java Script from a IFrame within a page in WordPress
I would like to have the Java Script return to the page with the short code to display the eStore buy now button in the page, after the recommendation has been made.
This is a striped out version of the code in the Iframe, called from an HTML file with the Java embedded in the HTML.
[admin deleted custom JS code after checking it]
Any Suggestions how I can get the Java Variable to display the buy now button on the WordPress page?
Thanks
Hi, You won’t be able to execute a shortcode from JavaScript like that.
You might be able to get better result with this text link feature:
You should be able to redirect the user to a particular link (that is a product purchase link) from your JavaScript code.
This is perfect, actually better than I could ask for, as it allows a link from outside the domain.
Thanks so much