PHP Script: Trying to pull a custom URL from the backend of our wordpress database and have it displayed in an iFrame in a particular field on our woocommerce checkout page. I have it working but it is not consistent and I am using a “filter” but I believe it requires as “action” Maybe would be better to also create a button that initiates the iframe.
This is the current working script. I do not know anything about PHP or WordPress, I have just been tasked to get this to work:
$current_user = get_current_user_id();
$url = get_user_meta($current_user,'order_url_string',true);
echo '<iframe ... src="'.urldecode($url).'"></iframe>';
What I did here was create a custom field for the checkout page with ID "order_custom_url_input" and this script grabs the custom URL from the backend (which is provided by a third party credit card processor) and it then populates the input field and echos an iFrame above it. It seems to work with some browsers and systems but not all and not all the time. I belive it can be written a different way with an "action" and without the need for it to populate the custom input field I made.